@@ -148,7 +148,7 @@ parseErrorToDiagnostic (Hlint.ParseError l msg contents) =
148
148
[Diagnostic
149
149
{ _range = srcLoc2Range l
150
150
, _severity = Just DsInfo -- Not displayed
151
- , _code = Just " parser"
151
+ , _code = Just ( LSP. StringValue " parser" )
152
152
, _source = Just " hlint"
153
153
, _message = T. unlines [T. pack msg,T. pack contents]
154
154
, _relatedInformation = Nothing
@@ -192,7 +192,7 @@ hintToDiagnostic idea
192
192
= Diagnostic
193
193
{ _range = ss2Range (ideaSpan idea)
194
194
, _severity = Just (hintSeverityMap $ ideaSeverity idea)
195
- , _code = Just (T. pack $ ideaHint idea)
195
+ , _code = Just (LSP. StringValue $ T. pack $ ideaHint idea)
196
196
, _source = Just " hlint"
197
197
, _message = idea2Message idea
198
198
, _relatedInformation = Nothing
@@ -315,7 +315,7 @@ codeActionProvider plId docId _ context = IdeResultOk <$> hlintActions
315
315
hlintActions = catMaybes <$> mapM mkHlintAction (filter validCommand diags)
316
316
317
317
-- | 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" ) _ _) =
319
319
case code of
320
320
" Eta reduce" -> False
321
321
_ -> True
@@ -324,7 +324,7 @@ codeActionProvider plId docId _ context = IdeResultOk <$> hlintActions
324
324
LSP. List diags = context ^. LSP. diagnostics
325
325
326
326
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 _) =
328
328
Just . codeAction <$> mkLspCommand plId " applyOne" title (Just args)
329
329
where
330
330
codeAction cmd = LSP. CodeAction title (Just LSP. CodeActionRefactor ) (Just (LSP. List [diag])) Nothing (Just cmd)
0 commit comments