Repository navigation
Conversation
The Variables view removed every " and then every ' from both ends of a string value, and put the rest in double quotes of its own. Quotes that belong to the string were lost: "'test'" was shown as "test", "'" as "", and an escaped quote at the end lost its quote but kept its backslash. A string is now shown in the string color as the debug adapter sends it, with the quotes and escapes of its language, as VS Code shows it. vscode-js-debug's strings keep their single quotes. Fixes redhat-developer#1992
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1994 +/- ##
=======================================
Coverage 48.99% 49.00%
=======================================
Files 812 812
Lines 32963 32958 -5
Branches 5096 5094 -2
=======================================
Hits 16150 16150
Misses 14271 14271
+ Partials 2542 2537 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 17, 2026
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.
@angelozerr, a fix for #1992, which @muescha found and analysed, for 0.30.0. It changes how #814 shows strings for #812: vscode-js-debug's strings now keep their single quotes, as they do in VS Code. If you'd rather keep the old look for some debug adapters, a
DebugAdapterVariableSupportcan still overridegetValuePresentation().The problem
For a variable whose type is
string,formatValue()removed every"and then every'from both ends of the value, andXStringValuePresentationput the rest in double quotes of its own. Quotes that belong to the string were lost:"test""test""test""'test'""test""'test'""'""""'""\"test\"""\"test\""\"test\""'name'(vscode-js-debug)"name"'name'"'name'"(vscode-js-debug, the string'name')"name""'name'"So in #812's example,
name1 = "name"andname3 = "'name'"were both shown as"name".The fix
A string is shown in the string color, exactly as the debug adapter sends it, as VS Code shows it. Only the adapter knows the quotes and escapes of its language, and the Set Value editor (F2) already starts with this text, so the tree and the editor now agree.
formatValue()returns the value unchanged, and the privateremoveQuotes()is gone. Numbers, booleans and other values are shown as before, and a plugin that needs other rules can still overridegetValuePresentation()orformatValue().What users will see:
'name'), as in VS Code.Tests
DebugAdapterVariableSupportTestchecks what the Variables view is asked to render: the strings of #1992 and #812, a typeString, and a number, a boolean and an object. 4 of its 5 tests fail onmain. It and the other DAP variable and descriptor tests pass locally: 71 tests in 13 classes.Fixes #1992