You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In VSCode (v 1.75.0), using "Rename Symbol":
When a parent passes a prop, say {sameNameProp} to a child component (e.g. Child) with export let sameNameProp, and that child renames their symbol, to say otherNameProp, then VSCode will rename the prop reference in the parent as well.
Unfortunately, this currently results in: <Child {otherNameProp}>, but the parent still only defines sameNameProp, causing a breakage.
Proposed solution
When renaming a prop whose references include abbreviations, automatically expand the abbreviations. In the example case, the parent's code should have become:
<Child otherNameProp={sameNameProp} />
Alternatives
On the other hand, this could be intended behavior which forces the developer to think about renaming props. Possible alternatives:
Instead of changing "Rename Symbol" behavior, add an action to the Svelte extension so developers can choose to compatibly rename props or not.
Add the action, but allow an option somewhere to set the default behavior of "Rename Symbol".
(Assuming the current behavior is intended/desirable): Add documentation about it.
Additional Information, eg. Screenshots
The text was updated successfully, but these errors were encountered:
We already have this mechanism. This might be a bug in some edge cases. What is the version of the Svelte for VSCode you're using? Can you provide a more detailed reproduction and specify where did you trigger rename?
Description
(New to Svelte, sorry if already answered)
In VSCode (v 1.75.0), using "Rename Symbol":
When a parent passes a prop, say
{sameNameProp}
to a child component (e.g.Child
) withexport let sameNameProp
, and that child renames their symbol, to sayotherNameProp
, then VSCode will rename the prop reference in the parent as well.Unfortunately, this currently results in:
<Child {otherNameProp}>
, but the parent still only definessameNameProp
, causing a breakage.Proposed solution
When renaming a prop whose references include abbreviations, automatically expand the abbreviations. In the example case, the parent's code should have become:
<Child otherNameProp={sameNameProp} />
Alternatives
On the other hand, this could be intended behavior which forces the developer to think about renaming props. Possible alternatives:
Additional Information, eg. Screenshots
The text was updated successfully, but these errors were encountered: