Auto-completion in Textmate for Ruby?

北战南征 提交于 2019-12-05 17:38:10

You have discovered the fundamental difference between a text editor and an IDE: a text editor edits text (duh!), i.e. an unstructured stream of characters. It doesn't know anything about objects, messages, methods, mixins, modules, classes, namespaces, types, strings, arrays, hashes, numbers, literals etc. This is great, because it means that you can edit anything with a text editor, but it also means that editing any particular thing is harder than it were with a specialized editor.

A Ruby IDE edits Ruby programs, i.e. a highly structured semantic graph of objects, methods, classes etc. This is great, because the IDE knows about the rules that make up legal Ruby programs and thus will e.g. make it impossible for you to write illegal Ruby programs and it can offer you automated transformations that guarantee that if you start out with a legal Ruby program, you end up with a legal Ruby program (e.g. automated refactorings). But it also means that you can only edit Ruby programs.

In short: it's simply impossible to do what you ask with a text editor. You need an IDE. (Note: you can of course build an IDE on top of a text editor. Emacs is a good example of this. But from what I have read, the TextMate plugin API is simply not powerful enough to do this. I could be wrong, though – since I don't have a Mac, I'm mostly dependent on hearsay.)

Install the Ruby TextMate bundle, open a Ruby file and type alt+esc to get the autocompletion.

TM's "equivalent" is hitting escape, I believe. You can make escape "go across files" for completion if you use the ruby amp TM bundle http://code.google.com/p/ruby-amp/

GL. -r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!