News for hackers. Stuff that matters.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by rorrr on Thursday January 12, 2012 @02:41AM (#3455425)
What I really miss in all these fast small editors is the quick-jump features that actually analyze the code and let me do things like

1) Jump the the function/method definition (even if it's in a different file) when I press Ctrl and click on the function name. Eclipse does this.

2) Quick find of the function/method definition across the whole project. Eclipse does this as well (Ctrl + R).

I don't use Eclipse that much, because it's ridiculously slow, but it has cool features.

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by buff-a on Thursday January 12, 2012 @05:32AM (#3455789)
As soon as they have the code required to analyze your code, they aren't small, and as soon as they run that code they aren't fast. OTOH if that's the functionality you want, use eclipse, intellij (or a variant like RubyMine), and buy a beefy computer with an SSD. Eclipse isn't slow on my machine.

EDIT: Now that I look at your two requirements, that's not at all hard for a language like C or java. I recall having this in 1993 on the OS/2 version of SlickEdit. vim or emacs will handle this no problem. If you want a GUI, Visual SlickEdit will do it, and for a whole bunch of languages on every OS.

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by Rygu on Thursday January 12, 2012 @04:26AM (#3455654)
I think you are looking for the CodeIntel plugin. It takes a few minutes to index large projects, but after that, it's really fast and Alt + Click will take you to the definition of things. I switched completely from TextMate.

Take a look: https://github.com/Kronuz/SublimeCodeIntel

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by redbad on Thursday January 12, 2012 @06:10AM (#3455885)

    Supports all the languages Komodo Editor supports for
    Code Intelligence (CIX, CodeIntel2):
    
    PHP, Python, RHTML, JavaScript, Smarty, Mason, Node.js,
    XBL, Tcl, HTML, HTML5, TemplateToolkit, XUL, Django, 
    Perl, Ruby, Python3.
Where's C? Where's C++? Where's Java? That's disappointing.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by ortatherox on Thursday January 12, 2012 @08:13AM (#3456181)
For the first two you want to look at https://github.com/quarnster/SublimeClang
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by chrisdevereux on Thursday January 12, 2012 @09:00AM (#3456315)
which, as the 'clang' bit suggests, works pretty well. libclang and Sublime both having a Python API is extremely cool.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by jaylevitt on Thursday January 12, 2012 @10:27AM (#3456616)
Is SublimeCodeIntel working well again/yet? I tried it a few months ago on Mac and it caused major slowdowns all throughout ST2 - even just typing text was slow when it's installed. I've heard other such reports on the forums, and a co-developer had the same problem last week.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by bobwaycott on Thursday January 12, 2012 @10:38AM (#3456648)
I use it daily and have no issues on my machine with slowdowns or any trouble. SublimeCodeIntel + SublimeLinter + autocomplete are what made me switch to ST2 a couple months ago. Haven't touched TextMate or emacs since.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by snkashis on Thursday January 12, 2012 @04:18PM (#3457981)
I had the same problem, until I took the recommendation of using the nightly version a couple weeks ago. Now it works great. http://www.sublimetext.com/dev
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by daniel02216 on Thursday January 12, 2012 @02:53AM (#3455453)
You can get this sort of navigation with ctags ( http://ctags.sourceforge.net/ ) and a plugin like this one: https://github.com/SublimeText/CTags

I also use cscope: https://github.com/ameyp/CscopeSublime

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by struppi on Thursday January 12, 2012 @03:00AM (#3455471)
"ridiculously slow"? Well, it is slower than a small text editor, but after using Visual Studio for about a year, Eclipse seems blazingly fast to me.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by est on Thursday January 12, 2012 @02:54AM (#3455454)
> Jump the the function/method definition

for scripting languages, define a function as concatenated string in eval(), how could you find the function definition, without actually run the script for once?

Even if you run the script once, what if there is a delete_file() function you accidently called?

So do we need to implement a sandboxed VM in order to find definition, theoretical perfectly speaking?

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by johns on Thursday January 12, 2012 @03:04AM (#3455485)
Or just don't offer click navigation on functions defined in eval(). Acceptable trade off.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by tsandall on Thursday January 12, 2012 @03:04AM (#3455481)
sure, theoretically speaking you can't figure out everything until runtime, however even with 'scripting language' code you can still get quite far with basic static analysis.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by rorrr on Thursday January 12, 2012 @03:05AM (#3455486)
That's such an edge case. I've never seen anybody defining functions in evals, especially as concatenated strings.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by TylerE on Thursday January 12, 2012 @01:06PM (#3457315)
I've done it.

Use case involves a class wrapping python's xml-rpc stuff to talk to Drupal.

Drupal's xml-rpc interface is not the most pleasant thing to work with, as you have to pass in a session id and auth token on every request, and then all the "actual" parameters go in as an array.

My wrapper class would query the remote interface for available methods, and then dynamically generate, via eval, a function object that used a closure to store the sess/auth tokens, and that took a variable number of arguments to pass as the 3rd array argument to the function. The eval'd function object was then bound as a method to the connection object.

It also did a bit more magic, such as on error logging the arguments to a file. ALl in all it made writing web-service clients a lot more pleasant.

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by agento on Thursday January 12, 2012 @03:40AM (#3455566)
Maybe you should take a look at the Rails sourcecode.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by FooBarWidget on Thursday January 12, 2012 @08:35AM (#3456234)
Rails only does that to optimize certain function calls. eval() is used as a method to compile/inline certain functions. Most code in Rails does not use eval.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by drothlis on Friday January 13, 2012 @02:03AM (#3459514)
https://github.com/rails/rails/blob/2-3-stable/actionpack/li...

Try getting your editor to find that definition of method "accept_language" or "cache_control". :-)

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by airfoil on Thursday January 12, 2012 @02:56AM (#3455463)
You can do this in emacs with etags and etags-select.el. ctags works with vim.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by niyazpk on Thursday January 12, 2012 @03:43AM (#3455575)
AFAIK Komodo IDE (7.0 at least) has this feature and it is definitely faster than Eclipse, but it is infinitely more expensive.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by scorpion032 on Thursday January 12, 2012 @04:31AM (#3455665)
I haven't tried Komodo since a year, but when I last tried it, it definitely feet like "Not my kind".

None of the normal (you come to expect) keybindings work. It was slow/sluggish.

At the time when I checked out (I have no reason to believe why it would be much different today) Wing seemed infinitely more awesome. - The ability to split screens, the amount of time the UI actions take. The F1 and F2 that provide more screen real estate felt far more interesting than Komodo, which almost felt the opposite. Komodo didn't have the deep Python integration like wing does. The goto definition etc are far more better in Wing.

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by tectonic on Thursday January 12, 2012 @04:12AM (#3455622)
For Ruby, I highly recommend RubyMine.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by agos on Thursday January 12, 2012 @05:42AM (#3455821)
Number 2) is included in Sublime Text (same shortcut, too). And it's fuzzy!
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by rorrr on Thursday January 12, 2012 @04:59PM (#3458144)
No, that only lets you jump to files, not to functions/methods.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by mcos on Thursday January 12, 2012 @01:33PM (#3457408)
I use SublimeRope and I'm quite happy with it (It's for python only though.): https://github.com/JulianEberius/SublimeRope
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by robinduckett on Thursday January 12, 2012 @09:38AM (#3456438)
ST2 allow you to do it within the same file, but not outside of the file.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by bobwaycott on Thursday January 12, 2012 @10:43AM (#3456667)
Actually, with SublimeCodeIntel, you can jump to any definition anywhere in your project.

Moreover, at least in Python (perhaps others?), you can jump to definitions in any included lib that aren't even part of your project's source code--e.g., import something from django & it'll jump you right to Django's source for any imported method, class, etc.