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

complie_commands.json generated by node-gyp doesn't be in clangd search path. #3016

Open
Freed-Wu opened this issue Apr 13, 2024 · 6 comments

Comments

@Freed-Wu
Copy link

https://clangd.llvm.org/installation.html#project-setup

clangd will look in the parent directories of the files you edit looking for it, and also in subdirectories named build/. For example, if editing $SRC/gui/window.cpp, we search in $SRC/gui/, $SRC/gui/build/, $SRC/, $SRC/build/, …

$ node-gyp configure -- -f compile_commands_json

will generate build/Release/compile_commands_json and build/Debug/compile_commands_json. both of them don't be searched by clangd. Can we provide a build/compile_commands_json which content is just same as build/Release/compile_commands_json or build/Debug/compile_commands_json to make clangd can find it? It should be easy.

Thanks!

@cclauss
Copy link
Contributor

cclauss commented Apr 13, 2024

To clarify, can you please add a symlink between the existing and desired files and then tell us if that placates clangd? If ln -s does not solve this, does a cp do so?

@Freed-Wu
Copy link
Author

Can node-gyp do this work for users?

@cclauss
Copy link
Contributor

cclauss commented Apr 13, 2024

Please provide the requested clarification before asking another question.

@Freed-Wu
Copy link
Author

Please provide

Oh, sorry. 😢

add a symlink

Yes, clangd don't care build/compile_commands.json is normal file or symlink. It only read its content.

@cclauss
Copy link
Contributor

cclauss commented Apr 13, 2024

Can node-gyp do this work for users?

The requested ln or cp command would define precisely what this work is.

@Freed-Wu
Copy link
Author

Can we have a default symlink for Release/compile_commands.json or Debug/compile_commands.json? At least let user can get a out-of-box experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants