Open clavey13 opened 1 year ago
I also stumbled upon this weird error. It turns out that child_process.spawn() returns ENOENT
if the current working directory of the process doesn't exist, even if the process binary itself can be executed just fine. In my case, this happened because I had some non-existent directories in my workspace JSON. After I removed them, the error went away.
I'm not sure the root cause is the same in your case, but you can try removing invalid/non-existent paths from your workspace file, if you have any.
THX @dfyz for the workaround! I believe this is still a bug. Personally, I need a multi root workspace to be able to work with Mac and Linux, which looks something like that:
"folders": [
// Linux 🐧
// { //bug
// "path": "/home/XXX"
// },
// {
// "path": "/home/XXX"
// },
// macOS 🍎
{
"path": "/Users/XXX"
},
{
"path": "/Users/XXX"
},
],
As you can see, I had to comment out the Linux section, so that clangd would work under macOS. Otherwise, I get the following output:
[Error - 8:54:19 AM] Clang Language Server client: couldn't create connection to server. Launching server using command /usr/local/opt/llvm/bin/clangd failed. Error: spawn /usr/local/opt/llvm/bin/clangd ENOENT
Basically, I'm including the same paths, but I haven't found a way yet to use ~
or $HOME
in jsonc.
I believe clangd should just ignore the unfound directories instead of crashing.
Any thoughts on this?
Probably related to #352, #38 and https://github.com/clangd/clangd/issues/1549
I'm working with clangd in VS Code, inside a Docker container. At one point, Intellisense was working, but now is not. I made sure MS C/C++ has been uninstalled. I've attempted restarting the language server, which gives me an ENOENT error on the clangd executable (see below). I've exited and restarted Code several times, as well as the Docker container. I've listed the details below, but am new to Code and clangd; bear with me if there are things I've missed. My project lead is also out of ideas on things to check. I'm sure there's something we're missing, but no idea what. Any help is appreciated.
Thanks, -- Cathy
Linux 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux Docker version 20.10.17, build 100c701
Version: 1.75.1 Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf Date: 2023-02-08T21:35:30.018Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Linux x64 5.15.0-58-generic snap Sandboxed: No
clangd v0.1.23
Trying to restart the language server gives the following, with uncaught errors (see image also):
The clangd binary is here:
Trying to run clangd on the command line of my container gives the following, so the binary seems to work OK.