Repository navigation
Keep dollar expressions literal in plaintext schema hovers - #409
Merged
1 commit merged intoNov 23, 2026
Merged
1 commit merged into
1 commit merged into
Conversation
230893f
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.
Summary
Fixes #265.
Plain schema descriptions containing
$(...)can be rendered as theme icons instead of literal text in VS Code. Escaping Markdown parentheses is insufficient because the Markdown parser removes those escapes before VS Code's subsequent icon rewrite.Encode dollar signs as
$while converting plaintext schema metadata to Markdown. This preserves the displayed dollar sign but keeps icon-like text out of the intermediate HTML processed by the icon renderer. The existing converter already emits HTML character references for whitespace.The fix applies to
title,description, andenumDescriptions. ExplicitmarkdownDescriptionandmarkdownEnumDescriptionsremain untouched, including intentional icon syntax and formatting. No public API or dependency changes.Rendering-order reference: VS Code's Markdown renderer.
Tests
Added 20 tests covering literal icon-like expressions, modified icon names, non-icon dollar expressions, currency,
$schema, existing backslashes, and authored Markdown controls. Each plaintext case checks both property-key and property-value hovers. Before the fix, 18 plaintext cases failed and the two Markdown controls passed.Validation:
npm test: 5,465 tests passing, no skips or failures; compilation and all nine lint checks also pass.git diff --check: passed.The rendering checks exercised Markdown parsing and DOM text, not a full interactive VS Code hover or its complete renderer/sanitizer stack.
AI Assistance
Developed with assistance from OpenAI Codex, including implementation and local test/rendering verification.