Skip to content

Linked edits on html in .php files not working #111

@SaintFrans

Description

@SaintFrans

Linked edits (rename on type for matching HTML tags) do not work when editing HTML markup inside .php files. When renaming an opening or closing HTML tag, the counterpart tag is not updated simultaneously.

This feature works as expected in .html files, but fails in .php files even when the cursor is within a purely HTML context (e.g., not inside a PHP block).

Steps to Reproduce

  1. Enable Linked edits option in settings
  2. Open a .php file containing HTML markup
  3. Place the cursor on an HTML opening tag (e.g., <div>)
  4. Edit the tag name
  5. Expected: the matching closing tag (</div>) updates in sync
  6. Actual: only the edited tag changes — the counterpart is not updated

Expected Behavior

Linked editing should work for HTML tags within .php files, consistent with behavior in .html files.

Possible Cause

The PHP language extension may not be registering linked edit range support for embedded HTML regions. The language server or Tree-sitter grammar may need to surface linkedEditingRange for HTML nodes within the PHP syntax tree.

Environment

  • Zed version: 0.226.4
  • OS: macOS
  • PHP extension version: 0.4.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions