Dimitris Fasarakis Hilliard
Dimitris Fasarakis Hilliard

Reputation: 160407

Sublime Text Java-Scala Code Intelligence/Auto Complete

I have unsuccessfully been trying to find codeInt plugins for developing scala/java code in Sublime Text 3, and I don't understand why this is.

There seem to be a good set of plugins available for auxiliary functions like sbt, ensime (which is way too rough, I'm still trying to set it up) for scala and plugins like javatar for java but none relating to one of the defining features of IDEs which is intelligent code assistance.

Au contraire, for languages like Python, PHP and JavaScript, these plugins are already available and very rich helping you forget about heavier and bulkier IDEs like Eclipse, IntelliJ et al.


My question essentially boils down to: are there legitimate underlying reasons (increased overhead due to codeInt? Complexity? Unwillingness of someone to develop this plugin? No idea!) for languages like Java and Scala to be left out, or is Sublime Text just geared towards becoming (or always was) a scripting-friendly IDE?

Upvotes: 0

Views: 1292

Answers (1)

MattDMo
MattDMo

Reputation: 102852

Yes, there are legitimate reasons for the focus on scripting. The most important reason is due to the nature of scripting languages: statements and code blocks can be evaluated in real time, the types of variables can be determined, and appropriate functions/methods/attributes and so on presented to the user. Compiled languages don't necessarily offer that capability, because the code constantly needs to be recompiled in order to be run and analyzed, and some code just isn't amenable to static analysis.

Basically what the "code intelligence" plugins for Sublime boil down to are mobile interpreters that can evaluate the current code and give you suggestions for functions, etc. They scan the already-imported modules/libraries/what have you and offer those up at appropriate times, along with built-in functions that come standard without being imported. They keep track of the type of variables, giving the semblance of "intelligence".

However, as any moderately-experienced user will tell you, Sublime IS NOT an IDE. It can't do real refactoring. Debugging is quite difficult to impossible, depending on the language. It can't do auto importing.

Sublime's API is exposed in Python, which explains the large quantity of code completion, linting, and analysis tools for that language. Node.js can be run via Python and takes care of the JavaScript community. Ruby, like Python, is interpreted and has similar tools, although not as many, probably due to the fact that it's just not as popular. PHP is also interpreted, and while I don't know why anyone in their right mind would voluntarily use the language for anything, apparently people still do, so there are tools for it.

JVM and CLR languages are completely different beasts. There are plenty of good IDEs on the market targeting them, having embedded VMs (or at least being able to attach to various ones) and gigantic codebases that try to (and often succeed at) give you every feature under the sun. Consequently, they run from hundreds of megabytes to gigabytes in size. The most recent .deb for Sublime Build 3095 x64 is ~6.5 MB, and AFAIK all the installers for all supported platforms are under 10 MB.

Sublime was designed to be a fast and extensible text editor, not a "be everything to everyone" hulking IDE. All the configuration files, menu definitions, key and mouse bindings, etc. are all in text files, not fancy graphical menus. Unless you're like me and have waaay too many plugins installed, the startup time is lightning fast (and even my startup time is less than a second or three), and it's incredibly responsive. It's really good at what it does, and while the API allows people to write plugins to create new features, it will never be a true IDE. I like that, but then again I don't code in Java or C#.

Upvotes: 3

Related Questions