Skip to content
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

Prevent intellisense suggestions and auto imports when writing comments #2292

Open
alirezaghey opened this issue Oct 3, 2021 · 5 comments
Open
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request

Comments

@alirezaghey
Copy link

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).

@jneira jneira transferred this issue from haskell/vscode-haskell Oct 22, 2021
@jneira jneira added the type: enhancement New feature or request label Oct 22, 2021
@jneira
Copy link
Member

jneira commented Oct 22, 2021

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

@michaelpj
Copy link
Collaborator

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 michaelpj added the status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet label Jan 11, 2024
@michaelpj
Copy link
Collaborator

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.

@Anrock
Copy link
Contributor

Anrock commented Jun 21, 2024

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.

@fendor
Copy link
Collaborator

fendor commented Jun 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants