Emulate suggestion mode in LSP completion by always soft-select#69327
Emulate suggestion mode in LSP completion by always soft-select#69327genlu merged 1 commit intodotnet:mainfrom
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.
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.
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.
VS doesn't have it either in the LSP client.
Wat.
There was a problem hiding this comment.
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.
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.
TIL. Sounds like we need to try that! Thanks
|
@genlu can you add a test case for typing |
Fix dotnet/vscode-csharp#5732