@@ -64,7 +64,7 @@ import Control.Concurrent.Strict
64
64
import Control.DeepSeq
65
65
import Control.Exception (evaluate )
66
66
import Control.Exception.Safe
67
- import Control.Lens ((%~) , (&) )
67
+ import Control.Lens ((%~) , (&) , (.~) )
68
68
import Control.Monad.Extra
69
69
import Control.Monad.IO.Unlift
70
70
import Control.Monad.Reader
@@ -162,6 +162,7 @@ import Ide.Types (DynFlagsModificat
162
162
import Language.LSP.Protocol.Message (SMethod (SMethod_CustomMethod , SMethod_WindowShowMessage ))
163
163
import Language.LSP.Protocol.Types (MessageType (MessageType_Info ),
164
164
ShowMessageParams (ShowMessageParams ))
165
+ import qualified Language.LSP.Protocol.Lens as JL
165
166
import Language.LSP.Server (LspT )
166
167
import qualified Language.LSP.Server as LSP
167
168
import Language.LSP.VFS
@@ -489,7 +490,7 @@ reportImportCyclesRule recorder =
489
490
cycleErrorInFile _ _ = Nothing
490
491
toDiag imp mods =
491
492
ideErrorWithSource (Just " Import cycle detection" ) (Just DiagnosticSeverity_Error ) fp (" Cyclic module dependency between " <> showCycle mods) Nothing
492
- & fdLspDiagnosticL %~ \ lspDiag -> (lspDiag { _range = rng } :: Diagnostic )
493
+ & fdLspDiagnosticL %~ JL. range .~ rng
493
494
where rng = fromMaybe noRange $ srcSpanToRange (getLoc imp)
494
495
fp = toNormalizedFilePath' $ fromMaybe noFilePath $ srcSpanToFilename (getLoc imp)
495
496
getModuleName file = do
0 commit comments