support commands in settings
See original GitHub issueFor proper CMake support we would need "clangd.arguments": [ "--compile-commands-dir=${command:cmake.launchTargetDirectory}" ]
.
https://github.com/microsoft/vscode-cmake-tools/issues/654
Problem is that invoking commands is async so you can’t just add this in config.ts:
const cmdPrefix = 'command:';
if (name.startsWith(cmdPrefix))
return await vscode.commands.executeCommand(name.substr(cmdPrefix.length));
Btw, looks like the relevant vscode feature request is https://github.com/microsoft/vscode/issues/46471.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to customize Voice Control commands on your ...
Go to Settings. Select Accessibility, then select Voice Control. Select Customize Commands, then go through the list of commands.
Read more >Command Line Tool Support - WebStorm - JetBrains
Windows and Linux: File | Settings | Tools | Command Line Tool Support. macOS: WebStorm | Preferences | Tools | Command Line Tool...
Read more >Viewing support assistance settings - IBM
In the management GUI, click Settings > Support > Support Assistance. The Support Assistance window is displayed, which shows the support assistance settings....
Read more >get-service-settings — AWS CLI 1.27.27 Command Reference
--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton .
Read more >Dell Command | Update Version 4.x User's Guide | Dell US
Default source location from Dell Support Site. Internet Proxy, Use current Internet proxy settings. User Consent, Varies based on the selection during ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please note that in a multi-config build environment the problem is not the project root, but rather the build output root for each config.
For example, in my case (cmake + clangd + vscode + cmake-tools), I definitely want my build to be out of source and each build config in its separate build tree (e.g. windows, linux, dev, release, valgrind, etc…).
The one responsible for generating the compilation database is
cmake
. CMake knows everything about the project, its source, its build output, etc…The one that invokes cmake is
cmake-tools
, which knows about the CMakePresets.json which has the source dir, build, dir, preset name, and many more info about the presets. My understanding is that the whole point from this issue is to use such info through a substitution with command in vscode settings.json.The one who uses
compiler_commands.json
isclangd
andclangd
has no idea wherecmake
is putting that file, and the settings in vscode are so limited that we can only (right now) hardcode a directory forclangd
to look into.So at the end of the day, imho, it’s not really
clangd
’s responsibility to figure out wherecmake
puts its babies. Inside vscode it’s just a pity that there is no such seamless integration happening betweencmake
,cmake-tools
,clangd
and vscode.Outside of vscode, I don’t know whether there is a universal solution for this problem, but a good compromise is when
clangd
is working in acmake
environment and that environment has aCMakePresets.json
. That presets file could be used byclangd
to get a lot of info. That’s exactly how Visual Studio for example integratescmake
now…To conclude, I really appreciate what you guys are doing and it’s just so great to have clangd in vscode that I wanted it to be not just great, but perfect 😃
Do developers think about to implement ${command:…} substitution? “cmake.copyCompileCommands” alternative works but having to use it is still uncomfortable.