-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
component: lsp-testSpecific issues of lsp-test packageSpecific issues of lsp-test packagehelp wantedtype: bug
Description
As reported in haskell/haskell-language-server#2479, this makes it very difficult to write tests that want to reason on a sequence of commands:
lsp/lsp-test/src/Language/LSP/Test/Session.hs
Lines 373 to 386 in 1b3c3c3
-- TODO: Don't do this when replaying a session | |
forM_ mergedParams (sendMessage . NotificationMessage "2.0" STextDocumentDidChange) | |
-- Update VFS to new document versions | |
let sortedVersions = map (sortBy (compare `on` (^. textDocument . version))) groupedParams | |
latestVersions = map ((^. textDocument) . last) sortedVersions | |
bumpedVersions = map (version . _Just +~ 1) latestVersions | |
forM_ bumpedVersions $ \(VersionedTextDocumentIdentifier uri v) -> | |
modify $ \s -> | |
let oldVFS = vfs s | |
update (VirtualFile oldV file_ver t) = VirtualFile (fromMaybe oldV v) (file_ver + 1) t | |
newVFS = updateVFS (Map.adjust update (toNormalizedUri uri)) oldVFS | |
in s { vfs = newVFS } |
Metadata
Metadata
Assignees
Labels
component: lsp-testSpecific issues of lsp-test packageSpecific issues of lsp-test packagehelp wantedtype: bug