Is there a mustache template syntax highlighter or plugin for Eclipse? - eclipse

I'm looking for a Mustache template syntax highlighter / plugin in Eclipse
Does one exist? I don't seem to be finding anything on google, and I don't know how to write my own for Eclipse.

Although not perfect, you can use Eclipse and set MUSTACHE template files to HTML.
Go to Eclipse->Preferences->General->Content_Types
Edit CONTENT_TYPE to add a file association of .mustache
Go to Eclipse->Preferences->General->Editor->File_Associations
You should see the default HTML editors already set. If not, add a .mustache editor of your choice. I used HTML_EDITOR.
Although it won't syntax highlight the {{ }}, it's still easier to read.

There doesn't seem to be any plugin for supporting mustache Editors and views (see Eclipse MarketPlace).
That leaves only for now using an external supported editor (i.e. outside of Eclipse)

Related

How to add Syntax highlighting for .Vue files in Eclipse

I just want to ask if you know how to add syntax highlighting for vue files using vue-loader. I'm using Eclipse Neon
vue is mostly tags and javascript so treating it as a HTML file would be fair enough. That can be set in eclipse for *.vue under HTML in content type.
There is a plugin in the Marketplace that might be what you're looking for. It's called CodeMix CI 1. I just installed it and aside from adding syntax highlighting, it also does code completion, which comes really handy.

IntelliJ Idea Play framework Twirl template formatting settings?

I'm pretty happy to use the IntelliJ Idea Ultimate 2016 as my primary IDE for Play Framework based projects (together with Scala), but I'm not happy with some default settings how Idea formats the Play's Twirl template files (e.g. indent size, comment formatting). However, I'm unable to find Twirl formatting settings anywhere in Idea prefs. Is the Twirl formatting setting page really missing in the IDE?
Thanks.
I had been looking for the solution too. And I have finally found its indent settings.
It is Editor > Code Style > Other File Types.
I don't know comment formatting settings.
Thanks.

In the Eclipse HTML editor, is there an easy way to have custom tags available in content assist (autocomplete)?

I'm learning to use a new hosted e-commerce system at work which uses a proprietary markup/scripting language for its page templates. They are similar to JSP pages (although the server tags don't have a prefix, i.e. there is no "xsp:") and use ${expressions} similar to Expression Language. We are transitioning from a .Net system, so all of my fellow devs are very used to having thorough IntelliSense available in our editors.
So, my question is whether it is possible to make these custom tags available in content assist, and whether it is worth the hassle if there is any. (I'm aware the latter is subjective - I'm a reasonable guy and open to opinions.)
FYI, I'm more concerned with auto-completion of tags, but expressions would be great as well depending on how much work is involved. We are using eclipse for Java EE, Juno (core IDE v4.2.1) with WTP... Sorry I'm not really sure how or what to share as far as versions and components go! Let me know if any additional info would help.
Thanks in advance.
A decidedly non-hassle-free answer would be to create an Eclipse plug-in to support your proprietary template language. One place to start might be Veloeclipse, a HTML/XML/JSP/Velocity Editor for Eclipse, which claims to have the following features which you may find interesting:
Smart indentation of velocity directives (on pressing return or when using tabs)
Code folding
Code Formatting
Smart indentation of html tags (on pressing return or when using tabs)
Syntax highlighting for both html and velocity
Autocompletion and Content assist for tags, directives and references (Ctrl + space in html attribute values or when opening or closing tags)
Sources here: http://code.google.com/p/veloeclipse/source/checkout

how to add my own templates to eclipse in play! framework editor

I've noticed that the play plugin for eclipse adds a play editor,
along with several useful templates
I'd like to add my own ones, but I couldn't find the way to do it
I go to window, preferences, web, html files, templates and I can add
templates to eclipse html editor, but I couldn't find a similar option
for play editor
Check out the source code for the play plugin :
https://github.com/playframework/playclipse/tree/master/source/templates
You might want to fork it and add your templates to that file. That is what I would do. But I do not have enough Eclipse development knowledge to help you further than point the direction.
I had a lok at the source, it seems like the template editor tags are defined here
https://github.com/playframework/playclipse/blob/master/source/src/org/playframework/playclipse/editors/html/HTMLEditor.java
looks like there's no support for creating your own templates thru eclipse...

Is There Mustache Syntax Highlighter Or Plugin For NetBeans?

There are such thing as Mustache. I'm using NetBeans and I need to edit .mustache files. The problem is that when I open it using NetBeans, syntax is just like for plain text.
1) Is it possible to have HTML-like syntax for .mustache files?
2) Is there any plugin that allows to work easier with Mustache? I have found only this tutorial.
If creating your own plugin is to hard, you might be already content if mustache templates are displayed as (normal) HTML instead of plain text.
This can be configured in Options > Miscellaneous > Files. Create a 'New' file extension named 'mustache'. Than select 'HTML Files (text/html)' as associated file type.
It seemes that the way described at the link you've posted is
only way: write your own plugin for netbeans (it's quite difficult task)
1) Follow http://wiki.netbeans.org/SyntaxColoringANTLR
2) But the more difficult thing is to implement your language definition as an embedded one.
It's needed if you want to highlight mustache template tags inside other language files (html, xhtml)
In older versions of NetBeans was a really simple api and module (it cannot be itegrated with all the platform services, like refactoring and so on) but it was based on grammar definition (BNF or something like that) and color scheme for tokens.
I think better is to open this files as text/x-twig.