Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp-test should update document version after every editing #474

Open
July541 opened this issue Apr 19, 2023 · 2 comments
Open

lsp-test should update document version after every editing #474

July541 opened this issue Apr 19, 2023 · 2 comments

Comments

@July541
Copy link
Contributor

July541 commented Apr 19, 2023

Like changeDoc

-- | Changes a text document and sends a textDocument/didOpen notification to the server.
changeDoc :: TextDocumentIdentifier -> [TextDocumentContentChangeEvent] -> Session ()
changeDoc docId changes = do
verDoc <- getVersionedDoc docId
let params = DidChangeTextDocumentParams (verDoc & version . non 0 +~ 1) (List changes)
sendNotification STextDocumentDidChange params

The following function should also update the version.

  • executeCommand
  • executeCodeAction
  • rename
  • formatDoc
  • formatRange
  • applyEdit
@July541
Copy link
Contributor Author

July541 commented May 17, 2023

After reading the source code, I found every function above has updated the doc version, except executeCommand.

@michaelpj
Copy link
Collaborator

Hmm, looking at it it looks fine to me? even executeCommand goes via calling the appropriate server method, which should then result in an applyEdit coming back, which should be handled properly. So I'm not sure what's going on here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants