Skip to content

Config available to ghcide Main is always default #1980

Closed
@isovector

Description

@isovector

While working on a fix for #1873, I noticed that my plugin's configuration wasn't available when building the IdeOptions. But that's odd, because it's obviously getting pulled:

config <- LSP.runLspT env LSP.getConfig

Tracing this, however, gives the following object:

Config {checkParents = CheckOnSaveAndClose, checkProject = True, hlintOn = True, diagnosticsOnChange = True, diagnosticsDebounceDuration = 350000, liquidOn = False, formatOnImportOn = True, formattingProvider = "ormolu", maxCompletions = 40, plugins = fromList []}

which correspond exactly with the Default instance:

instance Default Config where
def = Config
{ checkParents = CheckOnSaveAndClose
, checkProject = True
, hlintOn = True
, diagnosticsOnChange = True
, diagnosticsDebounceDuration = 350000
, liquidOn = False
, formatOnImportOn = True
-- , formattingProvider = "brittany"
, formattingProvider = "ormolu"
-- , formattingProvider = "floskell"
-- , formattingProvider = "stylish-haskell"
, maxCompletions = 40
, plugins = Map.empty
}

What's going on here? Do we expect the config to be initialized by this point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions