10

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: enter image description here

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.

morecore
  • 900
  • 3
  • 14
  • 32
  • 1
    can you open the application.properties file with the "Spring Properties Editor" via "Open with" and then choose that editor? Just wanna make sure that this works before diving deeper into this issue. – Martin Lippert Jan 05 '18 at 08:39
  • 1
    "Open with" does not offer me the "Spring Properties Editor". If I filter for "Spring", I get `Spring Config Editor`, `Spring Extentions` and `Spring Web Flow XML Editor` - if I filter for "Properties", I get `Build Properties Editor` and `Properties File Editor`. – morecore Jan 05 '18 at 11:58
  • That sounds very much like something went wrong during the install or the used JDK is the wrong one. Please verify that you run your IDE at least with a JDK8, otherwise certain pieces will not be available. – Martin Lippert Jan 06 '18 at 18:15
  • In addition to that you could also try a ready-to-use STS distribution from here: https://spring.io/tools to see if that works any better? – Martin Lippert Jan 06 '18 at 18:15
  • jre is 1.8.0_151 - and the STS distro is working as well (with the same jre). – morecore Jan 09 '18 at 10:13
  • I've "battled" a little with my previous eclipse (4.6.1) installation because the svn plugin was/is broken and I had to moved some packages and therefore I needed my project to be connected with svn. The svn plugin in Neon(4.6.3) worked so I downgraded (yes I know - you shouldn't). SVN worked (yeah) but then STS did't - therefore I've deleted my workspace and also my ~/.eclipse folder and created a new one. Do the STS tools have an different configuration location that needs to be clean/purged as well? Or did I miss something else that you might know/ could thing off? – morecore Jan 09 '18 at 10:22
  • I don't think so, don't have any other locations mind. If that would help, I could also provide a download link for a ready-to-use STS 3.9.2 distribution on Eclipse 4.6.3, if that would help and make things easier. We don't have them on the download page since they are not the recommended distro, but we have them around internally since we usually support the previous Eclipse version, too. – Martin Lippert Jan 10 '18 at 12:00
  • As the main setup phase is over and I don't need to update/add many properties, I've decided to stick for the moment with my original eclipse (4.7.2) and hope the svn problem will be fixed soon. When the next bug fix release is released I'll give it a fresh try. Albeit thanks a lot for the offer and the info!! – morecore Jan 11 '18 at 14:58
  • @MartinLippert: You wouldn't have an idea what might be the problem in my 'sub-question' ... about the `application-test.properties`? – morecore Jan 11 '18 at 15:04
  • see below, added an answer to the "sub-question"... :-) – Martin Lippert Jan 12 '18 at 15:17

6 Answers6

10

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.

Martin Lippert
  • 5,988
  • 1
  • 15
  • 18
5

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.

Feedforward
  • 4,521
  • 4
  • 22
  • 34
Gagan Gowda
  • 49
  • 1
  • 2
4

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

Martin Lippert
  • 5,988
  • 1
  • 15
  • 18
2

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: enter image description here

NickCoder
  • 1,504
  • 2
  • 23
  • 35
1

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"

Michael Qin
  • 629
  • 6
  • 10
0

install spring tool suite 4 from marketplace

Prashant Joshi
  • 445
  • 6
  • 9