microsoft / microsoft/language-server-protocol

Clarify server's behaviour around virtual (not stored on disk) documents

Open
#1,369 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clarification document synchronization
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

The documentation of the textDocument/didOpen notification doesn't explicitly state that the document can be virtual, or whether the contents passed with the text field have to match the contents on-disk if not virtual.

It also doesn't make any assertions about whether or when the notification will be processed, or what the server will do with virtual documents (does the server have to treat them the same as on-disk documents for the purposes of completion requests, for example?)

Edit I suppose it makes sense for server implementors to make sure they process didOpen notifications before subsequent requests, so they should be processed in time as long as they're received in order. I'm still having issues with completion requests coming back empty with URIs like virtual:///path/to/file.js-123 though (where file:///path/to/file.js is an actual file on disk, and the same completion request sequence works fine if that's given as the URI).

Contributor guide

No contributing guide indexed for this repository

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 with the documentation for the textDocument/didOpen notification and trace how its wording addresses virtual documents and the text field. Review the reported completion requests using virtual:/// URIs, then clarify processing order and the expected treatment of virtual documents; done means the specification answers these cases explicitly.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.