Frage

I wonder if I can get the Java Sublime Text snippets working on Eclipse IDE (Kepler) because I think that auto completion is better in ST then in eclipse.

Thank you.

--Sangimed.

War es hilfreich?

Lösung

I'm not sure which way around you meant to ask that question, but here is my try at answering it.

Sublime Text snippets are store in the Packages directory. If you were in Sublime Text 2 and went to the File menu -> Preferences -> Browse Packages...

It will open the local packages for your installation of ST. If you look under "Java" you will find all the local information for Java that is built into ST by default. Which should include all of the ST snippets you are looking for... they are files with the extension .sublime-snippet

However, here is the tricky bit. ST snippets are stored in an xml format designed for ST, so you will need to grab the data out of the "content" node in that XML file, here is an example:

<content><![CDATA[assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0]]></content>

What you need is the content inside of the CDATA:

assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0

However, this won't make sense to Eclipse right away you'll need to replace the sublime annotations with Eclipse ones, see the Eclipse documentation for more details and the Sublime Text documentation on snippet details.


But perhaps you meant you want the best of both world, Eclipse and Sublime Text together... in that case you should look at the project Subclim, which allows you to integrate the power of Eclipse inside of ST.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top