-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add 7.1 support to UpgradeProject, add #version directive #17957
Conversation
@gafter In VB, it was more natural to do |
I think doing whatever is most natural is fine |
e102079
to
ca415e6
Compare
FYI @OmarTawfik This is not 100% ready, but fixes UpgradeProject to handle the new 7.1 error code. |
aaef861
to
a74bba0
Compare
@dotnet/roslyn-compiler @dotnet/roslyn-ide for review. The compiler change is to add a new The IDE changes are small: adding keyword completion for |
@@ -153,6 +153,13 @@ Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithCloseParenToken(Microso | |||
Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithElements(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.TupleElementSyntax> elements) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax | |||
Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.TupleTypeSyntax | |||
Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax | |||
Microsoft.CodeAnalysis.CSharp.Syntax.VersionDirectiveTriviaSyntax | |||
Microsoft.CodeAnalysis.CSharp.Syntax.VersionDirectiveTriviaSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken hashToken, Microsoft.CodeAnalysis.SyntaxToken versionKeyword, Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.VersionDirectiveTriviaSyntax |
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.
This should not require any API changes, I think. A #version 7.1
directive is already an error in the lexer, where all of the version information (language and assembly) is available. I think the implementation of this pseudo-feature should just be to change the error that is produced when that is recognized, and leave the syntax tree the same as it would have been previously, with only the diagnostic changed.
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.
@gafter Tomas suggested that I use #error version
as the trigger, for the main scenario.
And I will talk to the IDE team about achieving the second scenario with some trick in the IDE test layer instead.
Does that sound alright?
I'll open another PR with different design. |
Adds #version (#17859)
Updates the UpgradeProject fixer as follow-up on #17894