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

Handle completions with trailing whitespace on previous lines #2319

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

333fred
Copy link
Contributor

@333fred 333fred commented Dec 31, 2021

LSP filters expect that the range of the main text edit is going to start on the same line as the cursor. However, when trailing whitespace preceeds the override marker, Roslyn will return a single text edit for the whole range that trims that whitespace. This confuses the vscode intellisense engine, which then unhelpfully displays no completions with no user feedback that this filtering is happening. To avoid this, we now detect when this case occurs, and split up the change into non-overlapping edits from before the current line. Fixes dotnet/vscode-csharp#4600.

LSP filters expect that the range of the main text edit is going to start on the same line as the cursor. However, when trailing whitespace preceeds the override marker, Roslyn will return a single text edit for the whole range that trims that whitespace. This confuses the vscode intellisense engine, which then unhelpfully displays no completions with no user feedback that this filtering is happening. To avoid this, we now detect when this case occurs, and split up the change into non-overlapping edits from before the current line. Fixes dotnet/vscode-csharp#4600.
@333fred
Copy link
Contributor Author

333fred commented Dec 31, 2021

microsoft/vscode#41022 would have been very useful for helping debug this issue.

@filipw filipw merged commit 553dcd2 into OmniSharp:master Jan 6, 2022
@333fred 333fred deleted the override-bug branch January 6, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Override code generation not working
2 participants