massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-clangd / README.md
1 # coc-clangd
2
3 This extension connects [coc.nvim][] to the [clangd][] language server.
4
5 ## Quick Start
6
7 1. install [Node.js][]. `coc.nvim` and `coc-clangd` run on Node.js.
8 1. install `coc.nvim`. Instructions using `vim-plug` (check out [coc.nvim Wiki][] other options):
9    - add to `.vimrc`: `vim Plug 'neoclide/coc.nvim', {'branch': 'release'}`
10    - in vim, run `:PlugInstall`
11 1. in vim, run `:CocInstall coc-clangd`
12 1. `coc-clangd` will try to find `clangd` from your `$PATH`, if not found, you can run `:CocCommand clangd.install` to install the [latest release][] from GitHub
13 1. follow [Project setup][] to generate `compile_commands.json` for your project
14
15 > **Note**: If you've configured `clangd` as a languageServer in `coc-settings.json`, you should remove it to avoid running clangd twice!
16
17 ## Protocol extensions
18
19 `clangd` supports some [extensions][] that are not in the official [Language Server Protocol specification][lsp].
20
21 `coc-clangd` adds support for:
22
23 - Switching between header and implementation file: `:CocCommand clangd.switchSourceHeader`
24   - You can open in split buffer by `:CocCommand clangd.switchSourceHeader vsplit`
25 - File status monitor, shows on NeoVim statusline
26 - Describe symbol under the cursor: `:CocCommand clangd.symbolInfo`
27 - Completions that adjust text near the cursor (e.g. correcting `.` to `->`)
28
29 ## Configurations
30
31 `:CocConfig` opens your global `coc-settings.json`, or `:CocLocalConfig` opens local configuration in your project `.vim/coc-settings.json`.
32
33 | Configurations                  | Description                                                                                                                            | Default  |
34 | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------- |
35 | clangd.enabled                  | enable `coc-clangd`                                                                                                                    | `true`   |
36 | clangd.arguments                | arguments for `clangd` server                                                                                                          | `[]`     |
37 | clangd.checkUpdates             | check for clangd language server updates on startup                                                                                    | `false`  |
38 | clangd.disableCompletion        | disable completion source from clangd                                                                                                  | `false`  |
39 | clangd.disableDiagnostics       | disable diagnostics from clangd                                                                                                        | `false`  |
40 | clangd.disableSnippetCompletion | disable completion snippet from clangd                                                                                                 | `false`  |
41 | clangd.compilationDatabasePath  | specifies the directory containing the compilation database                                                                            | `''`     |
42 | clangd.fallbackFlags            | extra clang flags used to parse files when no compilation database is found                                                            | `[]`     |
43 | clangd.path                     | path to `clangd` executable                                                                                                            | `clangd` |
44 | clangd.semanticHighlighting     | enable semantic highlighting, requires [jackguo380/vim-lsp-cxx-highlight](https://github.com/jackguo380/vim-lsp-cxx-highlight) to work | `false`  |
45 | clangd.serverCompletionRanking  | always rank compilation items on the server as you type                                                                                | `true`   |
46
47 ## Commands
48
49 - `clangd.switchSourceHeader`: switch between source/header files
50 - `clangd.symbolInfo`: resolve symbol info under the cursor
51 - `clangd.memoryUsage`: show memory usage
52 - `clangd.ast`: show AST
53 - `clangd.install`: install latest clangd release from GitHub
54 - `clangd.update`: check for updates to clangd from GitHub
55
56 ## License
57
58 Apache 2.0 with LLVM Exception
59
60 This is the [standard LLVM license](https://llvm.org/foundation/relicensing/).
61
62 ---
63
64 > This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)
65
66 [node.js]: https://nodejs.org/en/
67 [clangd]: https://clangd.llvm.org/installation.html
68 [coc.nvim]: https://github.com/neoclide/coc.nvim
69 [coc.nvim wiki]: https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim
70 [lsp]: https://microsoft.github.io/language-server-protocol/specification
71 [extensions]: https://clangd.llvm.org/extensions.html
72 [latest release]: https://github.com/clangd/clangd/releases
73 [project setup]: https://clangd.llvm.org/installation.html#project-setup