Add Visual-Studio-Code.md

Fangrui Song 2018-07-14 14:15:13 -07:00
parent 544a4600a3
commit 91e817eed6
2 changed files with 47 additions and 1 deletions

45
Visual-Studio-Code.md Normal file

@ -0,0 +1,45 @@
## Install extension
Install the ccls extension from the marketplace [here](https://marketplace.visualstudio.com/items?itemName=ccls-project.ccls). The source code is located at <https://github.com/MaskRay/vscode-ccls>.
If you run into issues, you can view debug output by running the
(`F1`) `View: Toggle Output` command and opening the `ccls` output section.
## Setting up the extension
To tell the extension where to find ccls, either add ccls to your `PATH` or set "ccls.launch.command" in User Settings to the absolute path pointing to ccls.
```json
{
"ccls.launch.command": "/path/to/ccls/Release/ccls",
"ccls.cacheDirectory": "/tmp/.ccls-cache/"
}
```
### `ccls.index.extraClangArguments`
If for whatever reason you cannot generate a `compile_commands.json` file, you
can add the flags to the `ccls.clang.extraArgs` configuration
option.
### Semantic highlighting
The Visual Studio Code ccls extension supports [semantic highlighting](https://medium.com/@evnbr/coding-in-color-3a6db2743a1e). To enable, put into settings.conf (or workspace configuration):
```json
"ccls.highlighting.enabled.types": true,
"ccls.highlighting.enabled.freeStandingFunctions": true,
"ccls.highlighting.enabled.memberFunctions": true,
"ccls.highlighting.enabled.freeStandingVariables": true,
"ccls.highlighting.enabled.memberVariables": true,
"ccls.highlighting.enabled.namespaces": true,
"ccls.highlighting.enabled.macros": true,
"ccls.highlighting.enabled.enums": true,
"ccls.highlighting.enabled.typeAliases": true,
"ccls.highlighting.enabled.enumConstants": true,
"ccls.highlighting.enabled.staticMemberFunctions": true,
"ccls.highlighting.enabled.parameters": true,
"ccls.highlighting.enabled.templateParameters": true,
"ccls.highlighting.enabled.staticMemberVariables": true,
"ccls.highlighting.enabled.globalVariables": true,
```

@ -8,4 +8,5 @@
- [[Emacs]]
- [[Neovim]]
- [[Vim]]
* [[Debugging]]
- [[Visual Studio Code]]
* [[Debugging]]