From c3a872290cf936ead88e0b08fe3cee95f693ad34 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 30 Oct 2018 12:26:49 -0700 Subject: [PATCH] pick --- Visual-Studio-Code.md | 15 ++++++++++++++- compile_commands.json.md | 7 +++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Visual-Studio-Code.md b/Visual-Studio-Code.md index 6d8e7d1..d86cbeb 100644 --- a/Visual-Studio-Code.md +++ b/Visual-Studio-Code.md @@ -81,6 +81,19 @@ For VSCodeVim users, here's how to set arguments in User Settings (`settings.jso ``` So you could hit `-t` to see callees up to 3rd level if you set `` to `` +### Using vscode-ccls along side vscode-cpptools extension for debugger support + +The `vscode-ccls` extension doesn't provide any debugger integration. One popular option is to use the [vscode-cpptools](https://github.com/Microsoft/vscode-cpptools) extension for this aspect. By default however, `vscode-cpptools` provides editor features that overlap with CQuery, which yields duplicate results in things like autocomplete. The following settings may be applied to disable the editor support of `vscode-cpptools` to prevent this from happening, while still retaining the debugger features. + +```json +{ + "C_Cpp.autocomplete": "Disabled", + "C_Cpp.formatting": "Disabled", + "C_Cpp.errorSquiggles": "Disabled", + "C_Cpp.intelliSenseEngine": "Disabled", +} +``` + ### Semantic Navigation The command is `ccls.navigate`, which need an argument `direction`. ("D" => first child declaration "L" => previous declaration "R" => next declaration "U" => parent declaration) @@ -92,4 +105,4 @@ The command is `ccls.navigate`, which need an argument `direction`. ("D" => firs {"before":["","h"],"commands":[{"command":"ccls.navigate","args":{"direction":"U"}}]}, {"before":["","l"],"commands":[{"command":"ccls.navigate","args":{"direction":"D"}}]} ] -``` \ No newline at end of file +``` diff --git a/compile_commands.json.md b/compile_commands.json.md index d02a8ba..2da4325 100644 --- a/compile_commands.json.md +++ b/compile_commands.json.md @@ -53,6 +53,13 @@ def configure(conf): ln -s build/compile_commands.json ``` +## [buck](https://buckbuild.com/) + +```sh +buck build :helloworld#compilation-database +ln -s $(buck targets --show-output :helloworld#compilation-database | cut -d ' ' -f 2) +``` + ### stdout of an external command You may use the initialization option `"compilationDatabaseCommand"` to provide the JSON compilation database. ccls will read its stdout rather than read `compile_commands.json`. This may be useful when ccls cannot parse the `compile_commands.json` correctly (e.g. MSVC cl.exe, Intel C++ Compiler options)