nodejs / node-gyp

Node.js native addon build tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Freed-Wu opened this issue · comments

commented

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!

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?

commented

Can node-gyp do this work for users?

Please provide the requested clarification before asking another question.

commented

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.

Can node-gyp do this work for users?

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

commented

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.