-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Extract string interpolation alignment and format. #19089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michaelnebel
merged 9 commits into
github:main
from
michaelnebel:csharp/improvestringinterpolation
Apr 1, 2025
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
af6e1bd
C#: Extract alignment and format clauses of string interpolation expr…
michaelnebel 2ca5ec0
C#: Add some string interpolation tests with alignment and formatting.
michaelnebel a73a61b
C#: Add PrintAst test for string interpolation expressions.
michaelnebel 5ae7e5d
C#: Update other test expected output files.
michaelnebel acec97d
C#: Add change-note.
michaelnebel d9fb137
C#: Add upgrade- and downgrade scripts.
michaelnebel 00753a1
C#: Address review comments.
michaelnebel e30fed6
C#: Improve upgrade script.
michaelnebel 8e1282b
C#: Improve downgrade script.
michaelnebel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
csharp/downgrades/66044cfa5bbf2ecfabd06ead25e91db2bdd79764/expressions.ql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| class Expression extends @expr { | ||
| string toString() { none() } | ||
| } | ||
|
|
||
| class TypeOrRef extends @type_or_ref { | ||
| string toString() { none() } | ||
| } | ||
|
|
||
| from Expression e, int k, int kind, TypeOrRef t | ||
| where | ||
| expressions(e, k, t) and | ||
| if k = 138 then kind = 106 else kind = k | ||
| select e, kind, t | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this select the insert part of
einstead ofe?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered doing that as well, but it requires that we also make changes to the
expr_parentrelation as well (this is what I am vaguely hinting in the PR description).Basically, I am worried that I break some DB invariant by changing the parent/child relationship as a part of the script.
Should we attempt to make the better downgrade script? It requires
(1) Removing the insert expressions from the expressions relation
(2) Adjust the
expr_parentrelation(3) Consider if we need to do something with the new dangling align and format expressions.