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

fix(lsp): Request document sync on open/close #533

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

merrilymeredith
Copy link
Contributor

Without sending open_close: true to the client, it may not issue an textDocument/didOpen event with document text to allow the diagnostics and text cache to be initialized after opening, but prior to editing, the document. Format requests also emit "Format request arrived before text synchronized" in this state. The didClose event probably also doesn't arrive to see cache entries removed.

Observed in neovim 0.8.3 using internal client, while vim with prabirshrestha/vim-lsp sends the event regardless (but does not currently issue didClose).

Without sending `open_close: true` to the client, it may not issue an `textDocument/didOpen` event with document text to allow the diagnostics and text cache to be initialized after opening, but prior to editing, the document.  Format requests also emit "Format request arrived before text synchronized" in this state.  The didClose event probably also doesn't arrive to see cache entries removed.

Observed in neovim 0.8.3 using internal client, while vim with prabirshrestha/vim-lsp sends the event regardless (but does not currently issue didClose).
@searls
Copy link
Contributor

searls commented Mar 6, 2023

Hard for me to validate this is correct, but I definitely believe it based on my own frustrations observing this behavior with the VS Code extension. Thanks for the submission.

@searls searls merged commit 8484864 into standardrb:main Mar 6, 2023
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

Successfully merging this pull request may close these issues.

2 participants