mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-11-10 06:46:24 +03:00
Fix bug in diffOperationToTextEdit
The original lineno extracted from the Addition DiffOperation needs to be increased by 1.
This commit is contained in:
parent
96d42f3723
commit
d4371fd443
@ -67,12 +67,12 @@ diffTextEdit fText f2Text withDeletions = J.List r
|
||||
(J.Position el 0)
|
||||
|
||||
diffOperationToTextEdit (Addition fm l) = J.TextEdit range nt
|
||||
-- fm has a range wrt to the changed file, which starts in the current file at l
|
||||
-- So the range has to be shifted to start at l
|
||||
-- fm has a range wrt to the changed file, which starts in the current file at l + 1
|
||||
-- So the range has to be shifted to start at l + 1
|
||||
where
|
||||
range = J.Range (J.Position (l' - 1) 0)
|
||||
(J.Position (l' - 1) 0)
|
||||
l' = max l sl -- Needed to add at the end of the file
|
||||
l' = max (l + 1) sl -- Needed to add at the end of the file
|
||||
sl = fst $ lrNumbers fm
|
||||
nt = T.pack $ unlines $ lrContents fm
|
||||
|
||||
@ -109,4 +109,4 @@ clientSupportsDocumentChanges caps =
|
||||
WorkspaceEditClientCapabilities mDc <- _workspaceEdit wCaps
|
||||
mDc
|
||||
in
|
||||
fromMaybe False supports
|
||||
fromMaybe False supports
|
||||
|
Loading…
Reference in New Issue
Block a user