Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming a component import used with bind:this does not rename correctly #308

Closed
geoffrich opened this issue Jul 15, 2020 · 0 comments
Closed
Assignees
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@geoffrich
Copy link
Member

Describe the bug
When renaming the import of the component, it sometimes renames usages incorrectly (see example below). I have only observed this happening when using bind:this with the renamed component.

To Reproduce
Steps to reproduce the behavior:

Given the following component:

<!-- App.svelte -->
<script>
  import Child from "./Child.svelte";

  let componentRef;
</script>

<main>
  <Child bind:this={componentRef} />
  <Child />
</main>

Using "Rename Symbol" in VSCode on the Child import produces the following:

<!-- App.svelte -->
<script>
  import Child2 from "./Child.svelte";

  let componentRef;
</script>

<main>
  <Child2Child2bind:this={componentRef} />
  <Child2 />
</main>

Expected behavior
The following is produced instead:

<!-- App.svelte -->
<script>
  import Child2 from "./Child.svelte";

  let componentRef;
</script>

<main>
  <Child2 bind:this={componentRef} />
  <Child2 />
</main>

System (please complete the following information):

  • OS: Windows 10
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode 101.2.0
@geoffrich geoffrich added the bug Something isn't working label Jul 15, 2020
@dummdidumm dummdidumm self-assigned this Jul 28, 2020
dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Jul 28, 2020
Don't rename svelte2tsx-internal `__sveltets_instanceOf(TheComponentToRename)`
sveltejs#308
dummdidumm added a commit that referenced this issue Jul 28, 2020
Don't rename svelte2tsx-internal `__sveltets_instanceOf(TheComponentToRename)`
#308
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants