File tree 1 file changed +11
-1
lines changed
plugins/hls-hlint-plugin/src/Ide/Plugin
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,22 @@ rules = do
122
122
-- we are encoding the fact that idea has refactorings in diagnostic code
123
123
, _code = Just (LSP. StringValue $ T. pack $ codePre ++ ideaHint idea)
124
124
, _source = Just " hlint"
125
- , _message = T. pack $ show idea
125
+ , _message = idea2Message idea
126
126
, _relatedInformation = Nothing
127
127
, _tags = Nothing
128
128
}
129
129
where codePre = if null $ ideaRefactoring idea then " " else " refact:"
130
130
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
+
131
141
parseErrorToDiagnostic :: ParseError -> Diagnostic
132
142
parseErrorToDiagnostic (Hlint. ParseError l msg contents) =
133
143
LSP. Diagnostic {
You can’t perform that action at this time.
0 commit comments