zed icon indicating copy to clipboard operation
zed copied to clipboard

Tags Auto-Rename

Open JosephTLyons opened this issue 2 years ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the feature

Add a setting that allows linked editing of related symbols, such as HTML tags.

The request comes from this discussion post.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

JosephTLyons avatar Aug 13 '23 19:08 JosephTLyons

+1 👍 to this issue! It's the one feature stopping me from using Zed - more than happy to try and learn Rust and whip up a plugin ~once Zed becomes extensible though!~ it's game time

sohcfst avatar Feb 28 '24 14:02 sohcfst

I've looked into this following https://x.com/iangrayhazzard/status/1792720672701268178 and it seems like we just don't do renaming for HTML language server? VSCode sends out a request for rename according to LSP spec whereas we do.. nothing. Triggering "Rename Symbol" on HTML tag does nothing; no communication from our side to the server, nada, null. I'll look into why that is. I suspect that the "linked editing" bit comes from language server itself.

Then, for linked editing itself we probably need to implement support for https://docs.rs/lsp-types/latest/lsp_types/request/enum.LinkedEditingRange.html

osiewicz avatar May 21 '24 14:05 osiewicz

Is there a way to disable this in settings? It's causing some minor issues for me. One it adds a space to the closing tag if you go to add attributes on the opening tag. Plus I'm so accustomed to using multi-cursor for this that I end up causing this feature to duplicate every keystroke.

corneliusio avatar Jun 22 '24 19:06 corneliusio

@corneliusio Sure, you can disable it with:

"languages": {
  "language-you-want-to-disable-linked-editing-for":
    {
      "linked_edits": false
    }
}

osiewicz avatar Jun 23 '24 10:06 osiewicz

@osiewicz 🙏🏼 Thank you!

corneliusio avatar Jun 24 '24 00:06 corneliusio