language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

F2 when used on a tag in `<template>` renames components globally in Nuxt

Open remonke opened this issue 3 months ago • 6 comments

remonke avatar Mar 23 '24 16:03 remonke

I'm not sure if we should handle this case :eyes:

so1ve avatar Apr 08 '24 03:04 so1ve

I mean can't F2 work the same way with regular tags and custom components? I was used to F2 changing the tag on the selected element, not changing the component name globally.

remonke avatar Apr 08 '24 08:04 remonke

Do you mean linked edit?

so1ve avatar Apr 08 '24 08:04 so1ve

Screencast_20240408_105448.webm

Here's what happens when using F2 on a tag. In Nuxt it kinda sucks because the file name is not updated and the codegen stuff freaks out.

remonke avatar Apr 08 '24 09:04 remonke

Just edit them directly, don't use F2.

so1ve avatar Apr 08 '24 09:04 so1ve

Sure, but can you perhaps make this an opt-out feature? Or make it so that it only works when a component is explicitly imported? (without auto-imports it works fine)

remonke avatar Apr 08 '24 09:04 remonke