ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
409 stars 154 forks source link

[Feature request]: Ability to complete after the beginning of the line #897

Closed quantum-booty closed 2 years ago

quantum-booty commented 2 years ago

I am using vim-Ionide, and in this issue I raised a problem where if I can only get completion at the start of the line, whereas anything after wont, for example:

These are the completion items I get if I type at the beginning of the line: image I'd expect set a = pr to give me the same completion items, but in reality I get no completion: image Also no completion inside pattern matching: image No completion in type: image No completion in a comprehension: image No completion in function: image

It would be great if we can get completion even if not at the beginning of the line.

baronfel commented 2 years ago

I went through and tested all of your scenarios in Visual Studio 2022, and they do all trigger completions. It's likely a bug in FSAC that these experiences don't align.

baronfel commented 2 years ago

I take it back - those all work for me in VSCode/Ionide with FSAC. One thing I do see is that if I invoke the completion list (manually or automatically based on IDE configuration) when I have only one character typed, the list only contains that first character. This useless completions list persists even when I type more characters, e.g. pr. If I dismiss this completion list and invoke it again (manually or automatically), I get a useful completions list, e.g. pr suggesting printf and friends.

Moreover, looking at the LSP request/response logs, I see the appropriate responses in every case - that is, typing a new character with the completion list open triggers a new call to textDocument/completions, even if that response isn't used by the editor to update the list.

baronfel commented 2 years ago

We've had some enhancements done recently that seem to completely fix the behavior of completion in the 1 and 2 character scenarios and in situations where there are no lines the line being edited. A superstar contribution by a community member :) Keep an eye out for that release - it may very well fix your issue!

baronfel commented 2 years ago

@quantum-booty have you had a chance to look at this in FSAC 0.52.0 and later?

quantum-booty commented 2 years ago

@quantum-booty have you had a chance to look at this in FSAC 0.52.0 and later?

I just tried the latest FSAC, and it works awesomely well! Thank you contributers for your hardwork!