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

Commit e4972ff

Browse files
authored
Merge pull request #1794 from bubba/fix-configuration-section-name
Rename configuration section languageServerHaskell => haskell
2 parents a9005b2 + be5b41c commit e4972ff

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://github.com/haskell/haskell-language-server
66

77
Until the new `haskell-language-server` reaches the feature level and stability of `haskell-ide-engine`, we aim to continue doing monthly releases. However, in general, bug fixes will be favored over new features and refactorings. They could be redirected to the new repo to avoid duplicated efforts.
88

9-
You still can contribute to improve the haskell ide experience! If you are not sure if you contribution should belong to this repo or the new one, feel free to ask in [any of the communication channels](#its-time-to-join-the-project).
9+
You still can contribute to improve the haskell ide experience! If you are not sure if you contribution should belong to this repo or the new one, feel free to ask in [any of the communication channels](#its-time-to-join-the-project).
1010

1111
# Haskell IDE Engine (HIE)
1212
<img src="https://github.com/haskell/haskell-ide-engine/raw/master/logos/HIE_logo_512.png" width="256" style="margin:25px;" align="right"/>
@@ -314,16 +314,16 @@ Wrapper script will analyze your project, find suitable version of HIE and launc
314314
Enable it by editing VS Code settings like this:
315315

316316
```json
317-
"languageServerHaskell.useCustomHieWrapper": true,
318-
"languageServerHaskell.useCustomHieWrapperPath": "hie-wrapper",
317+
"haskell.useCustomHieWrapper": true,
318+
"haskell.useCustomHieWrapperPath": "hie-wrapper",
319319
```
320320

321321
## Configuration
322322
There are some settings that can be configured via a `settings.json` file:
323323

324324
```
325325
{
326-
"languageServerHaskell": {
326+
"haskell": {
327327
"hlintOn": Boolean,
328328
"maxNumberOfProblems": Number
329329
"diagnosticsDebounceDuration" : Number
@@ -344,7 +344,7 @@ There are some settings that can be configured via a `settings.json` file:
344344
**For a full explanation of possible configurations, refer to [hie-bios/README](https://github.com/mpickering/hie-bios/blob/master/README.md).**
345345

346346
HIE will attempt to automatically detect your project configuration and set up
347-
the environment for GHC.
347+
the environment for GHC.
348348

349349
| `cabal.project` | `stack.yaml` | `*.cabal` | Project selected |
350350
|-----------------|--------------|-----------|------------------|
@@ -582,7 +582,7 @@ Then issue `:CocConfig` and add the following to your Coc config file.
582582
"haskell"
583583
],
584584
"initializationOptions": {
585-
"languageServerHaskell": {
585+
"haskell": {
586586
}
587587
}
588588
}

hie-plugin-api/Haskell/Ide/Engine/Config.hs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE OverloadedStrings #-}
22
module Haskell.Ide.Engine.Config where
33

4+
import Control.Applicative
45
import Data.Aeson
56
import Data.Default
67
import qualified Data.Text as T
@@ -54,7 +55,7 @@ instance Default Config where
5455
-- TODO: Add API for plugins to expose their own LSP config options
5556
instance FromJSON Config where
5657
parseJSON = withObject "Config" $ \v -> do
57-
s <- v .: "languageServerHaskell"
58+
s <- v .: "haskell" <|> v.: "languageServerHaskell"
5859
flip (withObject "Config.settings") s $ \o -> Config
5960
<$> o .:? "hlintOn" .!= hlintOn def
6061
<*> o .:? "diagnosticsOnChange" .!= diagnosticsOnChange def
@@ -65,17 +66,17 @@ instance FromJSON Config where
6566
<*> o .:? "formatOnImportOn" .!= formatOnImportOn def
6667
<*> o .:? "formattingProvider" .!= formattingProvider def
6768

68-
-- 2017-10-09 23:22:00.710515298 [ThreadId 11] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"languageServerHaskell":{"maxNumberOfProblems":100,"hlintOn":true}}}}
69+
-- 2017-10-09 23:22:00.710515298 [ThreadId 11] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"haskell":{"maxNumberOfProblems":100,"hlintOn":true}}}}
6970
-- 2017-10-09 23:22:00.710667381 [ThreadId 15] - reactor:got didChangeConfiguration notification:
7071
-- NotificationMessage
7172
-- {_jsonrpc = "2.0"
7273
-- , _method = WorkspaceDidChangeConfiguration
7374
-- , _params = DidChangeConfigurationParams
74-
-- {_settings = Object (fromList [("languageServerHaskell",Object (fromList [("hlintOn",Bool True)
75+
-- {_settings = Object (fromList [("haskell",Object (fromList [("hlintOn",Bool True)
7576
-- ,("maxNumberOfProblems",Number 100.0)]))])}}
7677

7778
instance ToJSON Config where
78-
toJSON (Config h diag m d l c f fp) = object [ "languageServerHaskell" .= r ]
79+
toJSON (Config h diag m d l c f fp) = object [ "haskell" .= r ]
7980
where
8081
r = object [ "hlintOn" .= h
8182
, "diagnosticsOnChange" .= diag

test/functional/CompletionSpec.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ spec = describe "completions" $ do
330330
doc <- openDoc "Completion.hs" "haskell"
331331
_ <- count 2 $ skipManyTill loggingNotification noDiagnostics
332332

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

335335
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams config)
336336

test/functional/FormatSpec.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec = do
3333

3434
describe "formatting provider" $ do
3535
let formatLspConfig provider =
36-
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
36+
object [ "haskell" .= object ["formattingProvider" .= (provider :: Value)] ]
3737
formatConfig provider = defaultConfig { lspConfig = Just (formatLspConfig provider) }
3838

3939
it "respects none" $ runSessionWithConfig (formatConfig "none") hieCommand fullCaps "test/testdata" $ do
@@ -94,7 +94,7 @@ spec = do
9494

9595
describe "ormolu" $ do
9696
let formatLspConfig provider =
97-
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
97+
object [ "haskell" .= object ["formattingProvider" .= (provider :: Value)] ]
9898

9999
it "formats correctly" $ runSession hieCommand fullCaps "test/testdata" $ do
100100
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "ormolu"))
@@ -199,7 +199,7 @@ formattedOrmolu =
199199
\ x <- return \"hello\"\n\
200200
\ return \"asdf\"\n\n\
201201
\data Baz = Baz {a :: Int, b :: String}\n"
202-
202+
203203
unchangedOrmolu :: T.Text
204204
unchangedOrmolu =
205205
"module Format where\n\

0 commit comments

Comments
 (0)