How do I turn on syntax highlighting for StringTemplate templates (*.st) in intellij? - intellij-idea

I have a string template file (.st) in IntelliJ that I would like to see syntax highlighting on. How can I turn this on? I can't seem to find it anywhere.

The best solution is to use HTML syntax for *.st files. You can set this in Preference > File types > HTML.

Short answer is - you can't.
Someone must first implement a syntax highlighter plugin for the format.
The StringTemplate author, Terrence Parr, has begun work on such a plugin for String Template 4 but it does not support the older .st file format.
I tried the plugin. Even on .stg files it is not ideal if you use a dark editor theme.

Related

Intellij Idea not recognizing Freemarker syntax with less than sign

I have intellij 2017.1 and the Freemarker syntax is not recognized (and no intellisense) in my HTML when I use the inferior and superior sign for example <#if>
But it does recognize it when I use the new [#if]
When I tried to follow this link I did not have any option of choosing the Freemarker template language.
I can't just change all of the occurrences to the new way of writing it because it's a huge project.
Example for the following screenshot, it should give me the intellisense for <#if> but it does not
When I use the new styling (starting from 2.3.4) it does give me the intellisense
Any help?
The < and > of FreeMarker tags confuses the editor, so the solution is to use alternative syntax, instead of < use lt and instead of <= use <.
Reference: https://freemarker.apache.org/docs/app_faq.html#faq_alternative_syntax

pycharm code completion / syntax highlighting for django in haml files

I just tried to use HAML in my django project, which works fine^^
But while writing beautiful HAML code PyCharm refuse to offer any code completion or syntax highlighting for django template tags like in HTML files.
Do I need to configure PyCharm differently or is it just not possible to get the "Django Support" in HAML files with PyCharm?
Thanks in advance
I've found an older issue related to this one.
"At the moment the HAML support is part of the RubyMine code and can't be
used in other products. We have an issue for making it independent:
http://youtrack.jetbrains.net/issue/RUBY-6432"
Not sure if they managed to extract the HAML support to PyCharm or not. Their tracker is overloaded so I couldn't check it.

IntelliJ wrapping comments in Javascript

Is it possible to wrap long comment lines in IntelliJ in javascript files? I have turned on line wrapping as shown in the settings below, but when I do a code reformat, it doesn't wrap the line.
It's not supported yet on code reformatting, added a new feature request, please vote.
I'm using IntelliJ 14 on a Mac, which has a Fill Paragraph command. Access it via the awesome universal Command-Shift-A action search feature. Works like a charm!

Intellisense for Objective-J?

My editor of choice for Objective-J Cappuccino development right now is Sublime Text 2. Unfortunately I haven't had any luck finding an Objective-J intellisense autocomplete plugin. It seems it should be doable, since Objective-J does have (optional/pluggable) types. So I think a plugin could definitely parse the code to find the expected type of the object you're trying to autocomplete on, and then look up its method list. Does anyone know of any other editors that support intellisense for Objective-J?
They is only one intellisense plugin for vim available.
You can find a little example video on youtube :
http://www.youtube.com/watch?v=lJrOcHxq6vc
Plugin:
https://github.com/nanki/vim-objj
For Sublime Text 2 you can try https://github.com/aparajita/Cappuccino-Sublime, although it is not that "intelli" as vim plugin.
After installing you should be able to get autocompletion using Ctrl+Space.

How to disable code formatting for some part of the code using comments?

I'd like to selectively disable the IntelliJ IDEA code formatter for a portion of code just like I can in Eclipse. Does IntelliJ support this feature, and if so, how do I use it?
Since version 13 it's possible to wrap the code with
// #formatter:off
...
// #formatter:on
IntelliJ IDEA v.2018+:
File > Settings > Editor > Code Style
IntelliJ IDEA v.2016+:
Preferences > Editor > Code Style
IntelliJ IDEA v.14+:
Preferences > Editor > Code Style > Formatter Control
You can change the formatter control markers, as long as they're in comments.
Ensure formatter markers in comments are enabled, as shown in the following figure:
Note for Carlos' answer of #formatter:off and #formatter:on to work, you may need to enable the preference first:
Discovered via How to config intellij-idea not format some part of the code?
IDEA-56995 Disabled code formatting per region using comments
In xml files, use:
<!-- #formatter:off -->
<!-- #formatter:on -->
Obsolete answer from 2010:
No, it's not possible right now, I've submitted a new issue which you can track.
As a temporary solution you can use external formatter plug-in for IDEA which can utilize Eclipse code formatter (I didn't check whether this particular option is supported).
It's currently not possible to exclude entire files (like regression test data xmls) from formatting. See https://youtrack.jetbrains.com/issue/IDEA-167112