Skip to content

Implement workspace/textDocumentContent for json schema retrieval in code lenses #1324

Description

@rwols

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions