我听说有人选择了其中一种方式,并对其中一种方式发誓。
作为一个Eclipse的忠实粉丝,但没有时间尝试IntelliJ,我很有兴趣从“前Eclipse用户”IntelliJ用户那里听到一些用IntelliJ可以做而用Eclipse不能做的具体事情。
注意:这不是一个主观的问题,也不意味着变成一场IDE圣战。请为任何煽动性的答案投票。
我听说有人选择了其中一种方式,并对其中一种方式发誓。
作为一个Eclipse的忠实粉丝,但没有时间尝试IntelliJ,我很有兴趣从“前Eclipse用户”IntelliJ用户那里听到一些用IntelliJ可以做而用Eclipse不能做的具体事情。
注意:这不是一个主观的问题,也不意味着变成一场IDE圣战。请为任何煽动性的答案投票。
当前回答
VIM模拟器。这个插件在IDEA中编辑文件时提供了几乎完整的vi/vim/gvim仿真。 支持以下功能: 运动键 删除/修改 插入模式命令 标志着 寄存器 VIM撤销/重做 可视模式命令 一些Ex命令 Some:设置选项 用于搜索和搜索/替换的完整VIM正则表达式 宏 测量 命令行历史记录 搜索历史记录 跳转列表 VIM提供帮助
关于这个插件的一些评论来自http://plugins.jetbrains.net/plugin/?id=164
I can't see ever going back to any other ide because of this plugin.. Best of both worlds... Awesome!. that's what i was lacking in all IDEs.其他回答
我经常使用的一件事是设置断点,然后控制它的功能。(在我的上一份工作中,大多数人都使用Eclipse……我记得我很惊讶,没有人能在Eclipse中找到如何做到这一点。)
例如,可以让断点实际上不停止,而只是将消息记录到控制台。这意味着,我不必用“System.out.println(…)”乱写代码,然后重新编译。
其他一些事情:
propagate parameters/exceptions when changing method signature, very handy for updating methods deep inside the call stack SQL code validation in the strings passed as arguments to jdbc calls (and the whole newly bundled language injection stuff) implemented in/overwritten in icons for interfaces & classes (and their methods) and the smart implementation navigation (Ctrl+Alt+Click or Ctrl+Alt+B) linking between the EJB 2.1 interfaces and bean classes (including refactoring support); old one, but still immensely valuable when working on older projects
CTRL-click在任何地方都适用
CTRL-click that brings you to where clicked object is defined works everywhere - not only in Java classes and variables in Java code, but in Spring configuration (you can click on class name, or property, or bean name), in Hibernate (you can click on property name or class, or included resource), you can navigate within one click from Java class to where it is used as Spring or Hibernate bean; clicking on included JSP or JSTL tag also works, ctrl-click on JavaScript variable or function brings you to the place it is defined or shows a menu if there are more than one place, including other .js files and JS code in HTML or JSP files.
自动完成许多语言
Hibernate
在HSQL表达式、Hibernate配置(包括类、属性和DB列名)、Spring配置中自动完成
<property name="propName" ref="<hit CTRL-SPACE>"
它会显示你可以注入到属性中的bean列表。
Java
Java代码中非常智能的自动完成:
interface Person {
String getName();
String getAddress();
int getAge();
}
//---
Person p;
String name = p.<CTRL-SHIFT-SPACE>
它显示你只有getName(), getAddress()和toString()(只有他们是类型兼容)和getName()是第一个在列表中,因为它有更多相关的名称。EAP的最新版本8拥有更智能的自动补全功能。
interface Country{
}
interface Address {
String getStreetAddress();
String getZipCode();
Country getCountry();
}
interface Person {
String getName();
Address getAddress();
int getAge();
}
//---
Person p;
Country c = p.<CTRL-SHIFT-SPACE>
它会自动完成到
Country c = p.getAddress().getCountry();
Javascript
JavaScript中的智能自动完成。
function Person(name,address) {
this.getName = function() { return name };
this.getAddress = function() { return address };
}
Person.prototype.hello = function() {
return "I'm " + this.getName() + " from " + this.get<CTRL-SPACE>;
}
并且它只显示getName()和getAddress(),不管你在你的项目中的其他JS对象中如何使用get*方法,ctrl-click this.getName()将带你到这个定义的地方,即使在你的项目中有一些其他的getName()函数。
HTML
我提到过自动完成和按ctrl键点击文件路径,比如<script src="", <img src="",等等?
自动完成HTML标签属性。自动完成HTML标签的样式属性,包括属性名和值。在类属性中也可以自动完成。 输入<div class="<CTRL-SPACE>,它将显示您在项目中定义的CSS类列表。选择一个,按ctrl键单击它,您将被重定向到它定义的位置。
轻松凸显自己的语言
最新版本有语言注入,所以你可以声明你自定义的JSTL标签通常包含JavaScript,它会突出显示其中的JavaScript。
<ui:obfuscateJavaScript>function something(){...}</ui:obfuscateJavaScript>
跨所有项目的索引搜索。
You can use Find Usages of any Java class or method and it will find where it is used including not only Java classes but Hibernate, Spring, JSP and other places. Rename Method refactoring renames method not only in Java classes but anywhere including comments (it can not be sure if string in comments is really method name so it will ask). And it will find only your method even if there are methods of another class with same name. Good source control integration (does SVN support changelists? IDEA support them for every source control), ability to create a patch with your changes so you can send your changes to other team member without committing them.
改进的调试器
当我在调试器的监视窗口中查看HashMap时,我看到逻辑视图-键和值,上次我在Eclipse中做了它,它显示了带有哈希和下一个字段的条目-我不是真正调试HashMap,我只是想看看它的内容。
Spring和Hibernate配置验证
它在编辑时验证Spring和Hibernate配置,所以我不需要重新启动服务器来知道我拼错了类名,或者添加了构造函数参数,所以我的Spring cfg无效。
上次尝试时,我无法在Windows XP x64上运行Eclipse。
它会提示你person。name或person。address。 Ctrl-click Person .name,它将导航到Person类的getName()方法。
类型Pattern.compile (" ");输入\\在那里,点击CTRL-SPACE,看看你可以在正则表达式中输入什么的有用提示。你也可以在这里使用语言注入——定义你自己的接受字符串参数的方法,在IntelliLang选项对话框中声明你的参数是正则表达式——它也会给你自动补全。不用说,它突出了不正确的正则表达式。
其他功能
有几个特性我不确定Eclipse中是否存在。但是至少我们团队中使用Eclipse的每个成员,也使用一些合并工具来合并本地更改和来自源代码控制的更改,通常是WinMerge。我从来不需要它——合并到IDEA对我来说就足够了。通过3次点击,我可以看到源代码控制中的文件版本列表,通过3次点击,我可以比较以前的版本,或者以前和当前的版本,并可能合并。
它允许指定我需要WEB-INF\lib文件夹中的所有。jar文件,而不单独选择每个文件,因此当有人提交新的。jar文件到该文件夹时,它会自动选择它。
上面提到的可能是它所做的10%。我不使用Maven、Flex、Swing、EJB和其他很多东西,所以我不知道它对它们有什么帮助。但确实如此。
就这篇文章而言,我的时机可能有点不对,但我必须做出回应。
我是一个超级日食迷——从它第一次出现就开始使用它。一个朋友告诉我(10多年前),这将是一个播放器。他是对的。
然而!我刚刚开始使用IntelliJ,如果您还没有见过或使用过变更列表,那么您就错过了编程的天堂。
The ability to track my changed files (on my development branch ala clearcase) was something I was looking for in a plugin for eclipse. Intellij tracks all of your changes for a single commit, extremely easy. You can isolate changed files with custom lists. I use that for configuration files that must be unique locally, but are constantly flagged when I sync or compare against the repository -- listing them under a changelist, I can monitor them, but neatly tuck them away so I can focus on the real additions I am making.
此外,还有一个提交日志插件,可以输出那些没有与错误跟踪软件集成的SCCS的所有更改的文本。将日志粘贴到票据的工作历史记录中可以捕获文件、它们的版本、日期/时间和分支/标记。太酷了。
我打赌,所有这些都可以通过eclipse中的插件(或未来的增强)来支持;然而,Intellij使这变得轻而易举。
最后,我真的很高兴主流对这款产品的喜爱——按键,所以它很痛苦,但很有趣。
一个非常有用的特性是能够部分构建Maven反应堆项目,以便只包括您需要的部分。
To make this a little clearer, consider the case of a collection of WAR files with a lot of common resources (e.g. JavaScript, Spring config files etc) being shared between them using the overlay technique. If you are working on some web page (running in Jetty) and want to change some of the overlay code that is held in a separate module then you'd normally expect to have to stop Jetty, run the Maven build, start Jetty again and continue. This is the case with Eclipse and just about every other IDE I've worked with. Not so in IntelliJ. Using the project settings you can define which facet of which module you would like to be included in a background build. Consequently you end up with a process that appears seamless. You make a change to pretty much any code in the project and instantly it is available after you refresh the browser.
非常简洁,而且非常快。
我无法想象在没有它的情况下,在像YUI这样的东西中编写一个返回到DWR/SpringMVC的前端。