Skip to content

Regularise the config for plugins #513

Closed
@alanz

Description

@alanz

This is a transfer of haskell/haskell-ide-engine#800 to haskell-language-server.

The essence of it is that we now have an expansion of plugins, and not all people want/like all the features.

Perhaps we should consider a regularisation of the Config structure to have slots per plugin.

At the moment it has an ad-hoc set of setting, intimately tied to the "current" set of plugins.

data Config =
  Config
    { hlintOn                     :: Bool
    , diagnosticsOnChange         :: Bool
    , maxNumberOfProblems         :: Int
    , diagnosticsDebounceDuration :: Int
    , liquidOn                    :: Bool
    , completionSnippetsOn        :: Bool
    , formatOnImportOn            :: Bool
    , formattingProvider          :: T.Text
    } deriving (Show,Eq)

The configuration is the interface to the actual IDEs, and is transferred in JSON format.

One way forward would be to have a slot for plugins in the JSON configuration, which can be indexed by the plugin id, as configured in Main.hs.

This could have a standard structure, to represent enabling/disabling code lenses, etc, as well as a per-plugin custom part, which becomes part of the PluginDescriptor. By doing it this way we get a certain core amount of configuration for free, and allow a composable per-plugin configuration.

This is purely conceptual at this point, I invite anyone to make a concrete PR, if we agree this is a good thing to do.

Metadata

Metadata

Assignees

Labels

old_type: metaPlaning and organizing other issuesstatus: in discussionNot actionable, because discussion is still ongoing or there's no decision yettype: enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions