Closed
Description
- We should add in https://github.com/haskell/haskell-language-server#configuring-haskell-language-server how to use the new generic configuration that you can use to disable features (code action, code lensaes, etc) per plugin, added with Introduce generic config for plugins #691 (which closed Regularise the config for plugins #513)
- Even if it is not fully integrated with vscode (see Support new hls generic plugin configuration vscode-haskell#336) you can use it writing a
.vscode/settings.json
with the desired configuration (and other editors lets you do it too) - We suggested use it in several issues: HLS crashes with "The Haskell (<proj>) server crashed 5 times in the last 3 minutes. The server will not be restarted." #1342, How to disable fold/unfold suggestions? #510, Option to disable import lens plugin #426...
- It can be used to diagnose bugs and crashes with no or little info in the log, as you can disable all plugins and features to check what is causing the bug: HLS crashes with "The Haskell (<proj>) server crashed 5 times in the last 3 minutes. The server will not be restarted." #1342 (and workaround them disabling the offending feature)
- the full configuration would be:
{
"haskell": {
"plugin" : {
"importLens" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"hlint" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"eval" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"moduleName" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"splice" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"haddockComments" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"class" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"retrie" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"tactic" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {
"features": "not exposed?",
"max_use_ctor_actions": "Int"
}
},
"pragmas" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"ghcide-hover-and-symbols" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"ghcide-code-actions" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"ghcide-completions" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {}
},
"ghcide-type-lenses" : {
"globalOn" : false,
"codeActionsOn" : false,
"codeLensOn" : false,
"diagnosticsOn" :false,
"hoverOn" :false,
"symbolsOn" :false,
"formattingOn" :false,
"completionOn" :false,
"renameOn" :false,
"config": {
"mode": "Always | Exported | Diagnostics"
}
}
}
}
}
- Not all plugins provide all features so we should cut down them
- We should mention that existing configuration is deprecated cause is already covered by the generic one (
hlintOn
) - I think tactic plugin already have a dedicated configuration under
config
(@isovector)