Browse Source

docs: add a note on setting up `clangd` (#4135)

This PR adds a note on how to generate `compile_commands.json` which is
necessary for having `clangd` generate accurate diagnostics
Brymer Meneses 1 year ago
parent
commit
70c20be91b
1 changed files with 9 additions and 0 deletions
  1. 9 0
      docs/project/contribution_tools.md

+ 9 - 0
docs/project/contribution_tools.md

@@ -225,6 +225,15 @@ considering if they fit your workflow.
             you should be prompted to use Carbon's
             [devcontainer](/.devcontainer/devcontainer.json) with "Reopen in
             container".
+-   [clangd](https://clangd.llvm.org/installation): An LSP server implementation
+    for C/C++.
+    -   To ensure that `clangd` reports accurate diagnostics. It needs a
+        generated file called `compile_commands.json`. This can be generated by
+        invoking the command below:
+        ```
+        ./scripts/create_compdb.py
+        ```
+        -   **NOTE**: This assumes you have `python` 3 installed on your system.
 
 ### Manually building Clang and LLVM (not recommended)