question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[html] provide rename for embedded JavaScript

See original GitHub issue
  • 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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:14
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jorgecasarcommented, Aug 4, 2017

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.

2reactions
aeschlicommented, Jul 21, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using javascript to rename multiple HTML files using the ...
Using javascript to rename multiple HTML files using the <TITLE></TITLE> in each file ; in short you have a list of urls and...
Read more >
Do not rename .gs files to .js before pushing · Issue #51 - GitHub
a file named: Code.gs is renamed to Code.js. The project files should not be changed by the pushing operation. Any preparation to the...
Read more >
VS Code: You don't need that extension - Rob O'Leary
1. Auto renaming HTML tags. Rename HTML tag pairs with a single edit. rename tag pairs. Auto-renaming is currently supported in HTML files ......
Read more >
Refactoring JavaScript | WebStorm Documentation - JetBrains
To open the Rename dialog by default, open the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code editing, and select the...
Read more >
HTML input name Attribute - W3Schools
The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted. Note: Only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found