Skip to content

Conversation

@pepeiborra
Copy link
Collaborator

@pepeiborra pepeiborra commented Jul 27, 2021

Provide completions for non-imported modules and automatically inserts new imports when necessary. The identifiers are extracted from the exports map, which no longer includes entries from *.Internal modules.

Things left for future work:

  • Qualified imports
  • Better display of completion suggestions by default

This partially closes #1327

Screen.Recording.2021-07-27.at.10.03.30.mov

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this nice feature, tests looks great

@pepeiborra
Copy link
Collaborator Author

I'll merge this after #1955

@AriFordsham
Copy link

Is there any way I can turn this off? It keeps polluting my import list with things I didn't ask for, most of which are wrong.

@pepeiborra
Copy link
Collaborator Author

I don't think so. We ought to breakdown the completions plugin into multiple smaller plugins that can be turned on/off at will. PRs welcome!

@jneira
Copy link
Member

jneira commented Oct 26, 2021

@AriFordsham Not sure if it would do what you want but there is a config option haskell.plugin.ghcide-completions.config.autoExtendOn (Extends the import list automatically when completing a out-of-scope identifier) and haskell.plugin.ghcide-completions.config.snippetsOn (Inserts snippets when using code completions)

They are listed in the configuration section of the docs: https://haskell-language-server.readthedocs.io/en/latest/configuration.html#language-specific-server-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completions from non-imported modules

3 participants