Open alirezaghey opened 3 years ago
Transferred to haskell-language-server as it the source of suggestions (quick fixes/code actions)
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.
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.
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.
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.
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).