-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor formatting and wording changes (#1)
* Minor formatting and wording changes * tweaks
- Loading branch information
Showing
1 changed file
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
# LSP-clangd | ||
C++ support for Sublime's LSP plugin provided through clangd. | ||
|
||
C/C++ and Objective-C/C++ support for Sublime's LSP plugin provided through clangd. | ||
|
||
## Installation | ||
- Install LSP and LSP-clangd from Package Control | ||
- Install clangd using your package manager or let this plugin install clangd for you | ||
|
||
- Install [LSP](https://packagecontrol.io/packages/LSP) and `LSP-clangd` from Package Control | ||
- (Optional) Install clangd using your package manager or let this package install clangd for you | ||
|
||
## Usage | ||
|
||
By default, clangd will assume your code is built as clang some_file.cc, and you’ll probably get errors about missing #included files, etc. | ||
By default, clangd will assume your code is built as `clang some_file.cc`, and you’ll probably get errors about missing `#include`d files, etc. | ||
|
||
For complex projects clangd needs to know your build flags. This can be done using a `compile_commands.json` or `compile_flags.txt` file. | ||
For complex projects, clangd needs to know your build flags. This can be done using a `compile_commands.json` or `compile_flags.txt` file. | ||
|
||
For CMake-based projects a `compile_commands.json` file can be generated using the `-DCMAKE_EXPORT_COMPILE_COMMANDS=1` flag. | ||
|
||
```bash | ||
cd build | ||
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. | ||
# compile_commands.json will be written to your build directory. | ||
``` | ||
If your build directory is $SRC or $SRC/build, clangd will find it. Otherwise, symlink or copy it to $SRC, the root of your source tree. | ||
|
||
See [clangd website](https://clangd.llvm.org/installation#project-setup) for instructions using other build systems. | ||
If your build directory is equivalent to the root of the project or `<project_root>/build` then clangd will find it. Otherwise, symlink or copy it to the root of your project. | ||
|
||
> See [clangd Project Setup](https://clangd.llvm.org/installation#project-setup) for more information on using `compile_commands.json`, `compile_flags.txt` and other build systems. | ||
## Sublime Commands | ||
|
||
| Sublime Command | Description | | ||
| ------------------------------- | ----------------------------------------------------------- | | ||
| lsp_clangd_switch_source_header | Switch between the main source file (.cpp) and header (.h). | | ||
| `lsp_clangd_switch_source_header` | Switch between the main source file (.cpp) and header (.h). | |