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

"Failed to check for clangd update: TypeError: Invalid comparator: Features:" error when running "clangd: Check for language server update" #396

Closed
HighCommander4 opened this issue Oct 17, 2022 · 4 comments · Fixed by clangd/node-clangd#21
Assignees
Labels
bug Something isn't working

Comments

@HighCommander4
Copy link
Contributor

When I try to run the command "clangd: Check for language server update", I get the following error in a popup:

Failed to check for clangd update: TypeError: Invalid comparator: Features:

The stack trace in the devtools console (not that it seems very helpful) is:

[Extension Host] Failed to check for clangd update:  TypeError: Invalid comparator: Features:
	at va.parse (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:26723)
	at new Comparator (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:26522)
	at /home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:22500
	at Array.map (<anonymous>)
	at On.parseRange (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:22493)
	at /home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:21392
	at Array.map (<anonymous>)
	at new Range (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:21380)
	at new Range (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:21169)
	at outside (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:29670)
	at Object.gtr (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:1:30279)
	at rangeGreater (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:237:639)
	at Object.<anonymous> (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:236:3851)
	at Generator.next (<anonymous>)
	at fulfilled (/home/nr/.vscode/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.22/out/bundle.js:235:39174)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
@HighCommander4
Copy link
Contributor Author

The call that's throwing is this rangeGreater(releasedVer, installedVer) call.

Going into it, we have:

> releasedVer.raw
'15.0.1'
> installedVer.raw
'16.0.0
Features:'

I'm guessing that Features: shouldn't be there?

@HighCommander4
Copy link
Contributor Author

While debugging this, I discovered that vscode-clangd is not picking up the latest code in node-clangd -- rather, it is picking up the latest node-clangd release, 0.1.4, which does not contain some fixes such as this one, which may fix this (as well as #384).

Filed clangd/node-clangd#18 to release a new version of node-clangd so vscode-clangd can pick up the fixes.

@HighCommander4
Copy link
Contributor Author

I figured out how to get vscode-clangd to consume the latest node-clangd locally, and confirmed that this bug still exists with the latest node-clangd.

@HighCommander4
Copy link
Contributor Author

Proposed fix at clangd/node-clangd#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant