fix: apply vocabulary gating to completion, hover, and document symbols - #349
Open
Muhammad Faseeh (Faseeh06) wants to merge 1 commit into
Open
Conversation
JSONDocument.getMatchingSchemas() accepts an optional activeVocabularies parameter that applies 2019-09+ $vocabulary keyword gating. The validation path already threads this through (jsonValidation.ts passes schema.activeVocabularies to jsonDocument.validate(...)), but the other call sites never did, even though ResolvedSchema already exposes the same activeVocabularies field: - jsonCompletion.ts (property completions and value completions) - jsonHover.ts - jsonDocumentSymbols.ts (findDocumentColors) The result: a schema with a custom $vocabulary that disables certain keywords (e.g. properties) correctly excluded those keywords from validation diagnostics, but completion suggestions, hover text, and color/document-symbol extraction still processed them. Passes schema.activeVocabularies through at all four call sites, matching the existing validation convention. Adds a regression test demonstrating that findDocumentColors now respects a meta-schema that omits the applicator vocabulary.
Martin Aeschlimann (aeschli)
approved these changes
Sep 1, 2026
Martin Aeschlimann (aeschli)
enabled auto-merge (squash)
September 1, 2026 09:18
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 #330
JSONDocument.getMatchingSchemas()accepts an optionalactiveVocabulariesparameter that applies 2019-09+$vocabularykeyword gating (viaisKeywordEnabled). The validation path already threads this through (jsonValidation.tspassesschema.activeVocabulariestojsonDocument.validate(...)), but the other four callers ofgetMatchingSchemasnever did, even thoughResolvedSchemaalready exposes the sameactiveVocabulariesfield:jsonCompletion.ts(property completions and value completions)jsonHover.tsjsonDocumentSymbols.ts(findDocumentColors)The result: a schema with a custom
$vocabularythat disables certain keywords (e.g.properties) correctly excludes those keywords from validation diagnostics, but completion suggestions, hover text, and color/document-symbol extraction still processed them — an inconsistency between IntelliSense and validation.Changes
schema.activeVocabulariesthrough at all fourgetMatchingSchemascall sites, matching the existing validation convention.findDocumentColorsnow respects a meta-schema that omits the applicator vocabulary (fails without the fix, passes with it).Test plan
src/test/documentSymbols.test.tsdocumentSymbols,completion,hover,parser,vocabularies— 173 tests) passeslintclean