Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Regularise the config for plugins #800

Open
alanz opened this issue Sep 2, 2018 · 1 comment
Open

Regularise the config for plugins #800

alanz opened this issue Sep 2, 2018 · 1 comment

Comments

@alanz
Copy link
Collaborator

alanz commented Sep 2, 2018

At the moment the Config type is

data Config =
  Config
    { hlintOn             :: Bool
    , maxNumberOfProblems :: Int
    } deriving (Show)

As we add more diagnostic providers, we can add a specific config for each.

Or, we can make the config something like

data Config =
  Config
    { diagnostics :: Map PluginId  Bool
    , maxNumberOfProblems :: Int
    } deriving (Show)

This means that nothing has to change when we add a new plugin that does diagnostics, and we can filter out the disabled ones in requestDiagnostics already.

This can potentially apply for code actions, hover, and symbols. And be extended as new items arise.

@lukel97
Copy link
Collaborator

lukel97 commented Sep 5, 2018

I would like to also see an extensible point for custom plugin configs, so we can specify

"hlint": {
  "diagnostics": true,
  "maxNumber": 10
}

as a data type in Hlint.hs

data HlintConfig =
  HlintConfig
  { diagnostics :: Bool
  , maxNumber   :: Int
  }

This would help complete #772

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants