mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 00:25:07 +00:00
.
parent
3cdf79b663
commit
e0dd026b5b
@ -52,7 +52,7 @@ If you use other editors not listed there (LSP decouples servers and clients, so
|
||||
|
||||
If your project has subprojects (e.g. separate repos), some setup in your editor is needed for proper root detection: https://github.com/MaskRay/ccls/wiki/FAQ#project-root-detection
|
||||
|
||||
#### [[compile_commands.json]] (Best)
|
||||
#### [[compile_commands.json]]
|
||||
|
||||
Remember to copy/symlink it to the project root.
|
||||
|
||||
@ -82,6 +82,12 @@ Note:
|
||||
`.ccls` does not do *word splitting* or *command substitution* for you,
|
||||
you cannot use space-separated arguments like `%cpp -std=gnu++14 -pthread`
|
||||
|
||||
#### No `.ccls` or `compile_commands.json`
|
||||
|
||||
If neither file exists, ccls assumes there is an imaginary `.ccls` with one line: `%clang`.
|
||||
|
||||
This is convenient for trying out a one-file project. `git init` to let the language client know it is a project, e.g. `cd /tmp; mkdir c; cd c; git init; touch a.cc`
|
||||
|
||||
### Windows
|
||||
|
||||
If your project is compiled with MSVC, you may change the compiler driver (`%clang` above) to `clang-cl`, and use the initialization option `clang.extraArgs` to pass three options:
|
||||
|
@ -32,7 +32,17 @@ let g:LanguageClient_settingsPath = '/home/YOUR_USERNAME/.config/nvim/settings.j
|
||||
let g:LanguageClient_hasSnippetSupport = 0
|
||||
```
|
||||
|
||||
Make sure you have `.ccls` or [[compile_commands.json]] in your project root. Open a file in the project, run `:LanguageClientStart`.
|
||||
First example:
|
||||
|
||||
```zsh
|
||||
cd /tmp; mkdir c; cd c
|
||||
git init # let LanguageClient-neovim know this is a project
|
||||
echo '#include <stddef.h>\nint main() {}' > a.cc
|
||||
nvim a.cc
|
||||
# :LanguageClientStart
|
||||
```
|
||||
|
||||
For a larger project, you'll need [[.ccls|Getting-started#ccls]] or [[compile_commands.json]] in your project root.
|
||||
|
||||
These features will work out-of-the-box.
|
||||
|
||||
|
@ -23,6 +23,8 @@ bear make
|
||||
# generates compile_commands.json
|
||||
```
|
||||
|
||||
### [compiledb](https://github.com/nickdiego/compiledb)
|
||||
|
||||
### [scan-build](https://github.com/rizsotto/scan-build)
|
||||
|
||||
scan-build is a python package that can generate a compilation database for clang tooling (uses Bear as a backend). This too can be used for any project based on a `Makefile`.
|
||||
|
Loading…
Reference in New Issue
Block a user