What are people using for editting templates in Polymer 3? I've tried both intelliJ and vscode (along with their respective plugins) and in both cases I get no syntax highlighting or autoplete for content within the backticks of static get template() { return html
}
.
Do I just have things configured incorrectly? What are others using?
What are people using for editting templates in Polymer 3? I've tried both intelliJ and vscode (along with their respective plugins) and in both cases I get no syntax highlighting or autoplete for content within the backticks of static get template() { return html
}
.
Do I just have things configured incorrectly? What are others using?
Share Improve this question asked Jun 7, 2018 at 0:54 Graham CoombeGraham Coombe 601 silver badge7 bronze badges2 Answers
Reset to default 8I use visual studio code and the following extensions to achieve this:
- lit-html
- Template Literal Editor
As a side note I have also found the following extensions to be very helpful when developing polymer apps:
- Import Cost (amazing extension that provides info on the size of your imports)
- Polymer IDE
- Polymer Snippets
- Polymer Syntax
IntelliJ
Regarding the JetBrains family, Language Injections capability handles automatically code assistance inside template literals. This should also work in IntelliJ. If you set up everything correctly (see here) and it still doesn't work, try to manually inject html in you template literals by placing the cursor between the backticks, pressing Alt + Enter and selecting Inject language or reference > HTML.
Note that for web projects you might also consider using WebStorm instead of IntelliJ.
VSCode
VSCode doesn't handle automatically template literals code injection but for your case there are:
- A lit-html syntax highlighting plugin
- A lit-html IntelliSense TypeScript plugin