Show discoverLayers errors in Problems#164
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves how the extension surfaces DiscoverLayers failures during solution conversion by propagating discovery errors into toolsOutputMessages, enabling them to appear in VS Code’s Problems view (addressing #119).
Changes:
- Update
SolutionConverterImpl.checkDiscoverLayersto return both a success flag and formatted tool error output. - Append
DiscoverLayersfailure messages intotoolsOutputMessagesduring conversion. - Add a unit test validating that
DiscoverLayersfailures are reported viatoolsOutputMessages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/solutions/solution-converter.ts | Capture DiscoverLayers failure messages and include them in conversion output (toolsOutputMessages). |
| src/solutions/solution-converter.test.ts | Add coverage ensuring DiscoverLayers failures propagate to toolsOutputMessages. |
Comments suppressed due to low confidence (1)
src/solutions/solution-converter.ts:257
checkDiscoverLayersalways appends "Discover Layers..." to the output channel, but on failure it never prints the failure reason (result.message) to the output channel. This makes the Output view unhelpful when discovery fails. Consider appending the error details (when!result.success) to the output channel as well, similar toprintErrorsWarnings.
const outputChannel = this.outputChannelProvider.getOrCreate(manifest.CMSIS_SOLUTION_OUTPUT_CHANNEL);
this.solutionManager.getCsolution()?.setVariablesConfigurations(undefined);
// rpc method: DiscoverLayers
outputChannel.append('Discover Layers... ');
const result = await this.cmsisToolboxManager.runCsolutionRpc(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Changes
Improve error handling and reporting in the solution conversion process, specifically focusing on failures during the layer discovery step.
Error handling and reporting improvements:
checkDiscoverLayersmethod inSolutionConverterImplto return both a success flag and an array of error messages, ensuring that any failure messages from layer discovery are captured and formatted for user output. [1] [2]discoverLayersto thetoolsOutputMessagesarray.Testing enhancements:
solution-converter.test.tsto verify that a failure indiscoverLayersresults in an appropriate error message being reported throughtoolsOutputMessages.Screenshots
Checklist