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

clangd executable not found when clangd.path is set #655

Open
StMartin81 opened this issue Jul 15, 2024 · 4 comments
Open

clangd executable not found when clangd.path is set #655

StMartin81 opened this issue Jul 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@StMartin81
Copy link

When I set a path to the clangd executable it doesn't work anymore (the settings were working before). It doesn't matter if I use a relative or absolute path. It only works if the clangd executable can be found on the system path and only the executable name ('clangd') is specified.

I'm guessing that this is caused by a recent change in Visual Studio Code itself. If anyone could confirm this I would create a bug report for Visual Studio Code.

System information
Clangd version (from the log, or clangd --version): 18.1.0rc
clangd extension version: v0.1.29
Operating system: Windows 11

@StMartin81 StMartin81 added the bug Something isn't working label Jul 15, 2024
@HighCommander4
Copy link
Contributor

Can you state your VSCode version as well?

@StMartin81
Copy link
Author

Sorry I didn't get any notifications: My current Visual Studio Code version is 1.92.1

@HighCommander4
Copy link
Contributor

I'm not able to reproduce this. (Note however than I'm on Linux, not Windows.)

I would suggest testing with some older vscode versions (they can be downloaded from https://code.visualstudio.com/updates). If you can find a vscode version X such that it works with version X but does not work with version X+1, then it's fair to say that the issue is caused by a vscode change and you should file an issue with those details at https://github.com/microsoft/vscode/issues/.

@StMartin81
Copy link
Author

StMartin81 commented Aug 19, 2024

I don't know what changed. I reverted the clangd plugin version as well as the Visual Studio Code version but wasn't able to find a combination where the previous settings worked.

This is what the directory structure looks like:

tools
    |- clangd.exe
vs-code-proj
    |- .vscode
        |- VS-Code.workspace

This is the workspace setting file which works:

{
	"folders": [
		{
			"path": "..",
		},
	],
	"settings": {
		"clangd.path": "${workspaceFolder}\\..\tools\\clangd.exe"
		// "clangd.path": "${workspaceFolder:vs-code-proj}\\..\\..\tools\\clangd.exe"
	},

When using named folders there is an additional ..\\ needed which is really strange.

Previously it looked like this:

{
	"folders": [
		{
			"path": "..",
		},
	],
	"settings": {
		"clangd.path": "${workspaceFolder}/../tools/clangd"
	},

So backslashes are needed on Windows and the file extension needs to be also set.

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

No branches or pull requests

2 participants