-
Notifications
You must be signed in to change notification settings - Fork 4k
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
C# LSP Regex completion does not work as expected. #59545
Comments
@NTaylorMullen @dibarbet how does completion work in LSP? Does it not use the data in roslyn's completion items? |
@CyrusNajmabadi we convert the Roslyn completion item to the LSP completion item. I could imagine something going wrong here - https://sourceroslyn.io/#Microsoft.CodeAnalysis.EditorFeatures/Implementation/LanguageServer/Handlers/Completion/CompletionHandler.cs,209 LSP first looks at the Just guessing, but potentially it's using the label to commit incorrectly? |
Yes. That seems buggy. It should be using LSPCompletionProvider.GetChangeAsync to determine what actual change should be made. |
@CyrusNajmabadi note there are potential perf issues with providing text edits instead of insert text - @allisonchou how far did we get in the experiment to always provide text edits in completion? Did it end up being bad for perf? |
Our completio API has no concept of 'insertion text'. If we want to try to have logic htat finds that special data, it must only do so on providers where that is safe. e.g. the provider (or item) needs to opt into that in some way. If it doesn't, we need to fallback to using the actual API we have for computing the change. otherwise, we're just going to get this wrong :) |
We likely want to implement this work item before turning TextEdits on by default - dotnet/razor#4408 |
tracking this in #59773 |
Version Used:
Steps to Reproduce:
For instance:
Expected Behavior: commit works as expected
Actual Behavior: Extra content is duplicated / labels seem to apply? Gif is kinda long but shows a lot.
The text was updated successfully, but these errors were encountered: