how do i get eclipse to interpret .ejs files as .html?

倾然丶 夕夏残阳落幕 提交于 2019-12-21 03:27:25

问题


i recently started on a node project and two of the modules i'm using is express and EJS. but default i usually use eclipse as my IDE, it works well for java and decent for html and javascript. but one problem i'm having is that for .ejs files i get no markup color coding, or any form of code completion. it's basically just a plain file.

does anyone know how i can get eclipse to interpret .ejs files as .html files? i figure it's pretty similar except for the occasional embed tags. or a recommendation for an IDE more well suited to node.js/html/ejs development.

thanks!


回答1:


For a specific file, try right-click, Open With -> Other... -> HTML editor. You can also set the file association globally under Window -> Preferences -> General -> Editors -> File Associations.

On a Mac, the global setting is under Mac Option -> Preferences and all the same options.




回答2:


As an addendum to rlegendi's answer, if you'd also like the proper html coloring, you need to go to "Content Types" (right above "Editors" in the Preferences). From here, select Text -> HTML and click on "Add..", including .ejs




回答3:


For me, the best way has been:

Windows > Preferences > General > Content types

In window Content types i've selected Text > HTML

and window File associations click Add... and i've included *.ejs



来源:https://stackoverflow.com/questions/11035329/how-do-i-get-eclipse-to-interpret-ejs-files-as-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!