简体   繁体   English

Sublime3,ruby编程,自动完成 - 显示类的方法(比如java,实际上)

[英]Sublime3, ruby programming, autocomplete - show a class' methods (like java, actually)

I am new to Sublime and to Ruby. 我是Sublime和Ruby的新手。 I have been developing Java for 10+ years, and what I miss, is: autocomplete, in the meaning of: using: Sublime3 (ok if had to switch to 2 to get this option) + Rails. 我已经开发了10多年的Java,我想念的是:autocomplete,意思是:using:Sublime3(ok,如果必须切换到2来获得此选项)+ Rails。 issue: I want: I type: "MyClass. [DOT]" say: I type the dot and then: a list of methods of this class are displayed. 问题:我想:我输入:“MyClass。[DOT]”说:我键入点然后:显示此类的方法列表。 These methods that are defined by default (as of heritage), and those that I have defined, in the class definition. 这些方法默认定义(作为遗产),以及我在类定义中定义的方法。 I am aware of the 'duck-typing' style, such: also these methods, that this object itself is able to use, would be a plus. 我知道'鸭子打字'的风格,例如:这个对象本身能够使用的方法也是一个优点。 While, I would be happy with the first two (heritage and self.methods). 虽然,我会对前两个(遗产和自我方法)感到满意。

Yes I am aware that the Ruby-community is sort of pure coding; 是的我知道Ruby社区是一种纯粹的编码; I like it also, and I also appreciate an editor that helps. 我也喜欢它,我也很感谢有帮助的编辑。

I have read through answers in GITHUB, and I could not figure out if that is existing or not .. it seems, the Ruby-people do not understand this Java-coding idea. 我已经阅读了GITHUB中的答案,我无法弄清楚它是否存在......看起来,Ruby-people不理解这个Java编码的想法。

Thank you for any link or answer. 感谢您的任何链接或答案。

Sublime is a text editor, is not an IDE. Sublime是一个文本编辑器,不是IDE。 In the Java world you are likely used to write your code with IDE (such as Netbeans, Eclipse, Intellij IDEA), I have never seen Java developers using a pure text editor. 在Java世界中,您可能习惯使用IDE编写代码(例如Netbeans,Eclipse,Intellij IDEA),我从未见过Java开发人员使用纯文本编辑器。

There are some IDE for Ruby. Ruby有一些IDE。 However, the highly dynamic and loosely typed nature of Ruby makes it really hard to provide an accurate IntelliSense code completion. 但是,Ruby的高度动态和松散类型使得很难提供准确的IntelliSense代码完成。 Both the assumption that the Ruby community pretends to be pure, or Ruby-people do not understand Java-coding idea are simply wrong. 假设Ruby社区假装是纯粹的,或者Ruby-people不理解Java编码的想法都是错误的。 Several Ruby developers approached the language from Java, therefore they are perfectly aware of how the Java world works. 一些Ruby开发人员从Java中学习了这种语言,因此他们完全了解Java世界的工作原理。

If you feel more comfortable with an IDE, try to search for a Ruby one. 如果您对IDE感觉更舒服,请尝试搜索Ruby。 RubyMine is a great product, and if you come from Java world you may already be familiar with Intellij IDEA. RubyMine是一款出色的产品,如果你来自Java世界,你可能已经熟悉了Intellij IDEA。 There are also plugins for Netbeans and Eclipse , but the runtime evaluation capabilities of RubyMine are far superior and it's also the most up-to-date. 还有NetbeansEclipse的 插件 ,但RubyMine的运行时评估功能远远优于它,它也是最新的。

Most of text editors, such as TextMate, Sublime Text, Atom, etc understands Ruby and provide Ruby syntax highlighting and additional features, some of them even autocompletion, but IDE-level features as you would expect from the Java world. 大多数文本编辑器,如TextMate,Sublime Text,Atom等,都能理解Ruby并提供Ruby语法高亮和其他功能,其中一些甚至是自动完成功能,但是您可以从Java世界中获得IDE级功能。

Autocomplete is possible in Sublime - there are several packages for Python, including the excellent Anaconda plugin. Sublime中可以自动完成 - 有几个Python包,包括优秀的Anaconda插件。 Coverage for Ruby isn't quite as deep, but I did find SublimeRsense which may fit your needs. Ruby的覆盖范围不是很深,但我确实找到了可能符合您需求的SublimeRsense The README implies that it's for Atom, but I think that's just left over from another repo. 自述文件意味着它适用于Atom,但我认为这只是从另一个回购中遗留下来的。 I'm not a Rubyist, so I didn't install it, but the directions looked pretty straightforward. 我不是Rubyist,所以我没有安装它,但方向看起来非常简单。

That being said, depending on your personal preferences and knowledge, an IDE may work better for you. 话虽如此,根据您的个人偏好和知识,IDE可能会更好地为您服务。 Of course, it'll take up a lot more room on your HD and in memory, and may get in your way at times, but with that comes many more features that you won't find in a text editor, even one as advanced as Sublime. 当然,它会在你的高清和内存中占用更多空间,并且有时可能会妨碍你,但随之而来的是你在文本编辑器中找不到的更多功能,甚至是高级功能。作为崇高。 Try them both out, and use what works for you. 试试它们,并使用适合你的方法。 Personally, I prefer Sublime over IDEs, as I find many of their "features" annoying, but you'll have to see what best matches your style and needs. 就个人而言,我更喜欢Sublime而不是IDE,因为我发现他们的许多“功能”令人讨厌,但你必须看到最符合你风格和需求的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM