-
Notifications
You must be signed in to change notification settings - Fork 191
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
Completing C# await
keyword in non-async methods results in the wrong cursor location being used due to formatting.
#6127
Comments
Just interesting: how did you get what LSP sends to the client (and vice versa if it is possible)? I've tried once, but it was buried somewhere too deeply, so I didn't find out how to get the raw text of requests and responses in the end... |
If you boot |
Are we using |
@dibarbet would you mind validating whether this is fixed by your recent changes? |
it is not - it needs this fix - dotnet/roslyn#60499 (+ razor side fix for formatting which I have locally) as well as a fix for dotnet/roslyn#60598 |
Fixed via: #6626 |
Will this fix work in 17.4 p1 by default, or some settings will be requred to be changed? I've seen some tweaks around new single-server completion (whatever this means) and as far as I know it won't be enabled for all clients by default. If I'll need to change this setting, can you please tell where to find it, thanks! |
Will work by default. I pushed single server completion on-by-default in 17.4. I still have all the feature flags around in case we see something catastrophic happen I can remotely disable it for the world 😄 |
Describe the bug:
Completing the
await
keyword in non-async methods results in Razor generating an incompatible edit that moves the cursor location.Version used:
17.2-Preview1+
To reproduce:
|
):await
Expected Behavior:
Cursor is after
await
Actual Behavior:
Additional Notes:
I dug into why this was happening and C# is depending on
completionItem/resolve
to fill out the text edit for that completion item. Only problem is the TextEdit C# returns is valid but Razor transforms it into something invalid.Original C# completion item text edit (from C# server):
After Razor formats the edit (from our HTMLC# server):
Note the extra newline and spaces after
await
.One extra piece I found interesting is that C#'s completion item says it's a snippet but doesn't actually provide any tab-stops. Technically this is valid in the LSP specification but felt weird (fyi @dibarbet).
The text was updated successfully, but these errors were encountered: