microsoft / microsoft/vscode-languageserver-node

`textDocument/didClose` and `textDocument/didOpen` not fired on file rename changing case

Open
#1,186 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
1.8k
Forks
404
Avg merge
2d 8h
Merged PRs (30d)
14

Description

The specification states that

Document renames should be signaled to a server sending a document close notification with the document’s old name followed by an open notification using the document’s new name

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_didRename

When a file is renamed to the same content but a change of case (e.g. foo.txt -> Foo.txt), these events do not get fired.
This causes a loss of synchronisation between the client and the server

Steps:

  1. Create a dummy language server (e.g. from https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample)
  2. Enable trace logging (either messages or verbose)
  3. Create a new file foo.txt and open it: observe a textDocument/didOpen request
  4. Rename the file to Foo.txt.
    Expected: a didClose and then a didOpen request.
    Actual: nothing

Client + Server version: 8.0.2
On Windows

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

Reproduce the case-only rename on Windows using the lsp-sample language server with verbose trace logging, checking the textDocument/didOpen and textDocument/didClose notifications. Trace the rename handling in this repository and ensure the expected close-then-open sequence is emitted for a case change, then verify the trace shows both events.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.