Skip to content

Commit b3ab549

Browse files
committed
Delete hlintOn
1 parent ca7499c commit b3ab549

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

docs/configuration.md

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ This option obviously would not make sense for language servers for other langua
4141
Here is a list of the additional settings currently supported by `haskell-language-server`, along with their setting key (you may not need to know this) and default:
4242

4343
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin).
44-
- Hlint (`haskell.hlintOn`, default true): whether to enable Hlint support. *Deprecated* as it is equivalent to `haskell.plugin.hlint.globalOn`
4544
- Max completions (`haskell.maxCompletions`, default 40): maximum number of completions sent to the LSP client.
4645
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on load. As it is activated by default could drive to bad perfomance in large projects.
4746
- Check parents (`haskell.checkParents`, default `CheckOnSaveAndClose`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnClose`, `CheckOnSaveAndClose`, or `AlwaysCheck`.

hls-plugin-api/src/Ide/Plugin/Config.hs

-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ data Config =
4949
Config
5050
{ checkParents :: CheckParents
5151
, checkProject :: !Bool
52-
, hlintOn :: !Bool
5352
, formattingProvider :: !T.Text
5453
, maxCompletions :: !Int
5554
, plugins :: !(Map.Map T.Text PluginConfig)
@@ -59,7 +58,6 @@ instance Default Config where
5958
def = Config
6059
{ checkParents = CheckOnSave
6160
, checkProject = True
62-
, hlintOn = True
6361
-- , formattingProvider = "brittany"
6462
, formattingProvider = "ormolu"
6563
-- , formattingProvider = "floskell"
@@ -79,7 +77,6 @@ parseConfig defValue = A.withObject "Config" $ \v -> do
7977
Just s -> flip (A.withObject "Config.settings") s $ \o -> Config
8078
<$> (o .:? "checkParents" <|> v .:? "checkParents") .!= checkParents defValue
8179
<*> (o .:? "checkProject" <|> v .:? "checkProject") .!= checkProject defValue
82-
<*> o .:? "hlintOn" .!= hlintOn defValue
8380
<*> o .:? "formattingProvider" .!= formattingProvider defValue
8481
<*> o .:? "maxCompletions" .!= maxCompletions defValue
8582
<*> o .:? "plugin" .!= plugins defValue
@@ -90,7 +87,6 @@ instance A.ToJSON Config where
9087
where
9188
r = object [ "checkParents" .= checkParents
9289
, "checkProject" .= checkProject
93-
, "hlintOn" .= hlintOn
9490
, "formattingProvider" .= formattingProvider
9591
, "maxCompletions" .= maxCompletions
9692
, "plugin" .= plugins

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ rules :: PluginId -> Rules ()
167167
rules plugin = do
168168
define $ \GetHlintDiagnostics file -> do
169169
config <- getClientConfigAction def
170-
let pluginConfig = configForPlugin config plugin
171-
let hlintOn' = hlintOn config && plcGlobalOn pluginConfig && plcDiagnosticsOn pluginConfig
172-
ideas <- if hlintOn' then getIdeas file else return (Right [])
170+
let hlintOn = pluginEnabledConfig plcDiagnosticsOn plugin config
171+
ideas <- if hlintOn then getIdeas file else return (Right [])
173172
return (diagnostics file ideas, Just ())
174173

175174
defineNoFile $ \GetHlintSettings -> do

0 commit comments

Comments
 (0)