microsoft / microsoft/vscode-cmake-tools

Add a command for reading cmake environment defined in CMakePresets.json

Open
#3,250 2 comments 0 reactions 0 assignees View on GitHub
enhancement Feature: extensibility
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

vscode-cmake-tools provides command substitution which can be used in VSCode's tasks.json and launch.json, but all those substitutions are predefined variables. I have a custom environment variable defined in CMakePresets.json:
```json

"version": 2,
"configurePresets": [
{
"name": "default",
"environment": {
"MY_ENVIRONMENT_VARIABLE": "Test",
}
}
}
```

I want to refer `MY_ENVIRONMENT_VARIABLE` in tasks.json, but vscode-cmake-tools doesn't have a command for it.

### CMake Tools Diagnostics

_No response_

### Debug Log

_No response_

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the command-substitution support used by tasks.json and launch.json, then inspect how environments from CMakePresets.json are made available. The change is complete when a command can read MY_ENVIRONMENT_VARIABLE from the selected preset and use its value in those VS Code configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript, vscode
Domain
build-system, developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.