Skip to content

feat(language-service): Add Linked Editing Ranges for HTML tag synchronization #66736

@kbrilla

Description

@kbrilla

Feature Request

Description

Add support for Linked Editing Ranges (LSP 3.16) in the Angular Language Service to enable synchronized editing of opening and closing HTML tag pairs.

Use Case

When editing HTML templates in Angular, developers often need to rename elements. Currently, renaming a tag requires manually updating both the opening and closing tags, which is error-prone and time-consuming.

With Linked Editing Ranges, when the cursor is on an element tag name:

  • Both opening and closing tags are highlighted
  • Typing changes both tags simultaneously
  • Prevents mismatched tag errors

Example

<div class="container">
  <span>Content</span>
</div>

When the cursor is on div, typing section updates both opening and closing tags to <section>...</section>.

Technical Details

  • LSP method: textDocument/linkedEditingRange
  • Supported in VS Code since 1.51
  • Works with both external HTML templates and inline templates in TypeScript files

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: language-serviceIssues related to Angular's VS Code language service

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions