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

Improve performance by avoiding parsing YAML document text

Open
#213 1 comment 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

The YAML LS server parse every time the text document for each support (parseYAML is called for each completion, hover, etc).

For instance if you open completion and you do 3 hovers, you will have 4 call of parseYAML although 1 should be done.

To do that the YAML LS should store the YAMLDocument (result of parse) in a cache).

vscode json language server does that https://github.com/vscode-langservers/vscode-json-languageserver/blob/1a3406de0e7d9f57f73c75bb225b0cf88e4f0fa9/src/jsonServerMain.ts#L396

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 tracing the parseYAML call sites used by completion, hover, and other supports, then compare the caching approach in the referenced vscode JSON language server entry point. Done means the YAMLDocument result is reused so repeated supports do not parse the same text again, while completion and hover still work correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
performance, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.