Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't start client Clang Language Server in VS Code

I just installed Visual Studio Code in my Windows 10 machine but I get the error "Couldn't start client Clang Language Server" .... How can I solve this?

Regards, Juan

like image 600
Juan Dent Avatar asked Aug 31 '17 15:08

Juan Dent


2 Answers

This is likely because VS Code or an extension is trying to run clang and you do not have it installed or have not configured the path.

Start code from the command line with code --disable-extensions. Does the message still occur? If not, then one of your extensions is to blame. Find which one is related to C or C++ and read the documentation for it.

like image 173
Llewey Avatar answered Nov 15 '22 08:11

Llewey


I found this thread when trying to solve this issue for Swift development on vscode. Yes disabling extensions will remove the error but here is the solution for Swift.

After building the Swift plugin for vscode you have to point it to the executable (which I neglected to do). To do this you have to add this JSON to your settings.json

"sourcekit-lsp.serverPath": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp"

For more information please see this article

like image 38
tyirvine Avatar answered Nov 15 '22 08:11

tyirvine