redhat-developer / redhat-developer/vscode-yaml
Code completion suggests the same property multiple times
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
When a property is filled dynamically (using if/then/else) based on the value of another property, code completion shows multiple options of the same property (the original blank one and the dynamically chosen filled one)

This behavior does not happen when using the same schema within a json file

Expected Behavior
Only one code completion item should be shown: the updated property based on either the then or else clause
Current Behavior
Multiple code completion items are shown:
- the original empty property
- the updated property based on the active
thenorelseclause
Steps to Reproduce
- download the attatched schema, json, and yaml files: redhat-yaml-issue.zip
- edit settings.json file to include the following lines:
"json.schemas": [
{
"fileMatch": [
"/json.json"
],
"url": "file:///path/to/files/schema.json"
},
"yaml.schemas": {
"file:///path/to/files/schema.json": [
"yaml.yaml"
]
},
- put curser on the line underneath the "enableGrandchild" object
- bring up code completion (ctrl+space on mac)
Environment
- Windows
- Mac
- Linux
- other (please specify)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by downloading the attached redhat-yaml-issue.zip and following the settings.json, schema.json, json.json, and yaml.yaml reproduction steps. Compare completion results for JSON and YAML with the active if/then/else branch. Done means completion offers only the updated property once in the affected YAML case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode, yaml
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100