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

Implement workspace/textDocumentContent for json schema retrieval in code lenses

Open
#1,324 0 comments 0 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.

Currently, yaml-language-server has functionality that works as follows:

  1. It shows a code lens at the top of a YAML file to view the schema.
  2. The code lens contains a command (jumpToSchema).
  3. When the client runs the command with workspace/executeCommand, yaml-language-server will in turn invoke window/showDocument.
  4. The document to show has a URI with scheme json-schema.
  5. The client has to have some glue code to handle that schema.
Describe the solution you would like

Implement workspace/textDocumentContent from the (new, as of this writing) 3.18 LSP spec. The flow would then look like this:

  1. It shows a code lens at the top of a YAML file to view the schema.
  2. The code lens contains a command (jumpToSchema).
  3. When the client runs the command with workspace/executeCommand, yaml-language-server will in turn invoke window/showDocument.
  4. The document to show has a URI with scheme json-schema.
  5. The client sees that yaml-language-server has support for json-schema schemes
  6. The client issues a workspace/textDocumentContent request to yaml-language-server
  7. Yaml-language-server returns the content.
  8. The client displays the content.
Describe alternatives you have considered

N/A

Additional context

N/A

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

Start by locating the existing code-lens and workspace/executeCommand handling, then review how the language server routes LSP requests. Compare the implementation with the LSP 3.18 workspace/textDocumentContent specification. Done means a client can request content for a json-schema URI and receive the schema content for display.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.