Skip to content

Commit 477945e

Browse files
authored
Merge pull request #227 from bubba/fix-config-field-name
Rename the configuration section from languageServerHaskell => haskell
2 parents a1d8f9a + c19f4e7 commit 477945e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ Then issue `:CocConfig` and add the following to your Coc config file.
394394
"haskell"
395395
],
396396
"initializationOptions": {
397-
"languageServerHaskell": {
397+
"haskell": {
398398
}
399399
}
400400
}

src/Ide/Plugin/Config.hs

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ instance Default Config where
7070
-- TODO: Add API for plugins to expose their own LSP config options
7171
instance A.FromJSON Config where
7272
parseJSON = A.withObject "Config" $ \v -> do
73-
s <- v .: "languageServerHaskell"
73+
s <- v .: "haskell"
7474
flip (A.withObject "Config.settings") s $ \o -> Config
7575
<$> o .:? "hlintOn" .!= hlintOn def
7676
<*> o .:? "diagnosticsOnChange" .!= diagnosticsOnChange def
@@ -81,17 +81,17 @@ instance A.FromJSON Config where
8181
<*> o .:? "formatOnImportOn" .!= formatOnImportOn def
8282
<*> o .:? "formattingProvider" .!= formattingProvider def
8383

84-
-- 2017-10-09 23:22:00.710515298 [ThreadId 11] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"languageServerHaskell":{"maxNumberOfProblems":100,"hlintOn":true}}}}
84+
-- 2017-10-09 23:22:00.710515298 [ThreadId 11] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"haskell":{"maxNumberOfProblems":100,"hlintOn":true}}}}
8585
-- 2017-10-09 23:22:00.710667381 [ThreadId 15] - reactor:got didChangeConfiguration notification:
8686
-- NotificationMessage
8787
-- {_jsonrpc = "2.0"
8888
-- , _method = WorkspaceDidChangeConfiguration
8989
-- , _params = DidChangeConfigurationParams
90-
-- {_settings = Object (fromList [("languageServerHaskell",Object (fromList [("hlintOn",Bool True)
91-
-- ,("maxNumberOfProblems",Number 100.0)]))])}}
90+
-- {_settings = Object (fromList [("haskell",Object (fromList [("hlintOn",Bool True)
91+
-- ,("maxNumberOfProblems",Number 100.0)]))])}}
9292

9393
instance A.ToJSON Config where
94-
toJSON (Config h diag m d l c f fp) = object [ "languageServerHaskell" .= r ]
94+
toJSON (Config h diag m d l c f fp) = object [ "haskell" .= r ]
9595
where
9696
r = object [ "hlintOn" .= h
9797
, "diagnosticsOnChange" .= diag

test/functional/Completion.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ tests = testGroup "completions" [
311311
-- doc <- openDoc "Completion.hs" "haskell"
312312
-- _ <- count 2 $ skipManyTill loggingNotification noDiagnostics
313313

314-
-- let config = object [ "languageServerHaskell" .= (object ["completionSnippetsOn" .= False])]
314+
-- let config = object [ "haskell" .= (object ["completionSnippetsOn" .= False])]
315315

316316
-- sendNotification WorkspaceDidChangeConfiguration
317317
-- (DidChangeConfigurationParams config)
@@ -393,4 +393,4 @@ contextTests = testGroup "contexts" [
393393
compls `shouldContainCompl` x =
394394
filter ((== x) . (^. label)) compls `shouldNotSatisfy` null
395395
compls `shouldNotContainCompl` x =
396-
filter ((== x) . (^. label)) compls `shouldSatisfy` null
396+
filter ((== x) . (^. label)) compls `shouldSatisfy` null

test/functional/Format.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ ormoluTests :: TestTree
115115
ormoluTests = testGroup "ormolu" [
116116
goldenVsStringDiff "formats correctly" goldenGitDiff ("test/testdata/Format.ormolu." ++ ormoluGoldenSuffix ++ ".hs") $ runSession hieCommand fullCaps "test/testdata" $ do
117117
let formatLspConfig provider =
118-
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
118+
object [ "haskell" .= object ["formattingProvider" .= (provider :: Value)] ]
119119
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
120120
doc <- openDoc "Format.hs" "haskell"
121121
formatDoc doc (FormattingOptions 2 True)
@@ -129,7 +129,7 @@ ormoluTests = testGroup "ormolu" [
129129

130130

131131
formatLspConfig :: Value -> Value
132-
formatLspConfig provider = object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
132+
formatLspConfig provider = object [ "haskell" .= object ["formattingProvider" .= (provider :: Value)] ]
133133

134134
formatConfig :: Value -> SessionConfig
135135
formatConfig provider = defaultConfig { lspConfig = Just (formatLspConfig provider) }

0 commit comments

Comments
 (0)