nodejs / nodejs/node-gyp

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

Open
#3,016 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.7k
Forks
1.9k
Avg merge
1d 4h
Merged PRs (30d)
5

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the node-gyp configure flow and the generated build/Release/compile_commands_json and build/Debug/compile_commands_json paths described in the issue; compare them with clangd’s documented project lookup behavior. Done means the compile database is available at the parent build location clangd searches, with behavior verified for the configure command.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, python
Domain
build-system, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.