Skip to content

Use custom config for completions plugin#1619

Merged
berberman merged 3 commits into
haskell:masterfrom
berberman:completions-config
Mar 27, 2021
Merged

Use custom config for completions plugin#1619
berberman merged 3 commits into
haskell:masterfrom
berberman:completions-config

Conversation

@berberman

Copy link
Copy Markdown
Collaborator

Clients now shoud provide JSON value like:

"ghcide-completions":{
      "globalOn":true,
      "config":{
         "autoExtendOn":true,
         "snippetsOn":true
      },
      "completionOn":true
}

in the section haskell.plugin to control completions plugin.

@michaelpj

Copy link
Copy Markdown
Collaborator

Do we want to call it "ghcide-completions"? ghcide is more-or-less not user-facing any more, perhaps we should try and avoid mentioning the name in user-visible config? Could we just call it "completions"?

@berberman

Copy link
Copy Markdown
Collaborator Author

The name "ghcide-completions" comes from its descriptor:

descriptors :: [PluginDescriptor IdeState]
descriptors =
[ descriptor "ghcide-hover-and-symbols",
CodeAction.descriptor "ghcide-code-actions",
Completions.descriptor "ghcide-completions",
TypeLenses.descriptor "ghcide-type-lenses",
Notifications.descriptor "ghcide-core"
]

In my opnion we'd better not introduce new names for the key, but use descriptors to keep things simple. Besides, I don't think it would be great to call the key "completions", because there might be other plugins are providing completion functionality as well.

@jneira jneira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@pepeiborra

pepeiborra commented Mar 25, 2021

Copy link
Copy Markdown
Collaborator

One option is to merge all the "ghcide-" descriptors into a single one and call it simply "HLS" or "haskell"

@berberman

Copy link
Copy Markdown
Collaborator Author

Currently CustomConfig blocks defining the merge operation of descriptors, which means we need define the custom config for type lenses plugin and completions plugin in one Properties if we merge ghcide descriptors together. This would bring unnecessary couplings, imho.

@berberman
berberman merged commit 75e365a into haskell:master Mar 27, 2021
@berberman
berberman deleted the completions-config branch March 27, 2021 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants