Update check on debug config generation fail #30
Merged
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.
When sketch debugging is initiated, the extension runs Arduino CLI to get the debugger configuration information. This information is required to generate the
launch.json
configuration file.As part of this information is the path to the compiled sketch binary, Arduino CLI checks for the existence of that file, and errors if it is not present (which is usually caused by the user having neglected to compile the sketch):
The extension has special handling for this specific common error cause, which is based on a fragile string comparison on the human readable error message. As is the nature of such an approach, a seemingly innocuous capitalization change to the message in the Arduino CLI code base (arduino/arduino-cli@75b9760) broke the check.
The quick fix provided here is making the check case insensitive.
NOTE: this is not a true fix. The human readable error message string may change at any time, and is guaranteed to change if non-English localization is enabled.
However, it is less broken after this simple change, and the check is not critical, so I think it is still worthwhile.