haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Prevent intellisense suggestions and auto imports when writing comments

Open alirezaghey opened this issue 4 years ago • 5 comments

Right now, when you refer to a library in comments, Data.Either for instance, the extension auto suggests importing that library and imports it automatically if you press enter. It also kicks into action if you start your comment with >>>.

IMO, it would be better if the extension would avoid automatic activity when we are writing comments and only do so on specific request (by pressing ctrl+space for example).

alirezaghey avatar Oct 03 '21 12:10 alirezaghey

Transferred to haskell-language-server as it the source of suggestions (quick fixes/code actions)

jneira avatar Oct 22 '21 05:10 jneira

I think this is the client's problem. At least for emacs, whether or not to ask for completions in comments is a setting in the client.

Also, you might want completions in comments, e.g. for linking to types in Haddock comments.

michaelpj avatar Mar 15 '22 14:03 michaelpj

TBH, this continues to be pretty annoying and people report it in multiple clients. So we probably should try and avoid it, although I'm not sure how.

michaelpj avatar Jun 21 '24 09:06 michaelpj

LSP server should be able to determine if cursor is inside comment block or comments are already stripped from source after parsing? If it's able then I believe autocompletion only makes sense inside @-code blocks inside comments.

Anrock avatar Jun 21 '24 14:06 Anrock

Presumably, we are not checking correctly in getCContext, whether the cursor is part of an annotation? Might be a nice project for the next hackathon.

fendor avatar Jun 22 '24 14:06 fendor