-
-
Notifications
You must be signed in to change notification settings - Fork 223
Description
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) 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.
