[PATCH] D66937: [clangd] Fix the stale documentation about background indexing.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 29 04:24:44 PDT 2019
hokein created this revision.
hokein added a reviewer: kadircet.
Herald added subscribers: arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D66937
Files:
clang-tools-extra/docs/clangd/Installation.rst
Index: clang-tools-extra/docs/clangd/Installation.rst
===================================================================
--- clang-tools-extra/docs/clangd/Installation.rst
+++ clang-tools-extra/docs/clangd/Installation.rst
@@ -352,20 +352,26 @@
Creating this file by hand is a reasonable place to start if your project is
quite simple.
-Project-wide Index
-==================
+Background Indexing
+===================
-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).
+The index enables code navigation features (go-to-definition, find-references)
+and global code completion.
-- 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;
+ 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;
-- Generate an index file using `clangd-indexer
+
+Build Index Manually
+====================
+
+You probably don't need this. There is a `clangd-indexer
<https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/clangd/indexer/IndexerMain.cpp>`__
- Then you can pass generated index file to clangd using
- `-index-file=/path/to/index_file`. *Note that clangd-indexer isn't
+which generates an index file for your project. To use the index, pass the flag
+`-index=file=/path/to/index_file` to clangd. *Note that clangd-indexer isn't
included alongside clangd in the Debian clang-tools package. You will
likely have to build it from source to use this option.*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66937.217834.patch
Type: text/x-patch
Size: 2111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190829/ad6f264a/attachment-0001.bin>
More information about the cfe-commits
mailing list