-
Notifications
You must be signed in to change notification settings - Fork 325
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
Question about the order of LSP requests and notifications (didChange and semanticTokens) #1495
Comments
This behavior is absolutely fine. The server should in this situation compute the semantic tokens on the state of files it knows. If then some additional typing happens on the client, the client should either
Hope that explains it, |
I don't fully understand. Let me describe the problem I encountered in more detail.
I typed
I got the log of lsp server
For each didChanged notification, a But if I typed
I got the log of lsp server
The semanticTokens request occurs before didChange, and the didChange notification is only the second time |
Ah, now I understand. This got fix in the latest versions of the client (e.g. 9.x) |
It seems fixed by #1511.
But I still have a small question, can I check the version of vscode-languageserver-node I am using in the VSCode to ensure that? |
You define the version you are using via the npm dependency ( |
thx |
I am a developer of the lsp language extension. I noticed that under normal circumstances, when a user enters code in vscode, lsp will:
1 Send a notification of file changes (Notification { method: "textDocument/didChange"})
2 Request new semantic highlighting (Request { method: "textDocument/semanticTokens})
But I found that when inputting continuously and quickly (such as typing two Enter or other keys), sometimes semantic highlighting will be requested first, and then file changes will be notified.
I'm not sure if this is a problem with my lsp client implementation, or a special design of vscode, or a configurable option of vscode
here is my language extension:
client: https://github.com/kcl-lang/vscode-kcl
server: https://github.com/kcl-lang/kcl/tree/main/kclvm/tools/src/LSP
also reported in microsoft/vscode-discussions#1219
Version: 1.89.1 (Universal)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 21.5.0
The text was updated successfully, but these errors were encountered: