vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[linked rename] Linked Editing does't work well

Open DevinJohw opened this issue 1 year ago • 17 comments

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.87.2
  • OS Version: macOS 14.3.1 (23D60)

Steps to Reproduce:

  1. set up the linked editing option as true
  2. crate an HTML tag with one or two attributes, like <div class="main"></div>
  3. modify the name of the tag on the opening tag, you would find out that the closing tag is automatically deleted while not added automatically. 2024-03-21 13 06 27

DevinJohw avatar Mar 21 '24 05:03 DevinJohw

/needsMoreInfo

gjsjohnmurray avatar Mar 21 '24 05:03 gjsjohnmurray

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

vscodenpa avatar Mar 21 '24 05:03 vscodenpa

/needsMoreInfo

Sorry, I just misclicked the post button.

DevinJohw avatar Mar 21 '24 05:03 DevinJohw

/causedByExtension

gjsjohnmurray avatar Mar 21 '24 05:03 gjsjohnmurray

/causedByExtension

Sorry for my misunderstood, It's indeed an issue. If there are some attributes in the opening tag, you can't delete the entire name, then change it to another one, like this. 2024-03-21 13 51 32

If you delete part of the name, it wokrs. 2024-03-21 13 49 37 If there is no attributes in the opening tags, it works perfectly whether deleting the entire name or part of the name. 2024-03-21 13 53 10 2024-03-21 13 53 30

DevinJohw avatar Mar 21 '24 05:03 DevinJohw

@aeschli is this your area? If not, please redirect. It also needs two labels removing.

gjsjohnmurray avatar Mar 21 '24 07:03 gjsjohnmurray

+1 Experiencing this (annoying) issue as well.

bobslee avatar Jun 02 '24 08:06 bobslee

Sometimes if I type too fast, the tag on the other side couldn't catch up, and stops updating half-way.

mrcaidev avatar Jun 12 '24 03:06 mrcaidev

Facing this exact same issue as well

dantgw avatar Jun 18 '24 02:06 dantgw

Still happening on VSCode 1.92.2.

angelhdzmultimedia avatar Aug 15 '24 21:08 angelhdzmultimedia

same here

dennmtr avatar Sep 15 '24 08:09 dennmtr

Sometimes if I type too fast, the tag on the other side couldn't catch up, and stops updating half-way.

The same problem. It appears that at this point the only way to ensure predictable behavior is to disable this setting.

plashenkov avatar Oct 06 '24 19:10 plashenkov

This problem has nothing to do with extensions. I just did a bisect and even without any extensions enabled this bug still occures.

alexvoedi avatar Oct 08 '24 08:10 alexvoedi

https://github.com/user-attachments/assets/24507368-a003-4343-810b-a12652278f3c

21-10-2024 issue persists. I have found a workaround, you have to select the tag name and then instead of clearing the name, start writing the new one.

JakubStasiak00 avatar Oct 21 '24 20:10 JakubStasiak00

Duplicate of #185279

LucasOe avatar Dec 01 '24 12:12 LucasOe

just experienced this now and found this issue. very annoying

cyb456 avatar Feb 07 '25 14:02 cyb456

Image

vscode team tried to replace a third party plugin and this is the result. LOL.

babakfp avatar Mar 07 '25 22:03 babakfp

I think I found a solution for this problem.

Because of the very unstable reproducability of this issue, it seems to be some kind of race condition that is causing this. After removing this line https://github.com/microsoft/vscode/blob/main/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts#L304 it worked great and I was not able to desync the tags anymore, no matter how fast or slow I type.

I will create a PR for this. Maybe someone else can do some further testing.

As a small bonus, the highlighted sync range will stop flickering when typing.

alexvoedi avatar Mar 09 '25 10:03 alexvoedi

I think I found a solution for this problem.

Because of the very unstable reproducability of this issue, it seems to be some kind of race condition that is causing this. After removing this line https://github.com/microsoft/vscode/blob/main/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.ts#L304 it worked great and I was not able to desync the tags anymore, no matter how fast or slow I type.

I will create a PR for this. Maybe someone else can do some further testing.

As a small bonus, the highlighted sync range will stop flickering when typing.

This looks like a good fix, otherwise this feature is unusable. The tags "desync" from typing too fast, and also when the tag name is removed entirely.

FireMakeThunder avatar May 02 '25 00:05 FireMakeThunder

Fixed by #242993

aeschli avatar Sep 01 '25 21:09 aeschli

I still see the exact same behaviour as https://github.com/microsoft/vscode/issues/208276#issuecomment-2011273196.

rzhao271 avatar Sep 02 '25 22:09 rzhao271

If someone wants to look into a PR...

aeschli avatar Sep 03 '25 19:09 aeschli