Solution outline: use RPC data#64
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 (9) 🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
|
This might also resolve issue #70 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Solution Outline view to resolve access sequences (e.g. $OutDir()$) by sourcing board/device/context-variable data from the JSON-RPC layer, addressing issue #32 where unresolved access sequences were used for files shown in the outline.
Changes:
- Add a shared
SolutionOutlineItemBuilderbase to pass RPC data + context through outline item builders and expand access sequences when building file nodes. - Extend
SolutionRpcDatato cache variables per context and seed these in tests; update SolutionManager/OutlineView to expose and consume RPC data. - Update test-data and outline reference dumps to validate access-sequence resolution behavior.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test-data/solutions/USBD/HID/HID.cproject.yml | Adds a test group containing file paths with access sequences/unknown vars. |
| test-data/solutions/USBD/CmsisViewTreeRef.txt | Updates expected outline tree snapshot to include resolved access-sequence paths. |
| src/views/solution-outline/tree-structure/solution-outline-tree.ts | Refactors tree building to use shared builder base and inject RPC/context. |
| src/views/solution-outline/tree-structure/solution-outline-tree.test.ts | Seeds RPC variables and updates tree creation calls to match new API. |
| src/views/solution-outline/tree-structure/solution-outline-project-items.ts | Passes RPC/context through to file node creation for access-sequence expansion. |
| src/views/solution-outline/tree-structure/solution-outline-item-builder.ts | New base class providing access-sequence expansion helper. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.ts | Renames/refactors hardware item builder to align with shared builder approach. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.test.ts | Updates tests for renamed builder and constructor changes. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.ts | Expands access sequences when resolving resource paths for file nodes. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.test.ts | Updates tests for renamed file item builder. |
| src/views/solution-outline/solution-outline.ts | Instantiates outline tree with SolutionManager-provided CSolution + RPC data. |
| src/views/solution-outline/commands/delete-command.test.ts | Updates expectations due to added access-sequence test group/files. |
| src/solutions/solution-rpc-data.ts | Extends RPC data caching with context variables and variable expansion. |
| src/solutions/solution-rpc-data.factory.ts | Adds a mock/factory for seeding RPC data in tests. |
| src/solutions/solution-manager.ts | Exposes RPC data and adjusts load/convert flow to update RPC cache. |
| src/solutions/solution-manager.factories.ts | Updates SolutionManager test factory to provide mocked RPC data. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the Solution Outline (CMSIS View) tree-building logic to use cached JSON-RPC data (board/device info + context variables) so access sequences (e.g. $OutDir()$) can be resolved when computing file paths shown/opened in the outline, addressing issue #32.
Changes:
- Introduces a shared
SolutionOutlineItemBuilderbase to passcsolution/RPC data/context through outline builders and expand access sequences. - Updates file/project/hardware outline node builders to use RPC-expanded paths for
resourcePath(so file open/hover resolves correctly). - Extends test data and outline snapshot refs to cover access-sequence cases and adds an RPC-data mock/factory for tests.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test-data/solutions/USBD/HID/HID.cproject.yml | Adds groups/files that include access-sequence patterns for regression coverage. |
| test-data/solutions/USBD/CmsisViewTreeRef.txt | Updates expected outline snapshot to include the new access-sequence test group/files. |
| src/views/solution-outline/tree-structure/solution-outline-tree.ts | Refactors tree builder to carry RPC data/context into project + hardware builders. |
| src/views/solution-outline/tree-structure/solution-outline-tree.test.ts | Seeds RPC variables and updates tests to validate access-sequence resolution in the outline dump. |
| src/views/solution-outline/tree-structure/solution-outline-project-items.ts | Passes context/RPC through file-node creation so paths can be expanded per context. |
| src/views/solution-outline/tree-structure/solution-outline-item-builder.ts | New base class to share csolution/RPC/context and provide access-sequence expansion. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.ts | Renames/refactors hardware node builder and aligns node creation to tag-based children. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.test.ts | Updates tests for the renamed/refactored hardware builder. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.ts | Expands access sequences when computing resourcePath for files in the outline. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.test.ts | Updates tests to use the renamed/refactored file builder. |
| src/views/solution-outline/solution-outline.ts | Instantiates the outline tree builder with the SolutionManager’s csolution and RPC cache. |
| src/views/solution-outline/commands/delete-command.test.ts | Adjusts expectations to account for the added access-sequence files in test data. |
| src/solutions/solution-rpc-data.ts | Extends RPC cache API to expose variables per context and adjusts variable parsing. |
| src/solutions/solution-rpc-data.factory.ts | Adds a mockable RPC-data implementation for tests with seed helpers. |
| src/solutions/solution-manager.ts | Exposes RPC cache from SolutionManager and updates load/refresh flow to update RPC data on load. |
| src/solutions/solution-manager.factories.ts | Extends SolutionManager test factory to include RPC-data mock. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR updates the Solution Outline (CMSIS View) to resolve access sequences (e.g. $OutDir()$, $Dname$) by using context variables fetched via the JSON-RPC layer, addressing issue #32.
Changes:
- Cache board/device + per-context variables from RPC and use them to expand access sequences in outline file paths.
- Refactor outline tree builders to share
csolution/rpcData/contextvia a common base (SolutionOutlineItemBuilder). - Update/extend test-data + unit tests to cover access-sequence resolution in the outline and related commands.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test-data/solutions/USBD/HID/HID.cproject.yml | Adds an access-sequence test group/files to golden test project. |
| test-data/solutions/USBD/CmsisViewTreeRef.txt | Updates expected outline dump to include resolved resource paths for access-sequence files. |
| src/views/solution-outline/tree-structure/solution-outline-tree.ts | Passes RPC data into outline builders and removes createTree(csolution) parameter in favor of constructor injection. |
| src/views/solution-outline/tree-structure/solution-outline-tree.test.ts | Seeds RPC variables and updates tests for the new constructor-based tree builder + access-sequence resolution. |
| src/views/solution-outline/tree-structure/solution-outline-project-items.ts | Threads context + RPC data into file-node creation and standardizes node tags (e.g. createChild('group')). |
| src/views/solution-outline/tree-structure/solution-outline-item-builder.ts | New shared base class that expands access sequences via rpcData.expandString. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.ts | Refactors to a builder class consistent with the new shared base. |
| src/views/solution-outline/tree-structure/solution-outline-hardware-item.test.ts | Updates tests for renamed/refactored hardware builder. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.ts | Expands access sequences when deriving resourcePath for file nodes. |
| src/views/solution-outline/tree-structure/solution-outline-file-item.test.ts | Updates tests for FileItemBuilder. |
| src/views/solution-outline/solution-outline.ts | Instantiates SolutionOutlineTree with SolutionManager.getCsolution() + getRpcData(). |
| src/views/solution-outline/commands/delete-command.test.ts | Updates expectations to include the new access-sequence test group/file. |
| src/solutions/solution-rpc-data.ts | Extends RPC cache with getVariables() and adapts variable parsing to updated RPC types. |
| src/solutions/solution-rpc-data.factory.ts | Adds a mock/factory to seed RPC variables in tests. |
| src/solutions/solution-manager.ts | Exposes getRpcData() and updates RPC data during loadSolution(). |
| src/solutions/solution-manager.factories.ts | Updates mock SolutionManager factory to provide RPC data. |
Comments suppressed due to low confidence (1)
src/solutions/solution-manager.ts:249
rpcData.update()was removed fromhandleSolutionConvertCompleted(), but conversion can restart the RPC server (restartRpc) specifically to pick up new environment/tool variables. Without refreshingrpcDataafter conversion, cached context variables used to expand access sequences can become stale until the next full solution reload. Update/refreshrpcDatahere after a successful conversion (or at least whenrestartRpcwas requested) so the outline uses the post-convert variable set.
private async handleSolutionConvertCompleted(data: ConvertResultData) {
if (!this.csolution) {
return;
}
await this.loadSolutionBuildFiles();
if (data.severity != 'error') {
await this.commandsProvider.executeCommandIfRegistered(UPDATE_DEBUG_TASKS_COMMAND_ID);
}
this.loadBuildFilesEmitter.fire([data.severity, data.detection]);
this.updatedCompileCommandsEmitter.fire();
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Fixes
#32
Changes
Get data from RPC :
Resolve access sequences in outline view using collected data
Screenshots
Checklist