Thymeleaf support in InteliJ IDEA - intellij-idea

I'm working with a legacy spring boot application with InteliJ IDEA.
The project uses Thymeleaf templates.
I'm able to get some IDE support for Thymeleaf syntax, but it's very rudimentary.
It will do basic auto-completion for th:* attributes, but some syntax it doesn't understand at all.
For example, I've got this style block in a template...
<style th:inline="text">
#Home {
background-image: url([[${#environment.getProperty('myStaticAddress') + '/images/my_background_image.jpg'}]]);
}
</style>
This renders correctly. However the IDE has no clue what this is, and just underlines it as a css error.
Is there some way to enable more complete support for Thymeleaf in IDEA?
I'm not very familiar with Thymeleaf, so this lack of IDE support really slows things down.

If you have the Ultimate version of IntelliJ IDEA, then you can see what is supported at https://www.jetbrains.com/help/idea/thymeleaf.html
There are quite some requests to improve Thymeleaf support at their bugtracker as well: https://youtrack.jetbrains.com/issues/IDEA?q=%23%7BLang.%20Thymeleaf%7D%20%23Open%20%23Reopened%20%23Submitted%20

Related

IntelliJ Ctrl-Click on method and autocompletion in HTML doesn't work

I've started using IntelliJ for angular2 development recently but there seem to be a bug. I know from WebStorm that if I have following html:
<button (click)="onHaveClicked()">Button</button>
I should be able to jump to the method implementation in my typescript file using ctrl-click. But this shortcut isn't working at all. I've tried multiple different files.
Also autocompletion in html doesnt work at all. It's showing no angular attributes like ngFor etc. Angular2 is of course installed.
Was somebody with the same problem able to solve it?
IntelliJ doesn't come with Angular support built in. You can however enable it by installing the plugin. Settings -> Plugins -> Install Jetbrains Plugin -> Search for Angular.
This is a general thing with IntelliJ and the other editors. The specialized editors (like PhpStorm and WebStorm) comes with what you need for that editor by default. IntelliJ, which is more general, it often has to be installed manually.

Intellij idea thymeleaf completion in spring boot project

I'm having a code assist issue in a SpringBoot / Thymeleaf project in Intellij idea.
I have setted up a simple Spring boot project using gradle and I want to use thymeleaf as a template engine; however I'm not getting any code assistance in my HTML pages.
The application runs properly however the only code assistance that I have is for the i18n messages, no code assistance for POJOs or any other thing.
My project has the Spring facet configured.
I'm running :
Intellij Idea 2016.2
Spring boot 1.3.6
Do I have to do anything else in the project to have this working?
Thanks
Ulises
Actually this is a known bug from Intellij :
https://youtrack.jetbrains.com/issue/IDEA-132738
for which there's no fix yet but only a workaround :
<!--/*--><!--#thymesVar id="loginFormBean" type="sample.system.login.LoginFormBean"--><!--*/-->

How to add angular support in intellij

I tried adding angularJS to Intellij following this guide, but the problem is that I am unable to access Java Script option inside Languages and Frameworks, and therefore I cannot change libraries. Any ideas how to make it appear?
The free edition of IntelliJ does not support Javascript. For that you need to purchase Ultimate.

Working with IntelliJ + Spring Data + AspectJ

I am attempting to work with a Spring Data Graph project in IntelliJ 11.1.4 Ultimate edition. The project builds fine but the editor says that the persist() method on my classes annotated with #NodeEntity can't be found. Additionally, none if the aspect enhanced methods, like persist, show up for auto-complete suggestions.
I am using the AspectJ Support plugin and I have the compiler set to AJC. Both IntelliJ and Maven can build and run the project, it appears that the editor is the only piece that has the problem.
Am I missing something obvious? Is this a limitation of IntelliJ? I thought 11.1.4 addressed this but I might be mistaken.
Unfortunately AspectJ support isn't fully implemented yet - though resolve and completion should work. Could you please file a ticket in the tracker with a small demo project attached?

Is there an easy way to use intellij for liferay theme development?

I recently switched from eclipse and netbeans to intellij, but I have also liferay stuff to do and intelliJ seems to lack a decent liferay integration.
Does someone know how to use intelliJ for that, with as much of intelliJs comfort as possible :-/
As the themes are no simple java project the import stuff doesn't seem to recognize it properly...
You could look into the maven integration for Liferay (depending on the version of Liferay you're using - the more recent the version, the better the maven integration) and just import a pure maven project. The layout of this differs a bit from the usual ant-based SDK.
But of course you can also use the pure Ant buildfiles you find in the plugins sdk. As there's typically no java in a theme, it doesn't make a lot of differences.
Not wanting to start IDE wars here, but you also might consider Liferay IDE (or Developer Studio, it's EE-Version) for theme-related development. As there's no Java development done in themes, the conflict of changing tools should be handleable. I wouldn't want to work in both IDEs for Java development again (been there, done that), but for themes I can imagine just going the easy route - it's mainly CSS that you edit.