Skip to content

Conversation

jasonlyu123
Copy link
Member

@jasonlyu123 jasonlyu123 commented Feb 17, 2023

Found this while figuring out #1863

If you trigger the rename in the shorthand of ComponentB in ComponentA, we'll check the props rename for ComponentA. And if they have the same name, for example

<script>
import ComponentB from './ComponentB.svelte'
export let name;
</script>

<ComponentB {name} /> <!--trigger here in {name} -->

Because there might be two edits to the exact shorthand location. It sometimes became name={name} and sometimes became na={nameme}.

I also fixed a problem when the rename is triggered in export let without type annotation or default. Rename won't update props usage. This is done in the same PR because this problem prevents the main issue from happening. Thus the added test won't fail even without the fix.

<script>
import ComponentB from './ComponentB.svelte'
export let name; // trigger here
</script>

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@dummdidumm dummdidumm merged commit e3ccd7d into sveltejs:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants