bugfix: jsonRepl doesn't correctly default when not present.#93
Closed
yyc wants to merge 2 commits intorioj7:masterfrom
Closed
bugfix: jsonRepl doesn't correctly default when not present.#93yyc wants to merge 2 commits intorioj7:masterfrom
yyc wants to merge 2 commits intorioj7:masterfrom
Conversation
Owner
|
@yyc Your PR is a workaround for the actual bug. The Fixed in v1.65.3 |
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.
Seems like this was a regression introduced in 2146b74
To replicate this bug:
Given
services.txtin my launch.json
{ "id": "pickService", "type": "command", "command": "extension.commandvariable.pickStringRemember", "args": { "key": "service", "description": "Select a service to debug", "fileName": "${workspaceFolder}/.vscode/debug_options/services.txt", "pattern": { "regexp": "^(.+)$", // default "label": "$1" // default } } },the prompt won't show anything. I think this is because the default value of
getProperty(pattern, 'json')here isundefined, and that gets passed around throughdataStructSubstitutionandconvertStringuntil it eventually gets to running this in convertString:classic javascript. And on line
963 -965the condition is
true, and so we try toJSON.parse("undefined")and get a parse error. I think maybe you'll want to catch JSON SyntaxErrors in some way or handle it gracefully? I'll leave that up to you.Trying the same config with
works as expected.