redhat-developer / redhat-developer/yaml-language-server

Provide completion for array elements

Open
#604 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
352
Avg merge
2d 7h
Merged PRs (30d)
11

Description

Is your enhancement related to a problem? Please describe.

When a schema is defining that the top-level element is an array, there is no completion proposed initially. it seemed like the schema is not recognized.
When an element has array as child, and that completion was not used previously, the user has no ompletion provided and cannot know that an array is expected (so that a - must be inserted). So in fact, it is not only for top-lebvel arrays but for all arrays.

Describe the solution you would like

provide completion for an "Array", so basically a -.
if possible, or maybe for a second iteration, provide all sub-elements but preceded by a -

For instance Camel Yaml DSL,

# yaml-language-server: $schema=https://raw.githubusercontent.com/apache/camel/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/camel-yaml-dsl.json

completion on new line should propose - or in a second iteration: - beans, - from , - rest and more.

Describe alternatives you have considered
Additional context

Contributor guide

Open the contributing guide

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

The issue names no implementation files or tests; start by locating the schema-driven completion entry point for array-valued nodes and the existing completion tests. Done means a new line under an array schema offers -; nested item completion is described as a possible second iteration.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.