Skip to content

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

@JohnnyMorganz

Description

@JohnnyMorganz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions