microsoft / microsoft/vscode-json-languageservice

Distinguish between schema value completion types (e.g. enum and default/example values)

Open
#291 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
326
Forks
145
Avg merge
22h 10m
Merged PRs (30d)
9

Description

Currently, the implementation of methods called by JSONCompletion.addSchemaValueCompletions (addEnumValueCompletions, addDefaultValueCompletions and so on) is such that enum and default values (such as examples from a JSON Schema) are indistinguishable because they're conveyed the same way.

From a schema perspective, however, the two are notably different: enums are enforced during validation but default values and examples are not.

Is it possible for these to be distinguished in some manner when generating the completions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/services/jsonCompletion.ts at JSONCompletion.addSchemaValueCompletions and the addEnumValueCompletions and addDefaultValueCompletions methods. Trace how enum, default, and example values are conveyed in generated completions, then define a distinction that preserves their schema meaning and verify the completion results expose it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.