File tree Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,7 @@ executable haskell-language-server
368
368
, safe-exceptions
369
369
, hls-graph
370
370
, sqlite-simple
371
+ , stm
371
372
, temporary
372
373
, transformers
373
374
, unordered-containers
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Ide.Plugin.Example
14
14
descriptor
15
15
) where
16
16
17
+ import Control.Concurrent.STM
17
18
import Control.DeepSeq (NFData )
18
19
import Control.Monad.IO.Class
19
20
import Control.Monad.Trans.Maybe
@@ -126,8 +127,8 @@ codeLens ideState plId CodeLensParams{_textDocument=TextDocumentIdentifier uri}
126
127
case uriToFilePath' uri of
127
128
Just (toNormalizedFilePath -> filePath) -> do
128
129
_ <- runIdeAction " Example.codeLens" (shakeExtras ideState) $ runMaybeT $ useE TypeCheck filePath
129
- _diag <- getDiagnostics ideState
130
- _hDiag <- getHiddenDiagnostics ideState
130
+ _diag <- atomically $ getDiagnostics ideState
131
+ _hDiag <- atomically $ getHiddenDiagnostics ideState
131
132
let
132
133
title = " Add TODO Item via Code Lens"
133
134
-- tedit = [TextEdit (Range (Position 3 0) (Position 3 0))
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Ide.Plugin.Example2
14
14
descriptor
15
15
) where
16
16
17
+ import Control.Concurrent.STM
17
18
import Control.DeepSeq (NFData )
18
19
import Control.Monad.IO.Class
19
20
import Control.Monad.Trans.Maybe
@@ -116,8 +117,8 @@ codeLens ideState plId CodeLensParams{_textDocument=TextDocumentIdentifier uri}
116
117
case uriToFilePath' uri of
117
118
Just (toNormalizedFilePath -> filePath) -> do
118
119
_ <- runIdeAction (fromNormalizedFilePath filePath) (shakeExtras ideState) $ runMaybeT $ useE TypeCheck filePath
119
- _diag <- getDiagnostics ideState
120
- _hDiag <- getHiddenDiagnostics ideState
120
+ _diag <- atomically $ getDiagnostics ideState
121
+ _hDiag <- atomically $ getHiddenDiagnostics ideState
121
122
let
122
123
title = " Add TODO2 Item via Code Lens"
123
124
range = Range (Position 3 0 ) (Position 4 0 )
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ library
63
63
, lens
64
64
, lsp
65
65
, regex-tdfa
66
+ , stm
66
67
, temporary
67
68
, text
68
69
, transformers
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ module Ide.Plugin.Hlint
26
26
-- , provider
27
27
) where
28
28
import Control.Arrow ((&&&) )
29
+ import Control.Concurrent.STM
29
30
import Control.DeepSeq
30
31
import Control.Exception
31
32
import Control.Lens ((^.) )
@@ -308,7 +309,7 @@ codeActionProvider ideState plId (CodeActionParams _ _ docId _ context) = Right
308
309
where
309
310
310
311
getCodeActions = do
311
- allDiags <- getDiagnostics ideState
312
+ allDiags <- atomically $ getDiagnostics ideState
312
313
let docNfp = toNormalizedFilePath' <$> uriToFilePath' (docId ^. LSP. uri)
313
314
numHintsInDoc = length
314
315
[d | (nfp, _, d) <- allDiags
You can’t perform that action at this time.
0 commit comments