We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed96358 commit cb4c4afCopy full SHA for cb4c4af
plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Diagnostics.hs
@@ -63,8 +63,9 @@ positionFromCabalPosition :: Syntax.Position -> Position
63
positionFromCabalPosition (Syntax.Position line column) = Position (fromIntegral line') (fromIntegral col')
64
where
65
-- LSP is zero-based, Cabal is one-based
66
- line' = line-1
67
- col' = column-1
+ -- Cabal can return line 0 for errors in the first line
+ line' = if line <= 0 then 0 else line-1
68
+ col' = if column <= 0 then 0 else column-1
69
70
-- | Create a 'FileDiagnostic'
71
mkDiag
0 commit comments