File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
plugins/hls-hlint-plugin/src/Ide/Plugin Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,22 @@ rules = do
122122 -- we are encoding the fact that idea has refactorings in diagnostic code
123123 , _code = Just (LSP. StringValue $ T. pack $ codePre ++ ideaHint idea)
124124 , _source = Just " hlint"
125- , _message = T. pack $ show idea
125+ , _message = idea2Message idea
126126 , _relatedInformation = Nothing
127127 , _tags = Nothing
128128 }
129129 where codePre = if null $ ideaRefactoring idea then " " else " refact:"
130130
131+ idea2Message :: Idea -> T. Text
132+ idea2Message idea = T. unlines $ [T. pack $ ideaHint idea, " Found:" , " " <> T. pack (ideaFrom idea)]
133+ <> toIdea <> map (T. pack . show ) (ideaNote idea)
134+ where
135+ toIdea :: [T. Text ]
136+ toIdea = case ideaTo idea of
137+ Nothing -> []
138+ Just i -> [T. pack " Why not:" , T. pack $ " " ++ i]
139+
140+
131141 parseErrorToDiagnostic :: ParseError -> Diagnostic
132142 parseErrorToDiagnostic (Hlint. ParseError l msg contents) =
133143 LSP. Diagnostic {
You can’t perform that action at this time.
0 commit comments