Skip to content

Commit 8586abb

Browse files
authored
Merge branch 'master' into ApplicativeDo
2 parents f9a7a99 + c2c02fb commit 8586abb

File tree

5 files changed

+57
-48
lines changed

5 files changed

+57
-48
lines changed

ghcide/ghcide.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ library
8484
utf8-string,
8585
vector,
8686
hslogger,
87-
Diff,
87+
Diff ^>=0.4.0,
8888
vector,
8989
bytestring-encoding,
9090
opentelemetry >=0.6.1,

ghcide/src/Development/IDE/LSP/LanguageServer.hs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ module Development.IDE.LSP.LanguageServer
1212
( runLanguageServer
1313
) where
1414

15-
import Control.Concurrent.Extra (newBarrier,
16-
signalBarrier,
17-
waitBarrier)
1815
import Control.Concurrent.STM
1916
import Control.Monad.Extra
2017
import Control.Monad.IO.Class
@@ -56,12 +53,11 @@ runLanguageServer
5653
-> IO ()
5754
runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChange userHandlers getIdeState = do
5855

59-
-- These barriers are signaled when the threads reading from these chans exit.
60-
-- This should not happen but if it does, we will make sure that the whole server
61-
-- dies and can be restarted instead of losing threads silently.
62-
clientMsgBarrier <- newBarrier
56+
-- This MVar becomes full when the server thread exits or we receive exit message from client.
57+
-- LSP loop will be canceled when it's full.
58+
clientMsgVar <- newEmptyMVar
6359
-- Forcefully exit
64-
let exit = signalBarrier clientMsgBarrier ()
60+
let exit = void $ tryPutMVar clientMsgVar ()
6561

6662
-- The set of requests ids that we have received but not finished processing
6763
pendingRequests <- newTVarIO Set.empty
@@ -116,7 +112,7 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
116112
inH
117113
outH
118114
serverDefinition
119-
, void $ waitBarrier clientMsgBarrier
115+
, void $ readMVar clientMsgVar
120116
]
121117

122118
where
@@ -192,6 +188,7 @@ cancelHandler cancelRequest = LSP.notificationHandler SCancelRequest $ \Notifica
192188
exitHandler :: IO () -> LSP.Handlers (ServerM c)
193189
exitHandler exit = LSP.notificationHandler SExit $ const $ do
194190
(_, ide) <- ask
191+
liftIO $ logDebug (ideLogger ide) "Received exit message"
195192
-- flush out the Shake session to record a Shake profile if applicable
196193
liftIO $ shakeShut ide
197194
liftIO exit

hls-plugin-api/hls-plugin-api.cabal

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ version: 1.1.0.0
44
synopsis: Haskell Language Server API for plugin communication
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
7-
homepage: https://github.com/haskell/haskell-language-server/hls-plugin-api
7+
8+
homepage:
9+
https://github.com/haskell/haskell-language-server/hls-plugin-api
10+
811
bug-reports: https://github.com/haskell/haskell-language-server/issues
912
license: Apache-2.0
1013
license-file: LICENSE
@@ -32,38 +35,42 @@ library
3235
Ide.PluginUtils
3336
Ide.Types
3437

35-
hs-source-dirs: src
38+
hs-source-dirs: src
3639
build-depends:
3740
, aeson
3841
, base >=4.12 && <5
3942
, containers
4043
, data-default
41-
, Diff
42-
, lsp ^>=1.2.0
44+
, dependent-map
45+
, dependent-sum
46+
, Diff ^>=0.4.0
47+
, dlist
4348
, hashable
4449
, hslogger
4550
, lens
51+
, lsp ^>=1.2.0
52+
, opentelemetry
4653
, process
4754
, regex-tdfa >=1.3.1.0
4855
, shake >=0.17.5
4956
, text
5057
, unordered-containers
51-
, dependent-map
52-
, dependent-sum
53-
, dlist
54-
, opentelemetry
5558

5659
if os(windows)
57-
build-depends:
58-
Win32
60+
build-depends: Win32
61+
5962
else
60-
build-depends:
61-
unix
63+
build-depends: unix
6264

63-
ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors
65+
ghc-options:
66+
-Wall -Wredundant-constraints -Wno-name-shadowing
67+
-Wno-unticked-promoted-constructors
6468

