-
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
Grab bag of UTF8 string support in IDE features #60599
Conversation
SyntaxKind.SingleLineRawStringLiteralToken, | ||
SyntaxKind.MultiLineRawStringLiteralToken, |
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 see these already existed before your change. But I'm confused with it when reading this comment:
roslyn/src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceTransform.cs
Lines 126 to 129 in c8ebc86
// if this line is inside a string-literal or interpolated-text-content, then we definitely do not want to | |
// touch what is inside there. Note: this will not apply to raw-string literals, which can potentially be | |
// dedented safely depending on the position of their close terminator. | |
if (tree.IsEntirelyWithinStringLiteral(textLine.Span.Start, cancellationToken)) |
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.
Yes, interesting disconnect there. The comment isn't wrong, in that raw strings can be potentially dedented, but definitely outside the scope of this PR.
if (token.IsKind(SyntaxKind.UTF8StringLiteralToken) || | ||
token.IsKind(SyntaxKind.UTF8SingleLineRawStringLiteralToken) || | ||
token.IsKind(SyntaxKind.UTF8MultiLineRawStringLiteralToken)) | ||
{ | ||
text = Keyword("UTF8StringLiteral"); | ||
return true; | ||
} | ||
|
||
if (token.IsKind(SyntaxKind.SingleLineRawStringLiteralToken) || | ||
token.IsKind(SyntaxKind.MultiLineRawStringLiteralToken)) | ||
{ | ||
text = Keyword("RawStringLiteral"); | ||
return true; | ||
} |
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.
@BillWagner FYI to use those f1 keywords when documenting the features
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.
Currently F1ing on a UTF8 string goes to a "No help content found" page, so its not a big deal IMO if these keywords are specified before docs pages exist/are updated.
Retargeting to main so we can remove main-vs-deps branch |
src/EditorFeatures/CSharp/BraceMatching/StringLiteralBraceMatcher.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/SplitStringLiteral/SimpleStringSplitter.cs
Outdated
Show resolved
Hide resolved
/azp run roslyn-integration-corehost |
Azure Pipelines successfully started running 1 pipeline(s). |
ping @dotnet/roslyn-ide for review |
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.
LGTM. Can you add tests to MoveToFile as well to make sure they get handled correctly? (I didn't see any in source prior to this change)
src/EditorFeatures/CSharp/TextStructureNavigation/CSharpTextStructureNavigatorProvider.cs
Show resolved
Hide resolved
src/EditorFeatures/CSharp/TextStructureNavigation/CSharpTextStructureNavigatorProvider.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs
Show resolved
Hide resolved
Will do, but I'm curious, did you have something specific in mind for this? It would surprise me if MoveToFile was sensitive to new syntax nodes that aren't new member declarations. |
Actually.. I'm struggling to work out where a test for MoveToFile would make sense. Just to be clear do you mean |
…res/required-members * upstream/main: (66 commits) Fix #55183: Add SymbolVisitor<TArgument, TResult> (#56530) Simplifier options (#60174) Remove duplicated asset Do not try to refcount solution syncing when communicating with OOP Delay symbol-search index updating until solution is fully loaded. add more miscellaneous tests for checked operators (#60727) Support checked operators in explicit interface implementation (#60715) Avoid formatting diagnostics with raw strings (#60655) Make heading levels for warning waves documentation consistent (#60721) Clean up IDiagnosticService extension methods Remove #nullable enable Add integration test to flag MEF composition breaks Generate static abstract interface members correctly (#60618) Merge release/dev17.2 to main (#60682) Fix FAR on checked operators (#60698) Add implement interface support for checked operators and cast operators (#60719) Update csc.dll path in launch.json (#60663) Grab bag of UTF8 string support in IDE features (#60599) Allow code actions to retrieve options for any language (#60697) Fix flaky VSTypeScriptHandlerTests (#60706) ...
…o setsrequiredmembers * upstream/features/required-members: (66 commits) Fix dotnet#55183: Add SymbolVisitor<TArgument, TResult> (dotnet#56530) Simplifier options (dotnet#60174) Remove duplicated asset Do not try to refcount solution syncing when communicating with OOP Delay symbol-search index updating until solution is fully loaded. add more miscellaneous tests for checked operators (dotnet#60727) Support checked operators in explicit interface implementation (dotnet#60715) Avoid formatting diagnostics with raw strings (dotnet#60655) Make heading levels for warning waves documentation consistent (dotnet#60721) Clean up IDiagnosticService extension methods Remove #nullable enable Add integration test to flag MEF composition breaks Generate static abstract interface members correctly (dotnet#60618) Merge release/dev17.2 to main (dotnet#60682) Fix FAR on checked operators (dotnet#60698) Add implement interface support for checked operators and cast operators (dotnet#60719) Update csc.dll path in launch.json (dotnet#60663) Grab bag of UTF8 string support in IDE features (dotnet#60599) Allow code actions to retrieve options for any language (dotnet#60697) Fix flaky VSTypeScriptHandlerTests (dotnet#60706) ...
Fixes most of #60582
Relates to #58848
Also fixed a couple of raw string things that were missed. If the review is too annoying, each commit is a separate IDE feature.