Skip to content

LSP rename: closed files that changed after startup are not re-read for class, function and constant renames #520

Closed

Description

@blacktrs

Problem

Class, function and constant renames take their sites for closed files from the index built at startup. The per-site check catches an index entry that no longer matches the file, and refuses. It cannot see a reference that was added after startup (git checkout, formatter, external edit), so that site is silently left unrenamed. The server has no workspace/didChangeWatchedFiles or textDocument/didSave handling.

Proposed fix

  • Register file watchers (**/*.php) and re-index changed or created files from disk; remove deleted ones.
  • As a cheap guard until then: compare mtime and size of every closed file with the values recorded at index time before a rename, and refuse (or re-index) on a difference.

Acceptance

  • Rename after adding a reference in an external edit includes the new site, or is refused with a message.
  • Test covers create, modify and delete of a closed file between startup and rename.

Found in the final review of the LSP server (P3).

Activity

  1. added
    bug
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions