Textmate for Ruby 中的自动完成? [英] Auto-completion in Textmate for Ruby?

查看:25
本文介绍了Textmate for Ruby 中的自动完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很习惯来自 Netbeans 的自动完成功能.

I'm really used to auto-completion coming from Netbeans.

在 Netbeans 中,当我输入一个字符串"然后点击一个点"时,它会打印出一个 String 类的方法列表.

In Netbeans, when I type a 'string' and then hit a 'dot' it will print out a list of methods for the String class.

TextMate 好像没有这个功能.

TextMate doesn't seem to have that function.

有什么可以添加的吗?

将节省大量时间,而不是一直使用 ri/irb/online 文档.

Would save A LOT of time instead of using the ri/irb/online doc all the time.

推荐答案

您已经发现了文本编辑器和 IDE 之间的根本区别:文本编辑器编辑文本(废话!),即非结构化字符流.它对对象、消息、方法、mixin、模块、类、命名空间、类型、字符串、数组、散列、数字、文字等一无所知.这很棒,因为这意味着你可以编辑任何东西 使用文本编辑器,但这也意味着编辑任何特定东西比使用专门的编辑器更难.

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.

Ruby IDE 编辑Ruby 程序,即对象、方法、类等的高度结构化语义图.这很棒,因为 IDE 知道构成合法 Ruby 程序的规则,因此将例如使您无法编写非法的 Ruby 程序,它可以为您提供自动转换,保证如果您从一个合法的 Ruby 程序开始,您最终会得到一个合法的 Ruby 程序(例如自动重构).但这也意味着您可以编辑 Ruby 程序.

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.

简而言之:使用文本编辑器根本不可能完成您的要求.你需要一个 IDE.(注意:您当然可以在文本编辑器之上构建一个 IDE.Emacs 就是一个很好的例子.但从我读到的内容来看,TextMate 插件 API 的功能还不够强大这个.不过,我可能是错的   因为我没有 Mac,所以我主要依赖于道听途说.)

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.)

这篇关于Textmate for Ruby 中的自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