6569
if flag(pedantic)
6670
ghc-options: -Werror
6771

68-
default-language: Haskell2010
69-
default-extensions: DataKinds, KindSignatures, TypeOperators
72+
default-language: Haskell2010
73+
default-extensions:
74+
DataKinds
75+
KindSignatures
76+
TypeOperators

plugins/hls-eval-plugin/hls-eval-plugin.cabal

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ build-type: Simple
1919
extra-source-files:
2020
LICENSE
2121
README.md
22-
test/testdata/*.yaml
23-
test/testdata/*.hs
22+
test/testdata/*.cabal
2423
test/testdata/*.expected
24+
test/testdata/*.hs
2525
test/testdata/*.lhs
26-
test/testdata/*.cabal
26+
test/testdata/*.yaml
2727

2828
flag pedantic
2929
description: Enable -Werror
@@ -53,7 +53,7 @@ library
5353
, base >=4.12 && <5
5454
, containers
5555
, deepseq
56-
, Diff
56+
, Diff ^>=0.4.0
5757
, directory
5858
, dlist
5959
, extra
@@ -111,7 +111,6 @@ test-suite tests
111111
build-tool-depends: hls-eval-plugin:test-server -any
112112
hs-source-dirs: test
113113
main-is: Main.hs
114-
115114
build-depends:
116115
, aeson
117116
, base

plugins/hls-hlint-plugin/hls-hlint-plugin.cabal

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ cabal-version: 2.2
22
name: hls-hlint-plugin
33
version: 1.0.0.1
44
synopsis: Hlint integration plugin with Haskell Language Server
5-
description: Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme)
5+
description:
6+
Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme)
7+
68
license: Apache-2.0
79
license-file: LICENSE
810
author: The Haskell IDE Team
@@ -23,51 +25,55 @@ flag ghc-lib
2325
Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported
2426

2527
library
26-
exposed-modules: Ide.Plugin.Hlint
27-
hs-source-dirs: src
28+
exposed-modules: Ide.Plugin.Hlint
29+
hs-source-dirs: src
2830
build-depends:
2931
, aeson
30-
, apply-refact >=0.9
31-
, base >=4.12 && <5
32+
, apply-refact >=0.9
33+
, base >=4.12 && <5
3234
, binary
3335
, bytestring
3436
, containers
3537
, data-default
3638
, deepseq
37-
, Diff
39+
, Diff ^>=0.4.0
3840
, directory
3941
, extra
4042
, filepath
41-
, ghc-exactprint >=0.6.3.4
42-
, ghcide ^>= 1.1.0.0
43+
, ghc-exactprint >=0.6.3.4
44+
, ghcide ^>=1.1.0.0
4345
, hashable
44-
, lsp
45-
, hlint >=3.2
46-
, hls-plugin-api >= 1.0 && < 1.2
46+
, hlint >=3.2
47+
, hls-plugin-api >=1.0 && <1.2
4748
, hslogger
4849
, lens
50+
, lsp
4951
, regex-tdfa
5052
, shake
5153
, temporary
5254
, text
5355
, transformers
5456
, unordered-containers
5557

56-
if (!flag(ghc-lib) && impl(ghc >=8.10.1) && impl(ghc <9.0.0))
57-
build-depends: ghc ^>= 8.10
58+
if ((!flag(ghc-lib) && impl(ghc >=8.10.1)) && impl(ghc <9.0.0))
59+
build-depends: ghc ^>=8.10
5860

5961
else
6062
build-depends:
6163
, ghc
62-
, ghc-lib ^>= 8.10.4.20210206
63-
, ghc-lib-parser-ex ^>= 8.10
64+
, ghc-lib ^>=8.10.4.20210206
65+
, ghc-lib-parser-ex ^>=8.10
6466

6567
cpp-options: -DHLINT_ON_GHC_LIB
6668

67-
ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors
69+
ghc-options:
70+
-Wall -Wredundant-constraints -Wno-name-shadowing
71+
-Wno-unticked-promoted-constructors
6872

6973
if flag(pedantic)
7074
ghc-options: -Werror
7175

72-
default-language: Haskell2010
73-
default-extensions: DataKinds, TypeOperators
76+
default-language: Haskell2010
77+
default-extensions:
78+
DataKinds
79+
TypeOperators

0 commit comments

Comments
 (0)