5 ms·
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
by rorrr 15y ago
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.
- daniel02216 15y agoYou can get this sort of navigation with ctags ( http://ctags.sourceforge.net/ http://ctags.sourceforge.net/ ) and a plugin like this one: https://github.com/SublimeText/CTags https://github.com/SublimeText/CTags I also use cscope: https://github.com/ameyp/CscopeSublime https://github.com/ameyp/CscopeSublime
- est 15y ago> 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?
- tsandall 15y agosure, 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.
- johns 15y agoOr just don't offer click navigation on functions defined in eval(). Acceptable trade off.
- rorrr 15y agoThat's such an edge case. I've never seen anybody defining functions in evals, especially as concatenated strings.
- agento 15y agoMaybe you should take a look at the Rails sourcecode.
- FooBarWidget 15y agoRails 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.
- drothlis 15y agohttps://github.com/rails/rails/blob/2-3-stable/actionpack/lib/action_controller/request.rb#L11 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". :-)
- TylerE 15y agoI'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.
- airfoil 15y agoYou can do this in emacs with etags and etags-select.el. ctags works with vim.
- struppi 15y ago"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.
- niyazpk 15y agoAFAIK Komodo IDE (7.0 at least) has this feature and it is definitely faster than Eclipse, but it is infinitely more expensive.
- scorpion032 15y agoI 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.
- tectonic 15y agoFor Ruby, I highly recommend RubyMine.
- Rygu 15y agoI 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 https://github.com/Kronuz/SublimeCodeIntel
- redbad 15y agoSupports 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.
- ortatherox 15y agoFor the first two you want to look at https://github.com/quarnster/SublimeClang https://github.com/quarnster/SublimeClang
- chrisdevereux 15y agowhich, as the 'clang' bit suggests, works pretty well. libclang and Sublime both having a Python API is extremely cool.
- jaylevitt 15y agoIs 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.
- bobwaycott 15y agoI 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.
- buff-a 15y agoAs 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.
- agos 15y agoNumber 2) is included in Sublime Text (same shortcut, too). And it's fuzzy!
- rorrr 15y agoNo, that only lets you jump to files, not to functions/methods.
- robinduckett 15y agoST2 allow you to do it within the same file, but not outside of the file.
- bobwaycott 15y agoActually, 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.
- mcos 15y agoI use SublimeRope and I'm quite happy with it (It's for python only though.): https://github.com/JulianEberius/SublimeRope https://github.com/JulianEberius/SublimeRope