clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
639 stars 113 forks source link

No longer possible to use cmd as clangd executable #683

Open JVApen opened 2 months ago

JVApen commented 2 months ago

The VS Code upgrade to 1.92 contains a new node version (20) This version seems to have as a side effect that scripts can no longer be used as 'executable' on windows (see similar issue for cmake: https://github.com/microsoft/vscode-cmake-tools/issues/4037#issuecomment-2331286590)

When using VS Code with 1.91, I can use a clangd.cmd that figures out the clangd version to use (the same as we use to compile). However from VS Code 1.92 this is no longer possible.

I'm no expert in typescript, though I believe this behavior can be re-enabled in ClangdContext::active by passing "shell: true" as part of the options of vscodelc.Executable.

Logs

[Error - 11:31:01 AM] Clang Language Server client: couldn't create connection to server.
Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:800:9)
    at c:\Users\JVA\.vscode\extensions\llvm-vs-code-extensions.vscode-clangd-0.1.29\out\bundle.js:39:56906
    at async oc.createConnection (c:\Users\JVA\.vscode\extensions\llvm-vs-code-extensions.vscode-clangd-0.1.29\out\bundle.js:39:12067)
    at async oc.start (c:\Users\JVA\.vscode\extensions\llvm-vs-code-extensions.vscode-clangd-0.1.29\out\bundle.js:39:2940)

System information

Operating system: Windows

HighCommander4 commented 3 days ago

Released in 0.1.30.

HighCommander4 commented 3 days ago

Sorry, had to back out the fix for this, together with #715, for causing #722. Reopening.

JVApen commented 2 days ago

Thanks @HighCommander4, I will be able to look at this on Friday. Thanks for reverting and as such reducing the pressure