Skip to content

Solution outline: use RPC data#64

Merged
edriouk merged 17 commits into
mainfrom
ImageOnlySolution
Mar 18, 2026
Merged

Solution outline: use RPC data#64
edriouk merged 17 commits into
mainfrom
ImageOnlySolution

Conversation

@edriouk
Copy link
Copy Markdown
Collaborator

@edriouk edriouk commented Mar 13, 2026

Fixes

#32

Changes

Get data from RPC :

  • board info
  • device info
  • context variables to resolve access sequences
    Resolve access sequences in outline view using collected data

Screenshots

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Mar 13, 2026

Qlty

Coverage Impact

⬇️ Merging this pull request will decrease total coverage on main by 0.01%.

Modified Files with Diff Coverage (9)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
...views/solution-outline/tree-structure/solution-outline-tree.ts100.0%
Coverage rating: A Coverage rating: A
.../solution-outline/tree-structure/solution-outline-file-item.ts100.0%
Coverage rating: B Coverage rating: B
...ution-outline/tree-structure/solution-outline-project-items.ts100.0%
Coverage rating: A Coverage rating: A
src/views/solution-outline/solution-outline.ts100.0%
Coverage rating: B Coverage rating: B
src/solutions/solution-rpc-data.ts100.0%
Coverage rating: A Coverage rating: A
...ution-outline/tree-structure/solution-outline-hardware-item.ts100.0%
Coverage rating: B Coverage rating: B
src/solutions/solution-manager.ts66.7%125-147, 217
New file Coverage rating: A
...lution-outline/tree-structure/solution-outline-item-builder.ts100.0%
New file Coverage rating: C
src/solutions/solution-rpc-data.factory.ts71.4%28-34
Total89.7%
🤖 Increase coverage with AI coding...

In the `ImageOnlySolution` branch, add test coverage for this new code:

- `src/solutions/solution-manager.ts` -- Lines 125-147 and 217
- `src/solutions/solution-rpc-data.factory.ts` -- Line 28-34

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@arneschmid
Copy link
Copy Markdown
Collaborator

arneschmid commented Mar 18, 2026

This might also resolve issue #70

@edriouk edriouk marked this pull request as ready for review March 18, 2026 14:23
@edriouk edriouk requested a review from Copilot March 18, 2026 14:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SolutionOutlineItemBuilder base to pass RPC data + context through outline item builders and expand access sequences when building file nodes.
  • Extend SolutionRpcData to 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.

Comment thread src/views/solution-outline/tree-structure/solution-outline-file-item.ts Outdated
Comment thread src/solutions/solution-manager.ts
Comment thread src/solutions/solution-manager.ts
Comment thread src/solutions/solution-manager.ts
Comment thread src/solutions/solution-rpc-data.ts Outdated
Comment thread src/solutions/solution-rpc-data.ts
Comment thread src/views/solution-outline/tree-structure/solution-outline-hardware-item.ts Outdated
edriouk and others added 5 commits March 18, 2026 15:39
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SolutionOutlineItemBuilder base to pass csolution/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.

Comment thread src/solutions/solution-manager.ts
Comment thread test-data/solutions/USBD/CmsisViewTreeRef.txt
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/context via 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 from handleSolutionConvertCompleted(), but conversion can restart the RPC server (restartRpc) specifically to pick up new environment/tool variables. Without refreshing rpcData after conversion, cached context variables used to expand access sequences can become stale until the next full solution reload. Update/refresh rpcData here after a successful conversion (or at least when restartRpc was 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.

Comment thread src/solutions/solution-manager.ts
Comment thread src/solutions/solution-rpc-data.factory.ts Outdated
edriouk and others added 2 commits March 18, 2026 17:35
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@edriouk edriouk requested a review from brondani March 18, 2026 16:36
Copy link
Copy Markdown
Collaborator

@brondani brondani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edriouk edriouk merged commit bf34def into main Mar 18, 2026
12 checks passed
@edriouk edriouk deleted the ImageOnlySolution branch March 18, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants