Skip to content

Enable CodeActions support for XAML#52129

Merged
mgoertz-msft merged 1 commit intodotnet:mainfrom
mgoertz-msft:dev/mgoertz/codeactions
Mar 25, 2021
Merged

Enable CodeActions support for XAML#52129
mgoertz-msft merged 1 commit intodotnet:mainfrom
mgoertz-msft:dev/mgoertz/codeactions

Conversation

@mgoertz-msft
Copy link
Contributor

Enable CodeActions support for XAML using its own provider and CodeActionCache. The handlers are actually shared with Roslyn as is.

Switch to using a path to DocumentId cache in the XamlProjectService to avoid unnecessary and sometimes dangerous transitions to the main thread during TrackOpenDocument calls.

…tionCache. The handlers are actually shared with Roslyn as is.

Switch to using a path to DocumentId cache in the XamlProjectService to avoid unnecessary and sometimes dangerous transitions to the main thread during TrackDocument calls.
@mgoertz-msft mgoertz-msft requested a review from a team as a code owner March 25, 2021 00:10
@ghost ghost added the Area-IDE label Mar 25, 2021
Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, just wanted to make you aware of the limitations - anything that is not an ApplyChangesOperation code action will be run as a command on the server. So it is a little fragile if the server makes changes to files the client has open in non-apply changes

Additionally, the server must switch to the UI thread to apply the command. This can cause deadlocks when using LSP locally, see #51951

@mgoertz-msft mgoertz-msft merged commit ef49312 into dotnet:main Mar 25, 2021
@ghost ghost added this to the Next milestone Mar 25, 2021
@mgoertz-msft
Copy link
Contributor Author

Thanks @dibarbet. I did run into an LSP deadlock when expanding the lightbulb which prompted me to change the TrackOpenDocument code to avoid unnecessary thread transitions, but I can see how this could become an issue if CodeActions themselves do a SwitchToMainThreadAsync. Hmm...

@mgoertz-msft mgoertz-msft deleted the dev/mgoertz/codeactions branch March 25, 2021 14:34
@333fred 333fred mentioned this pull request Mar 25, 2021
333fred added a commit to 333fred/roslyn that referenced this pull request Mar 25, 2021
* upstream/main: (75 commits)
  Split BoundInterpolatedString into BoundInterpolatedString and BoundUnconvertedInterpolatedString (dotnet#52061)
  Combine VB comparers into one, and combine VB and C# comparers together (dotnet#51834)
  Use OptimizedVSCompletionList in LSP scenarios.
  F5 Hot Reload (dotnet#52101)
  Fix typescript shim
  Add tests for lazy syntax trees coming from the GeneratorDriver
  React to code review feedback.
  Simplify the lazy-initalization pattern used in GetRoot
  Remove an unnecessary override. (dotnet#52140)
  Update issue number (dotnet#52130)
  Enable CodeActions support for XAML using its own provider and CodeActionCache. The handlers are actually shared with Roslyn as is. (dotnet#52129)
  Add RestrictedIVT to dotnet watch to Features (dotnet#52087)
  Don't try to highlight operators (dotnet#52041)
  Use `null` instead of empty signature helps in LSP
  Use member type for relational pattern even in error cases (dotnet#51950)
  Update src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Extensions/SymbolExtensions.cs
  Use new QuickInfoUtilities helper
  Rebuild API shape (dotnet#52079)
  Added position parameter name
  Updated XAML QuickInfo to show more info like C# by using ISymbolDisplayService and adding more documentation parts.
  ...
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
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.

3 participants