'IntelliJ (2018.3) with Thymeleaf - NO auto completion on paths to static content?

Code completion for paths and filenames do NOT seem to work in IntelliJ with Thymeleaf: th:src="@{...}" attributes - e.g. files in the resources/static/ folder.

I'm using the latest version of IntelliJ Ultimate Edition (2018.3.x as I am typing this) with the latest Spring Boot "2.1.3.RELEASE", along with the latest Thymeleaf packages.

I have only one controller class, and one HTML template. Simple stuff. I can run the app fine and the content shows up.

However, auto completion for static resources is NOT working when typing in the template - for images, css etc. When using the standard HTML src= attribute e.g. src="../static/images/mylogo.png" code completion works fine. Paths to static content with Thymeleaf th:src="@{...}" tags have no auto completion at all.

Example of static content in the template

Any suggestions or help would be VERY welcome. I've been using IntelliJ Ultimate for many years, and hopefully this is just a setting I am overlooking. Cannot find anything online pointing at this or a solution. I recall (maybe mistakenly) that this worked a couple years back on a project. Tried on 3 systems and the same behavior. Setting? Config? IntelliJ Bug?



Solution 1:[1]

  1. File -> Other Settings -> Config Plugins -> check thymeleaf.

  2. Add dependency in file: porm.xml

  3. In HTML,don't forget to add xmlns:th="http://www.thymeleaf.org"

enter image description here

You can see more at here

https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cng.buff