new year - new problems ;)
I'm working on a Linux machine and I've just installed a new Eclipse.
Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600
JRE: java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Then I've added the latest Version of Spring Tools
3.9.2.RELEASE
via the marketplace.
The only other additional plugin that is currently installed is Subversive
4.0.5
The Project that I'm working on and that previously worked as expected has the Spring Boot Project Nature
enabled.
But with the new installation I'm missing the autocomplete feature - No completion or proposals of properties anymore.
In the Project Explorer the application.yml
display only the standard file icon and no longer the (if my memory serves me right) Spring leaf icon.
In an other Project using a 'application.properties' file the behavior is the same.
Is there a setting that now needs to be set? Or something else that I can check?
Not directly related to my previous question:
In my old installation that worked, I've always wondered why exactly these two filenames application.properties
and application-dev.properties
(or their .yml analogous) were recognized as properties files while other were not e.g. application-test.properties
or application-prod.properties
.
See image taken from STS-3.9.2:
It is not only an issue with the icon, but also it opens the wrong editor and therefore I don't have autocomplete support - unless I say Open with -> Spring Yaml Properties Editor
.
I analyzed the problem of the missing property editor and found the reason (and a solution for it), which is documented here:
Missing Spring Properties Yaml Editor and and Spring Properties Editor with Spring Tools 3.9.2
The answer to the "sub-question" about the application-test.properties
file: the content-type that got defined for the Spring Boot property files got defined for specific file names only, since it wasn't possible to put a wildcard-based name like application*.properties
in there. But once you opened that file with Open With -> ...
, Eclipse will remember your choice for the next double-click.
Future versions of Eclipse (I think it is Photon) will have a more flexible way to define those file name matchings so that we can solve this in future versions.
Follow these steps:
1) Right click on application.properties
2) Open with -> others.. -> search for spring Properties Editor -> tick the use it for all application.properties nd the click om ok.
Select the file you would like to open, i.e. application-xyz.yml
Open with "Generic Editor - Spring YAML Properties"
Check the box: Open *.yaml files. Click OK.
That's it. All *.yml files icons now become Spring-ish look and feel. And from now on, you open any YAML file automatically with "Generic Editor - Spring YAML Properties"
Code completions work for me when I edit application.yml
.
Is your file names application.yml and located under src/main/resources
in your boot maben project?
Did you open the application.yml file with Generic Editor:

来源:https://stackoverflow.com/questions/48093885/eclipse-spring-tools-missing-content-assist-autocomplete