-
Notifications
You must be signed in to change notification settings - Fork 58
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
Significant delay in initialization for completion/navigation on open file #2014
Comments
A few questions to try to narrow the issue down:
|
|
Are you using clang as your compiler, or something else? A possible diagnostic step that might produce some interesting information would be to attach the debugger to the clangd process, interrupt it a few times during the 30-60s pause, and get stack traces to see what clangd is doing at that time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use vscode with clangd extension for code completion and navigation, but when I open or reopen a file, it takes a very long time, about 30~60s, for clangd to initialize. The log of the clangd extension is like below:
I[11:32:54.655] <-- textDocument/hover(2699)
I[11:32:54.782] <-- $/cancelRequest
I[11:33:26.077] --> workspace/semanticTokens/refresh(53)
I[11:33:26.077] --> textDocument/clangd.fileStatus
I[11:33:26.080] <-- reply(53)
I[11:33:28.536] --> textDocument/publishDiagnostics
I[11:33:28.556] --> reply:textDocument/documentSymbol(2688) 56891 ms
I[11:33:28.562] --> reply:textDocument/documentHighlight(2689) 56896 ms
I[11:33:28.572] --> reply:textDocument/semanticTokens/full(2690) 56907 ms
I[11:33:28.574] --> reply:textDocument/codeAction(2691) 56909 ms, error: Task was cancelled.
I[11:33:28.574] --> reply:textDocument/documentLink(2692) 56907 ms
I[11:33:28.575] --> reply:textDocument/codeAction(2693) 56731 ms
I[11:33:28.578] --> reply:textDocument/inlayHint(2694) 56378 ms
I[11:33:28.578] --> reply:textDocument/hover(2695) 52978 ms, error: Task was cancelled.
I[11:33:28.578] --> reply:textDocument/hover(2696) 52579 ms, error: Task was cancelled.
I[11:33:28.578] --> reply:textDocument/hover(2697) 51494 ms, error: Task was cancelled.
I[11:33:28.578] --> reply:textDocument/definition(2698) 51394 ms
I[11:33:28.578] --> reply:textDocument/hover(2699) 33923 ms, error: Task was cancelled.
The extension arguments are:
"clangd.arguments": [
"--background-index",
"--clang-tidy",
"--completion-style=detailed",
"--header-insertion=never",
"-j=40",
"--pch-storage=memory"
],
additionally, CPU usage show in htop is low and seems like parallel setting has no effect.
Output of
clangd --version
:clangd version 15.0.6
Features: linux
Platform: x86_64-unknown-linux-gnu
Editor/LSP plugin:
vscode/clangd extension
Operating system:
centos7 kernel 3.10.0-1160.el7.x86_64
The text was updated successfully, but these errors were encountered: