yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

textDocument/codeLens request hangs on the first file opened

Open rwols opened this issue 4 years ago • 1 comments

Describe the bug

When opening a file and the server starts for that file, it registers the code lens capability dynamically. The Sublime Text client does a textDocument/codeLens request immediately after the registration is complete, but no response is ever received. Subsequent openings from other files do work.

Expected Behavior

The server should respond to the request eventually.

Current Behavior

The server never responds to the request, leaking memory.

Steps to Reproduce

  1. Download ST4
  2. Download LSP package
  3. Download LSP-yaml package
  4. Open a yaml file with a known schema (like a github workflow file)
  5. See that no code lens appears at the top of the file.
  6. Open a similar file.
  7. See that a code lens appears.

Environment

  • [x] Windows
  • [x] Mac
  • [x] Linux

rwols avatar Jul 03 '21 20:07 rwols

@rwols I finally found the time to investigate this, yaml-ls DO return (empty) value for textDocument/codeLens request on first file open, it because JSON schemas not initialised on that time when ST call for codeLens. I thinking to change codeLens to wait on schemas initialisation.

evidolob avatar Nov 08 '21 15:11 evidolob