doc: simplify vscode instructions
Remove the suggested project config in favor of a suggested global settings.json configuration change to use ninja and automatically run cmake. The other parts are all automatic now and don't need to be mentioned. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
6c38eaa2a5
commit
c36c3e0250
37
README.md
37
README.md
|
@ -117,34 +117,21 @@ ninja
|
||||||
|
|
||||||
## Visual Studio Code Support
|
## Visual Studio Code Support
|
||||||
|
|
||||||
On most platforms, Visual Studio Code should work as-is, as long as the
|
Make sure the
|
||||||
[CMake Tools extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
|
[C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
|
||||||
is installed.
|
and [CMake
|
||||||
|
Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
|
||||||
|
extensions are installed.
|
||||||
|
|
||||||
There is a recommended configuration in the `vscode/settings.json` file. To use
|
Add the following to your `settings.json`:
|
||||||
it, copy the file to a `.vscode/` folder.
|
|
||||||
|
|
||||||
By default, this will publish builds in the `build-vscode/` directory. In the
|
```json
|
||||||
`vscode/settings.json` file, there is an alternate configuration for the
|
{
|
||||||
`"cmake.buildDirectory"` option that will use different build directories for
|
"cmake.configureOnOpen": true,
|
||||||
different toolchains and build configurations.
|
"cmake.preferredGenerators": [ "Ninja" ]
|
||||||
|
}
|
||||||
### Optional: clangd
|
|
||||||
|
|
||||||
The [clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd)
|
|
||||||
uses clangd to provide powerful code completion, errors and warnings and
|
|
||||||
references on click in VS Code.
|
|
||||||
|
|
||||||
With the recommended configuration, the build configuration will generate a
|
|
||||||
`compile_commands.json` file that can be used with clangd. After configuration,
|
|
||||||
you can copy that file to the root directory with a command similar to this one:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
cp build/build-vscode/compile_commands.json .
|
|
||||||
```
|
```
|
||||||
|
.
|
||||||
Then, select "clangd: Restart language server" from the command palette to get
|
|
||||||
completion in the IDE.
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"cmake.generator": "Ninja",
|
|
||||||
"cmake.configureSettings": {
|
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
|
|
||||||
},
|
|
||||||
"cmake.buildDirectory": "${workspaceRoot}/build-vscode",
|
|
||||||
// To use separate directories for different configurations:
|
|
||||||
// "cmake.buildDirectory": "${workspaceRoot}/build/${buildKitTriple}-${buildKitVersion}/${variant:buildType}-${variant:linkage}",
|
|
||||||
}
|
|
Loading…
Reference in New Issue