bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.32k stars 4.1k forks source link

Hope bazel can generate compile_commands.json for LSP(clangd/intelliSense) #22442

Open imdouyu opened 6 months ago

imdouyu commented 6 months ago

Description of the feature request:

CMake can do this easily, but bazel need another project called hedronvision/bazel-compile-commands-extractor to do it, whether this feature is better integrated in bazel itself in the long run.

No response

Which category does this issue belong to?

No response

What underlying problem are you trying to solve with this feature?

No response

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

comius commented 6 months ago

Bazel tries to provide general ways to integrate with IDEs. We're moving away from putting specifics like C++ or a specific IDE into Bazel. On the long run we'd like to make Bazel smaller and more general.

I can see how CMake which is specific for C++ has such support.

cc @mai93 @kotlaja

The link might give some inspiration on how to integrate C++ with IDEs.