Skip to content

LSP rename: blockers are workspace-wide, so rename is refused on real projects #519

Closed

Description

@blacktrs

Problem

Workspace::renameBlockers applies two checks to the whole workspace instead of to the files that can contain a use of the symbol:

  • any interpolating heredoc anywhere (vendor code has many) blocks every class, function and member rename;
  • any workspace file with a parse error blocks them as well (vendor syntax the tolerant parser rejects).

Neither corrupts code, but with vendor/ indexed the rename is refused in most real PHP projects.

Proposed fix

Scope both checks by name: only a file whose text contains the symbol name can hide a use of it (case-insensitive substring test), the same needle filter used when searching closed files for member references. Keep the current behaviour for the file under the cursor.

Acceptance

  • A heredoc or a parse error in an unrelated file no longer blocks a rename.
  • A heredoc or parse error in a file that mentions the symbol still blocks it.
  • LSP-level tests for both.

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