@@ -148,7 +148,7 @@ parseErrorToDiagnostic (Hlint.ParseError l msg contents) =
148148 [Diagnostic
149149 { _range = srcLoc2Range l
150150 , _severity = Just DsInfo -- Not displayed
151- , _code = Just " parser"
151+ , _code = Just ( LSP. StringValue " parser" )
152152 , _source = Just " hlint"
153153 , _message = T. unlines [T. pack msg,T. pack contents]
154154 , _relatedInformation = Nothing
@@ -192,7 +192,7 @@ hintToDiagnostic idea
192192 = Diagnostic
193193 { _range = ss2Range (ideaSpan idea)
194194 , _severity = Just (hintSeverityMap $ ideaSeverity idea)
195- , _code = Just (T. pack $ ideaHint idea)
195+ , _code = Just (LSP. StringValue $ T. pack $ ideaHint idea)
196196 , _source = Just " hlint"
197197 , _message = idea2Message idea
198198 , _relatedInformation = Nothing
@@ -315,7 +315,7 @@ codeActionProvider plId docId _ context = IdeResultOk <$> hlintActions
315315 hlintActions = catMaybes <$> mapM mkHlintAction (filter validCommand diags)
316316
317317 -- | Some hints do not have an associated refactoring
318- validCommand (LSP. Diagnostic _ _ (Just code) (Just " hlint" ) _ _) =
318+ validCommand (LSP. Diagnostic _ _ (Just ( LSP. StringValue code) ) (Just " hlint" ) _ _) =
319319 case code of
320320 " Eta reduce" -> False
321321 _ -> True
@@ -324,7 +324,7 @@ codeActionProvider plId docId _ context = IdeResultOk <$> hlintActions
324324 LSP. List diags = context ^. LSP. diagnostics
325325
326326 mkHlintAction :: LSP. Diagnostic -> IdeM (Maybe LSP. CodeAction )
327- mkHlintAction diag@ (LSP. Diagnostic (LSP. Range start _) _s (Just code) (Just " hlint" ) m _) =
327+ mkHlintAction diag@ (LSP. Diagnostic (LSP. Range start _) _s (Just ( LSP. StringValue code) ) (Just " hlint" ) m _) =
328328 Just . codeAction <$> mkLspCommand plId " applyOne" title (Just args)
329329 where
330330 codeAction cmd = LSP. CodeAction title (Just LSP. CodeActionRefactor ) (Just (LSP. List [diag])) Nothing (Just cmd)
0 commit comments