最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Polymer 3 ide - template editting - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

2 Answers 2

Reset to default 8

I 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
发布评论

评论列表(0)

  1. 暂无评论