mirror of
https://github.com/haskell/ghcide.git
synced 2024-09-20 01:57:38 +03:00
Fix prettyRange so it prints ranges like it used to (#882)
Before it was garbled and wrong: Range: Range Start: Position Line: 2Character: 15End: Position Line: 2Character: 15 After it's correct and like it was before: Range: 3:15-3:17
This commit is contained in:
parent
a410abc82c
commit
b7e7ae5692
@ -161,17 +161,8 @@ ideTryIOException fp act =
|
||||
type FileDiagnostics = (Uri, [Diagnostic])
|
||||
|
||||
prettyRange :: Range -> Doc SyntaxClass
|
||||
prettyRange Range{..} =
|
||||
slabel_ "Range" $ vcat
|
||||
[ slabel_ "Start:" $ prettyPosition _start
|
||||
, slabel_ "End: " $ prettyPosition _end
|
||||
]
|
||||
|
||||
prettyPosition :: Position -> Doc SyntaxClass
|
||||
prettyPosition Position{..} = slabel_ "Position" $ vcat
|
||||
[ slabel_ "Line:" $ pretty _line
|
||||
, slabel_ "Character:" $ pretty _character
|
||||
]
|
||||
prettyRange Range{..} = f _start <> "-" <> f _end
|
||||
where f Position{..} = pretty (_line+1) <> colon <> pretty _character
|
||||
|
||||
stringParagraphs :: T.Text -> Doc a
|
||||
stringParagraphs = vcat . map (fillSep . map pretty . T.words) . T.lines
|
||||
|
Loading…
Reference in New Issue
Block a user