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

VSCode Plug-in terminates unexpectedly when searching for symbols #648

Closed
moether opened this issue Jan 15, 2021 · 3 comments
Closed

VSCode Plug-in terminates unexpectedly when searching for symbols #648

moether opened this issue Jan 15, 2021 · 3 comments

Comments

@moether
Copy link

moether commented Jan 15, 2021

Using one of the current development snapshots of clangd, the vscode plugin suddenly stops when I use Ctrl-T and search for "main".
The issue is always reproducible using for example the libwebsockets project from https://github.com/warmcat/libwebsockets/archive/v4.1.6.tar.gz
Note that this problem never occurs when I switch back to clangd 11.0.

Extension Host Tab
[2021-01-15 08:48:12.994] [exthost] [error] [llvm-vs-code-extensions.vscode-clangd] provider FAILED [2021-01-15 08:48:12.994] [exthost] [error] Error: Connection got disposed. at Object.dispose (/home/thomasm4/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.9/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27) at Object.dispose (/home/thomasm4/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.9/node_modules/vscode-languageclient/lib/common/client.js:73:35) at /home/thomasm4/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.9/node_modules/vscode-languageclient/lib/common/client.js:2320:28

Full Clangd Logs
issuelog.txt

System information
Clangd version (from the log, or clangd --version): clangd version 12.0.0 (https://github.com/llvm/llvm-project.git ceb9379a90f5a320d19f5694ef00b4d1164fa7d6)
clangd extension version: 0.1.9
Operating system: Manjaro Linux

@kadircet
Copy link
Member

looks like this is happening because we've got a bunch of "NaN"s as values for scores, which are not allowed in JSON.
i'll take a look, moving to issue to clangd in the meanwhile.

@kadircet kadircet transferred this issue from clangd/vscode-clangd Jan 15, 2021
@kadircet
Copy link
Member

Sent out https://reviews.llvm.org/D94755

@moether
Copy link
Author

moether commented Jan 18, 2021

Your diff fixes the issue. Thanks for the quick response!

arichardson pushed a commit to arichardson/llvm-project that referenced this issue Mar 30, 2021
NameMatch could be a float close to zero, in such cases we were
dividing by zero and moreover propogating a "NaN" to clients, which is invalid
per JSON.

This fixes the issue by only using Quality scores whenever the NameMatch is low,
as we do in CodeCompletion ranking.

Fixes clangd/clangd#648.

Differential Revision: https://reviews.llvm.org/D94755
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
NameMatch could be a float close to zero, in such cases we were
dividing by zero and moreover propogating a "NaN" to clients, which is invalid
per JSON.

This fixes the issue by only using Quality scores whenever the NameMatch is low,
as we do in CodeCompletion ranking.

Fixes clangd/clangd#648.

Differential Revision: https://reviews.llvm.org/D94755
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