2 ms·
The great thing about ST2's autocompletion is that it is totally extensible, allowing you to hack your own completion routines. I wrote an indexer for Objectiv
by veidr 15y ago
The great thing about ST2's autocompletion is that it is totally extensible, allowing you to hack your own completion routines.
I wrote an indexer for Objective-J code last year, that scans a set of folders (which can include the Cappuccino frameworks if you like) and creates a completion index of all the class names, methods, functions, etc. It was trivial to make an ST2 plugin that completes using that data.
The abilitity to write your own autocompletion plugins for the freaky/obscure kinds of files you use really rocks. Even without heavy-duty semantic analysis of the code, you can get 90% of the way there and it is really useful.
The main problem right now is that the UI is still too narrow. Voting this issue up could help get that fixed:
http://sublimetext.userecho.com/topic/85632-need-the-completion-menu-to-be-wider/ http://sublimetext.userecho.com/topic/85632-need-the-complet...
- itmag 15y agoWhat would it take to get it to be as smart as, say, Intellisense?
- digispaghetti 15y agohttps://github.com/Kronuz/SublimeCodeIntel https://github.com/Kronuz/SublimeCodeIntel
- veidr 15y agoWell, that would really take a lot of work, to make it good. There's some commented-out logic in the 'official' Cappuccino plugin for ST, that takes into account the scope and then works backwards to try to figure out what type of object you are messaging. https://github.com/aparajita/Cappuccino-Sublime https://github.com/aparajita/Cappuccino-Sublime But I think the reason that's commented out is that it is easy to get some parts working, but to do it right you need to analyze the whole code base, with a real parser, be able to follow the map of import/include statements back to know what code elements are actually available in the current scope, etc etc. And that's a lot of work. Still, there's a lot of value in doing a good job with a simpler kind of completion -- and it is way easier, as long as the editor is extensible to the extent that ST is.
- veidr 15y agoBTW the SublimeCodeIntel project is really interesting in this regard. https://github.com/Kronuz/SublimeCodeIntel https://github.com/Kronuz/SublimeCodeIntel
- itmag 15y agoThe reason that I ask is that I feel I am getting stuck with C# simply due to the comfort of Intellisense. I have to find some way of replicating that experience with other languages... I know other languages of course, but it just feels like a hassle to code without Intellisense these days :p
- jablan 15y agoIf you have dynamically typed languages in mind, give it a try without completion, you might be surprised - different paradigm depreciates completion quite a bit.
- JonnieCache 15y agoIndeed. When getting really funky with ruby's metaprogramming, completion isn't going to help you.
- veidr 15y agoI totally agree with you; I think it is barbaric to code without smart autocompletion. I think to eventually get there, though, we need open-source solutions to get as good as JetBrains, Microsoft, and Apple. Otherwise you get Apple's great (for Obj-C only) CodeSense, but you have to use their horrible, auto-corrupting, fucking disgrace of an IDE. Or to get RubyMine's absolutely unparalleled Ruby code introspection and completion, you have to use their gut-wrenchingly horrible Java monstrosity. When the indexing and completion are decoupled from the editing environment, that's the magic sauce that will make the open source solutions fork and flourish, and good completion will finally be like toilet paper and hot water. That's why I am really happy with editors ilk ST2 which provide good infrastructure to make things like SublimeCodeIntel possible. I'm 37, I program a lot, and my finger joints are wearing out. Typing every single fucking character of code is insane.