Skip to content

add value completion. - #67

Open
srivastava-diya wants to merge 5 commits into
hyperjump-io:mainfrom
srivastava-diya:value-completion-simple
Open

add value completion.#67
srivastava-diya wants to merge 5 commits into
hyperjump-io:mainfrom
srivastava-diya:value-completion-simple

Conversation

@srivastava-diya

@srivastava-diya srivastava-diya commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

  1. Suggests values for a property based on what its schema allows. Completion.ts is now an orchestrator over two providers PropertyCompletion for keys, ValueCompletion for values and MatchingSchemaCollector is split into AnnotationEvaluationPlugin and CompletionEvaluationPlugin.

  2. What it suggests

  • const / enum → the exact permitted values
  • type → a snippet placeholder per type ("", {}, [], true/false, null, number, integer)
  • both, when a schema permits specific values and anything beyond them, for Eg.
"anyOf": [
  {"enum": ["uri","ipv4","ipv6"]}, 
  {"type": "string"}
] 
  1. Keywords handled
    type enum const not allOf anyOf oneOf if/then/else $ref properties additionalProperties required

  2. There are two paths, and they exist for different reasons:

  • Evaluation hooks observe the validator running, keyed by instance pointer. This covers combinators at the object level, at any nesting depth, including inside array items.
  • resolveValueInfo helper reads a property's own subschema statically, because when we're typing "color": there's no value yet for the validator to go into. That path has to interpret applicator keywords itself, which is why $ref and then/else appear there explicitly.

Out of scope for this PR.

  • Filtering keywords (minLength, pattern, minimum, …) will be a follow-up.
  • Decorations will be seperate PR

Testing

45 value-completion tests (1 skipped) , all asserting the complete response. Value tests are grouped by keyword with comment markers.

Comment thread language-server/src/features/PropertyCompletion.test.ts Outdated
Comment thread language-server/src/features/ValueCompletion.ts Outdated
Comment thread language-server/src/features/ValueCompletion.ts Outdated
@srivastava-diya
srivastava-diya force-pushed the value-completion-simple branch from b37520c to 3d7462f Compare August 17, 2026 20:14
@srivastava-diya
srivastava-diya marked this pull request as ready for review August 17, 2026 20:17
@srivastava-diya srivastava-diya changed the title use completionProvider and seperate value and key completion. add value completion. Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants