on master help sign in
Fix prettyRange so it prints ranges like it used to (#882)
b7e7ae5Neil Mitchell
src/Development/IDE/Types/Diagnostics.hs+2−11
@@ -161,17 +161,8 @@ ideTryIOException fp act =
161type FileDiagnostics = (Uri, [Diagnostic])
161type FileDiagnostics = (Uri, [Diagnostic])
162
162
163prettyRange :: Range -> Doc SyntaxClass
163prettyRange :: Range -> Doc SyntaxClass
164−prettyRange Range{..} =
164+prettyRange Range{..} = f _start <> "-" <> f _end
165− slabel_ "Range" $ vcat
166− [ slabel_ "Start:" $ prettyPosition _start
167− , slabel_ "End: " $ prettyPosition _end
168− ]
169−
170−prettyPosition :: Position -> Doc SyntaxClass
171−prettyPosition Position{..} = slabel_ "Position" $ vcat
172− [ slabel_ "Line:" $ pretty _line
173− , slabel_ "Character:" $ pretty _character
165+ where f Position{..} = pretty (_line+1) <> colon <> pretty _character
174− ]
175
166
176stringParagraphs :: T.Text -> Doc a
167stringParagraphs :: T.Text -> Doc a
177stringParagraphs = vcat . map (fillSep . map pretty . T.words) . T.lines
168stringParagraphs = vcat . map (fillSep . map pretty . T.words) . T.lines