Switch run generator command to use active target-set and extend diagnostics#337
Switch run generator command to use active target-set and extend diagnostics#337brondani wants to merge 1 commit into
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Files with Diff Coverage (5)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
There was a problem hiding this comment.
Pull request overview
This PR updates the VS Code extension’s Run Generator workflow to prefer the CMSIS Toolbox csolution run active target selection (-a <target-type>[@<target-set>]) instead of passing a build context string (-c), and routes generator output through the existing diagnostics pipeline so generator-related errors/warnings surface in the Problems panel like convert/cbuild.
Changes:
- Switch generator invocation to accept and forward
activeTarget(and keep legacycontextsupport where still provided). - Add a generator-run completion event to the solution event hub and consume it in
SolutionProblemsto produce diagnostics from generator output. - Propagate
activeTargetinto solution-outline “component-gen” nodes and update reference dumps/tests accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test-data/solutions/USBD/CmsisViewTreeRef.txt | Updates reference tree dump output to use activeTarget instead of cbuild-context. |
| test-data/solutions/USBD/CmsisViewTreeOneProjRef.txt | Same as above for the single-project reference dump. |
| src/views/solution-outline/tree-structure/solution-outline-tree.test.ts | Adds tests validating activeTarget attribute population on component-gen nodes. |
| src/views/solution-outline/tree-structure/solution-outline-project-items.ts | Sets activeTarget attribute for generator nodes using active target set or parsed target type. |
| src/tasks/generator/generator-command.ts | Updates generator command dispatch/argument construction and emits generator-run completion for diagnostics. |
| src/tasks/generator/generator-command.test.ts | Extends unit tests to cover activeTarget usage and legacy/combined inputs. |
| src/solutions/solution-problems.ts | Subscribes to generator-run completion and adds generator output to diagnostics. |
| src/solutions/solution-problems.test.ts | Adjusts tests for new subscription count and run-generator diagnostic action payload. |
| src/solutions/solution-event-hub.ts | Adds generator-run completion event + emitter. |
| src/solutions/solution-event-hub.test.ts | Updates subscription-count expectation after adding the new emitter. |
| src/solutions/problem-diagnostic-action-resolver.ts | Changes “run generator” diagnostic actions to use activeTarget and allows optional active target-set provider injection. |
| src/solutions/problem-diagnostic-action-resolver.test.ts | Updates/extends tests to validate activeTarget behavior and target-set precedence. |
| src/desktop/extension.ts | Wires SolutionEventHub into GeneratorCommand construction. |

Fixes
csolution run test.csolution.yml -g myGeneratorreports board not found if a none selected cproject.yml lists a missing pack cmsis-toolbox#619Changes
The Run Generator command previously passed a
contextstring to csolution run via-c. This change passes the active<target-type>[@<target-set>]with the-aflag instead. This aligns with the csolution CLI's preferred way of addressing context selection by active target.In addition, generator run output is now routed through the diagnostic pipeline so that any csolution error/ warning lines appear in the Problems panel — consistent with convert and cbuild output.
activeTarget?: stringtoRunGeneratorRequestinterfaceactiveTargetparametergetActiveTargetSetNameconstructor parameterScreenshots
Checklist