File tree Expand file tree Collapse file tree
ghcide/src/Development/IDE
plugins/hls-hlint-plugin/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,16 +225,14 @@ activeDiagnosticsInRange :: MonadIO m => Shake.ShakeExtras -> NormalizedFilePath
225225activeDiagnosticsInRange ide nfp range = runMaybeT (activeDiagnosticsInRangeMT ide nfp range)
226226
227227-- Prefer server-side diagnostics if available; they are authoritative.
228- -- Fall back to client-supplied diagnostics when none are found.
229228injectServerDiagnostics :: IdeState -> CodeActionParams -> IO CodeActionParams
230- injectServerDiagnostics ide params@ LSP. CodeActionParams {_textDocument= LSP. TextDocumentIdentifier {_uri}, _range, _context= context} = do
231- let clientDiags = context ^. LSP. diagnostics
229+ injectServerDiagnostics ide params@ LSP. CodeActionParams {_textDocument= LSP. TextDocumentIdentifier {_uri}, _range} = do
232230 serverDiags <- case LSP. uriToNormalizedFilePath (LSP. toNormalizedUri _uri) of
233- Nothing -> pure clientDiags
231+ Nothing -> pure []
234232 Just nfp -> do
235233 mDiags <- activeDiagnosticsInRange (shakeExtras ide) nfp _range
236234 case mDiags of
237- Nothing -> pure clientDiags
235+ Nothing -> pure []
238236 Just diags -> pure $ diags ^.. traverse . fdLspDiagnosticL
239237 pure $ params & LSP. context . LSP. diagnostics .~ serverDiags
240238
Original file line number Diff line number Diff line change @@ -48,12 +48,12 @@ import Language.LSP.Protocol.Message
4848import Language.LSP.Protocol.Types
4949import qualified Language.LSP.Server as LSP
5050import Language.LSP.VFS
51- import Prettyprinter.Render.String (renderString )
52- import Text.Regex.TDFA.Text ()
53- import UnliftIO (MonadUnliftIO , liftIO ,
54- readTVarIO )
55- import UnliftIO.Async (forConcurrently )
56- import UnliftIO.Exception (catchAny )
51+ import Prettyprinter.Render.String (renderString )
52+ import Text.Regex.TDFA.Text ()
53+ import UnliftIO (MonadUnliftIO , liftIO ,
54+ readTVarIO )
55+ import UnliftIO.Async (forConcurrently )
56+ import UnliftIO.Exception (catchAny )
5757
5858-- ---------------------------------------------------------------------
5959--
Original file line number Diff line number Diff line change @@ -218,8 +218,8 @@ suggestionsTests =
218218 doc <- openDoc " TwoHints.hs" " haskell"
219219 _ <- hlintCaptureKick
220220
221- firstLine <- map fromAction <$> getCodeActions doc (mkRange 0 0 0 0 )
222- secondLine <- map fromAction <$> getCodeActions doc (mkRange 1 0 1 0 )
221+ firstLine <- map fromAction <$> getCodeActions doc (mkRange 0 0 1 0 )
222+ secondLine <- map fromAction <$> getCodeActions doc (mkRange 1 0 2 0 )
223223 thirdLine <- map fromAction <$> getCodeActions doc (mkRange 2 0 2 0 )
224224 multiLine <- map fromAction <$> getCodeActions doc (mkRange 0 0 2 0 )
225225
You can’t perform that action at this time.
0 commit comments