Don't try to highlight operators#52041
Conversation
src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I prefer the approach from #51841 (comment). Highlight references normally has right-affinity from the caret position. All we need to do is change it to have left-affinity from the caret position if the caret is located at the end of a non-empty selection.
This design has two benefits over the current approach from this pull request:
- Highlight references will be able to work for operators
- It establishes a general precedent for being able to explicitly clarify affinity for an operation by selection
|
Yes. i agree with Sam on this. :) |
|
I have unlocked the secret knowledge that operator highlighting only works with user defined operators, and thus I am able to understand the comments in this PR. Will update. |
This reverts commit 7416265.
…han caret position
|
Just realised a potential issue here: This change means there is a difference between local roslyn behaviour of document highlighting, and LSP behaviour. @dibarbet do you think thats an issue? |
talked offline - the difference is that here we'll send the start of the selection instead of the caret position as the location. So if the platform sent us both the selection and caret then we could make this work in LSP. @davidwengier to file tracking item for that. |
… know what that means!
* 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. ...
Fixes #51841
By filtering out operators the symbol finder returns the symbol to the left of the caret and everything else works as normal.