-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Handle textDocument/didChange
the same way as textDocument/didSave
#6
Comments
Unfortunately vscode is issueing a |
Perhaps a solution is debouncing? As in, wait for a time interval whenever a change occurs, and see if it stops changing during that interval. Alternatively, if it's cheap to do so, just run the server whenever a change occurs, and then check at completion if it still reflects the input. |
Debouncing would be an option, although i think it would increase latency from a possible change to having these changes reflected in answers from the language server (such as diagnostics). The problem with the Another approach would be to behave slightly differently based on what client is currently connected. We need to store client information and capabilities anyways, so this should be available in the language server. I would tend to the first approach, as adding complex logic via dispatching on connected clients makes everything more complex than it might need to be. And we can still go down that road if we detect more changes that cannot be handled with a more generic approach like watching for file system changes. |
Not necessarily that helpful, but I'll just mention that the last time I worked on a language server I was baking it into the compiler, so I was able to have special case logic for "in-memory overrides" of any particular file path. Not sure if there's a likely path to adding a feature to Ponyc to add that kind of in-memory override feature. |
Gordon also mentioned in the sync call the inefficient/hacky, but non-invasive approach of creating temporary files on disk that match the active buffers in the editor. It's not that efficient, but it would get the job done. |
Thanks for your input. It turned out, I didn't configure the server capabilities correctly. The server advertises to the client what it wants to receive, especially the So we are actually good, and everything is working as expected with the decently recent neovim. |
The neovim lsp client only sends
textDocument/didChange
notifications, notextDocument/didSave
notifications.Either we need to configure the neovim lsp client to do this or handle the
textDocument/didChange
the same way as we currently dotextDocument/didSave
and hope for the best that no other lsp client issues both shortly after one another.The text was updated successfully, but these errors were encountered: