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

[html] provide rename for embedded JavaScript #31141

Open
abdonrd opened this issue Jul 20, 2017 · 6 comments · May be fixed by #171547
Open

[html] provide rename for embedded JavaScript #31141

abdonrd opened this issue Jul 20, 2017 · 6 comments · May be fixed by #171547
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues javascript JavaScript support issues keep Issues we should not close as out of scope
Milestone

Comments

@abdonrd
Copy link

abdonrd commented Jul 20, 2017

  • VSCode Version: v1.14.1
  • OS Version: macOS Sierra v10.12.6
  • Reproduces without extensions: Yes

Steps to Reproduce:

  1. Create these two files:

my-custom-element.js

class MyCustomElement extends HTMLElement {
  static get is() {
    return 'my-custom-element';
  }
}

customElements.define(MyCustomElement.is, MyCustomElement);

my-custom-element.html

<script>
  class MyCustomElement extends HTMLElement {
    static get is() {
      return 'my-custom-element';
    }
  }

  customElements.define(MyCustomElement.is, MyCustomElement);
</script>
  1. Try the Rename Refactoring with F2 in both files:

screen shot 2017-07-20 at 17 48 44

screen shot 2017-07-20 at 17 48 57

With the same code, the "Rename Refactoring" doesn't work in HTML language.

@vscodebot vscodebot bot added new release html HTML support issues labels Jul 20, 2017
@aeschli aeschli changed the title The "Rename Refactoring" doesn't work in HTML language [html] provide rename for embedded JavaScript Jul 21, 2017
@aeschli aeschli added the feature-request Request for new features or functionality label Jul 21, 2017
@aeschli aeschli added this to the Backlog milestone Jul 21, 2017
@aeschli
Copy link
Contributor

aeschli commented Jul 21, 2017

Rename is currently not provided inside embedded JavaScript. But you can use 'Change occurrences'

@jorgecasar
Copy link

It could be great to have the same behavior inside script tags than we have in JS files. Like this one @abdonrd days and jsdocs comments per example.

@Jammo2000
Copy link

Change occurrences doesn't work, it selects the character pattern in any context, so it ends up renaming a bunch of other things as well.

@Yang09701194
Copy link

Yang09701194 commented Jan 19, 2021

+1 hope this feature can be added, it will be very helpful!

@aeschli
Copy link
Contributor

aeschli commented Jan 21, 2021

We now have rename inside the script of the HTML file: #111644
However, we don't go across files. That's a general limitation of the HTML support which is only single file. #47331 is the main issue for cross file support.

@spazmodius
Copy link

I'm running Version: 1.56.2, but rename in <script> still doesn't work. Do I need to enable it somehow?

@mjbvz mjbvz added the javascript JavaScript support issues label Aug 5, 2022
@johnsoncodehk johnsoncodehk linked a pull request Jan 17, 2023 that will close this issue
35 tasks
@mjbvz mjbvz self-assigned this Feb 9, 2023
johnsoncodehk added a commit to johnsoncodehk/vscode that referenced this issue Jun 23, 2024
@mjbvz mjbvz added help wanted Issues identified as good community contribution opportunities keep Issues we should not close as out of scope labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues javascript JavaScript support issues keep Issues we should not close as out of scope
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants