redhat-developer / redhat-developer/yaml-language-server
Implement workspace/textDocumentContent for json schema retrieval in code lenses
Open
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:
- It shows a code lens at the top of a YAML file to view the schema.
- The code lens contains a command (
jumpToSchema). - When the client runs the command with
workspace/executeCommand, yaml-language-server will in turn invokewindow/showDocument. - The document to show has a URI with scheme
json-schema. - 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:
- It shows a code lens at the top of a YAML file to view the schema.
- The code lens contains a command (
jumpToSchema). - When the client runs the command with
workspace/executeCommand, yaml-language-server will in turn invokewindow/showDocument. - The document to show has a URI with scheme
json-schema. - The client sees that yaml-language-server has support for
json-schemaschemes - The client issues a
workspace/textDocumentContentrequest to yaml-language-server - Yaml-language-server returns the content.
- The client displays the content.
Describe alternatives you have considered
N/A
Additional context
N/A
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 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