-
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
Emulate suggestion mode in LSP completion by always soft-select #69327
Conversation
return lspItem; | ||
} | ||
|
||
// VSCode does not have the concept of soft selection, the list is always hard selected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about this. It's not just VSCode that doesn't have soft selection, VS doesn't have it either in the LSP client. Should the above block (checking lspVSClientCapability
) even be present? Certainly we have this issue in VS in Razor, so is it just that nobody turns on LSP for C# files in VS, so this code is incorrect but we're just assuming it's correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS client has suggestion mode (VSInternalCompletionList.SuggestionMode
), so I assumed it has similar behavior s in VS. Maybe I was wrong, will need to try it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS doesn't have it either in the LSP client.
Wat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the doc-comment for VS client's suggestion mode, which suggests there's soft-selection. But as David said, it might not work as we expected.
//
// Summary:
// Gets or sets a value indicating whether the completion list should use suggestion
// mode. In suggestion mode items are "soft-selected" by default.
[DataMember(Name = "_vs_suggestionMode")]
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public bool SuggestionMode { get; set; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah VS LSP client does have some support for soft selection with the SuggestionMode
. I don't remember the extent of it, but it definitely exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. Sounds like we need to try that! Thanks
@genlu can you add a test case for typing |
Fix dotnet/vscode-csharp#5732