[PATCH] D66937: [clangd] Fix the stale documentation about background indexing.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 05:01:50 PDT 2019


kadircet added a subscriber: sammccall.
kadircet added a comment.

Thanks for updating this! Pinging @sammccall since he is also working on writing some release docs, might be helpful to bring this to your attention.



================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:358
 
-By default clangd only has a view on symbols coming from files you are
-currently editing. You can extend this view to whole project by providing a
-project-wide index to clangd.  There are two ways to do this.
+clangd (v9) turns on the background indexing by default, which will incrementally
+build an index of your project (all files listed in the compilation database).
----------------
I don't think it is necessary to mention the version. It could be better to directly start with
```
Clangd builds an incremental index over files listed in the compilation database.
```


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:360
+build an index of your project (all files listed in the compilation database).
+The index enables code navigation features (go-to-definition, find-references)
+and global code completion.
----------------
instead of `enables` let's say `improves` ?


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:361
+The index enables code navigation features (go-to-definition, find-references)
+and global code completion.
 
----------------
drop the global


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:362
+and global code completion.
 
+- the index is saved to the ``.clangd/index`` in the project root;
----------------
let's mention it will only use your idle cores to build an index and total amount of cores it will use can be limited to `X` by passing `-j=X` to clangd


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:363
 
-- Pass an experimental `-background-index` command line argument.  With
-  this feature enabled, clangd incrementally builds an index of projects
-  that you work on and uses the just-built index automatically.
+- the index is saved to the ``.clangd/index`` in the project root;
+- background indexing canb be disable by the ``--background-index=false`` flag;
----------------
that's not necessarily true, we also save at home directory, and I don't think it is relevant for installation. maybe rather drop it?


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:364
+- the index is saved to the ``.clangd/index`` in the project root;
+- background indexing canb be disable by the ``--background-index=false`` flag;
+  if it is disabled, clangd doesn't have a global view of the whole project, it
----------------
s/canb/can
s/disable/disabled


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:365
+- background indexing canb be disable by the ``--background-index=false`` flag;
+  if it is disabled, clangd doesn't have a global view of the whole project, it
+  only has a view on symbols coming from files you are currently editing;
----------------
instead of `if it's disabled...`

```
Note that, disabling background-index will limit clangd's knowledge about your codebase to
files you are currently editing.
```


================
Comment at: clang-tools-extra/docs/clangd/Installation.rst:369
+
+Build Index Manually
+====================
----------------
I don't think it is relevant for installation section again. But let's make the `you probably don't need this` a seperate line and make it bold or red ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66937/new/

https://reviews.llvm.org/D66937





More information about the cfe-commits mailing list