Skip to content
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

Merged
merged 9 commits into from
Apr 13, 2022

Conversation

davidwengier
Copy link
Contributor

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.

Comment on lines +421 to +422
SyntaxKind.SingleLineRawStringLiteralToken,
SyntaxKind.MultiLineRawStringLiteralToken,
Copy link
Member

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:

// 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))

Copy link
Contributor Author

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.

Comment on lines +136 to +149
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;
}
Copy link
Member

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

Copy link
Contributor Author

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.

@JoeRobich
Copy link
Member

Retargeting to main so we can remove main-vs-deps branch

@JoeRobich JoeRobich changed the base branch from main-vs-deps to main April 6, 2022 19:34
@davidwengier
Copy link
Contributor Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Contributor Author

ping @dotnet/roslyn-ide for review

Copy link
Contributor

@ryzngard ryzngard left a 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)

@davidwengier
Copy link
Contributor Author

Can you add tests to MoveToFile as well to make sure they get handled correctly?

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.

@davidwengier davidwengier enabled auto-merge (squash) April 13, 2022 07:00
@davidwengier
Copy link
Contributor Author

Actually.. I'm struggling to work out where a test for MoveToFile would make sense. Just to be clear do you mean MoveTypeTests? There don't seem to be tests for other string literals or even any other specific syntax nodes, so I'm not sure what you're looking to validate.

@davidwengier davidwengier enabled auto-merge (squash) April 13, 2022 07:48
@davidwengier davidwengier merged commit a96c8ac into dotnet:main Apr 13, 2022
@davidwengier davidwengier deleted the UTF8 branch April 13, 2022 20:52
@ghost ghost added this to the Next milestone Apr 13, 2022
333fred added a commit that referenced this pull request Apr 14, 2022
…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)
  ...
333fred added a commit to 333fred/roslyn that referenced this pull request Apr 15, 2022
…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)
  ...
@dibarbet dibarbet modified the milestones: Next, 17.3.P1 Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants