在IntelliJ中有可能在Eclipse中是不可能的? [英] Things possible in IntelliJ that aren't possible in Eclipse?

查看:182
本文介绍了在IntelliJ中有可能在Eclipse中是不可能的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



作为一个巨大的Eclipse粉丝,但没有时间到尝试IntelliJ,我有兴趣从IntelliJ用户那里听到有关ex-Eclipsians的一些具体内容,您可以使用IntelliJ对Eclipse进行操作。



注意:这不是主观问题,也不意味着成为IDE的圣战。 请降低任何火焰的答案

解决方案



CTRL-click将您带到点击对象的位置,无处不在 - 不仅在Java代码中的Java类和变量中,而且在Spring配置中(您可以点击类名,属性或bean名称),在Hibernate中(您可以单击属性名称或类或包含的资源),您可以在Java类中单击以在Spring或Hibernate bean中使用它;单击包含的JSP或JSTL标签也可以使用,ctrl-click JavaScript变量或函数可以将您定位到该位置,或者显示一个菜单,如果有多个位置,包括HTML或JSP中的其他.js文件和JS代码文件



许多languaries的自动完成



Hibernate



在HSQL表达式中的自动完成,在Hibernate配置(包括类,属性和DB列名称)中,在Spring配置中

 属性name =propNameref =<命中CTRL-SPACE> 

,它将显示您可以注入该属性的那些bean的列表。



Java



Java代码中非常聪明的自动填充:

  interface Person {
String getName();
String getAddress();
int getAge();
}
// ---
人p;
String name = p。< CTRL-SHIFT-SPACE>

,它只显示了 getName() getAddress ) toString()(只有它们按类型兼容),并且 getName()是列表中的第一个,因为它具有更多的相关名称。仍然在EAP中的最新版本8有更多的智能自动完成。

 界面国家{
}
接口地址{
String getStreetAddress();
String getZipCode();
国家getCountry();
}
接口Person {
String getName();
地址getAddress();
int getAge();
}
// ---
人p;
国家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(){
返回我是+ this.getName()+from+ this.get< CTRL- SPACE取代;
}

,它只显示 getName() getAddress(),无论你在项目中的其他JS对象中有多么可能获得*方法,并且ctrl-click this.getName()可以让你到这里定义,即使您的项目中还有其他一些 getName()功能。



HTML



我是否提到自动填充和ctrl-click文件路径,例如< script src =,< img src =等?



HTML标签属性中的自动填充。自动完成HTML标签的样式属性,包括属性名称和值。类属性中的自动完成。

键入< div class =< CTRL-SPACE>,它将显示您项目中定义的CSS类的列表。选择一个,ctrl单击它,您将被重定向到其定义的位置。



轻松自己的语言高光



最新版本有语言注入,所以你可以声明你自定义的JSTL标签通常包含JavaScript,它将突出显示其中的JavaScript。

 < ui:obfuscateJavaScript>函数something(){...}< / ui:obfuscateJavaScript> 





您可以使用任何Java类或方法的查找使用,它会发现它不仅包括Java类,而且包括Hibernate,Spring,JSP等。重命名方法重构不仅在Java类中,而且包含注释的重命名方法(不能确定注释中的字符串是否是真正的方法名称,因此它将要求)它会找到只有你的方法,即使有另一个类的方法具有相同的名称。
良好的源代码控制集成(SVN支持更改列表,IDEA支持每个源代码控件),可以使用更改创建修补程序,以便您可以将更改发送给其他团队成员,而无需提交。



改进的调试器



当我在调试器的监视窗口中查看 HashMap 时,我看到逻辑视图 - 键和值,上次我在Eclipse中做了它显示的条目与哈希和下一个字段 - 我不是真的调试HashMap ,我只想看看它的内容。



Spring& Hibernate配置验证



它在编辑时验证了Spring和Hibernate配置,所以我不需要重新启动服务器来知道我拼错了类名,或者添加了构造函数参数所以我的Spring cfg无效。



上次尝试时,我无法在Windows XP x64上运行Eclipse。



,它会建议您 person.name person.address
Ctrl-click person.name ,它将导航到个人类的 getName()方法。



键入 Pattern.compile(); put \\在那里,点击CTRL-SPACE,看到有用的提示你可以把你的正则表达式。您还可以在这里使用语言注入 - 定义您自己的方法,它使用字符串参数,在IntelliLang选项对话框中声明您的参数是正则表达式,并且还将给您自动完成。不必说,它突出显示不正确的正则表达式。



其他功能



我没有几个功能肯定存在于Eclipse中。但是我们团队中至少每个使用Eclipse的成员,也使用一些合并工具来合并本地更改与源代码控制(通常为WinMerge)的更改。我从来不需要它 - 在IDEA中合并对我来说已经够了。通过3次点击,我可以看到源代码控制中的文件版本列表,再点击3次,我可以比较以前的版本,或以前的版本和当前的版本,并可能合并。



它允许要指定我需要 WEB-INF \lib 文件夹中的所有.jars,而不是单独挑选每个文件,所以当有人将新的.jar提交到该文件夹​​中时,它会选择它自动上传。



上面提到的可能是它的10%。我不使用Maven,Flex,Swing,EJB和很多其他的东西,所以我不知道如何帮助他们。但是这样做。


I have heard from people who have switched either way and who swear by the one or the other.

Being a huge Eclipse fan but having not had the time to try out IntelliJ, I am interested in hearing from IntelliJ users who are "ex-Eclipsians" some specific things that you can do with IntelliJ that you can not do with Eclipse.

Note: This is not a subjective question nor at all meant to turn into an IDE holy war. Please downvote any flamebait answers.

解决方案

CTRL-click works anywhere

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.

Autocomplete for many languagues

Hibernate

Autocomplete in HSQL expressions, in Hibernate configuration (including class, property and DB column names), in Spring configuration

<property name="propName" ref="<hit CTRL-SPACE>"

and it will show you list of those beans which you can inject into that property.

Java

Very smart autocomplete in Java code:

interface Person {
    String getName();
    String getAddress();
    int getAge();
}
//---
Person p;
String name = p.<CTRL-SHIFT-SPACE>

and it shows you ONLY getName(), getAddress() and toString() (only they are compatible by type) and getName() is first in the list because it has more relevant name. Latest version 8 which is still in EAP has even more smart autocomplete.

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>

and it will silently autocomplete it to

Country c = p.getAddress().getCountry();

Javascript

Smart autocomplete in 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>;
}

and it shows ONLY getName() and getAddress(), no matter how may get* methods you have in other JS objects in your project, and ctrl-click on this.getName() brings you to where this one is defined, even if there are some other getName() functions in your project.

HTML

Did I mention autocomplete and ctrl-clicking in paths to files, like <script src="", <img src="", etc?

Autocomplete in HTML tag attributes. Autocomplete in style attribute of HTML tags, both attribute names and values. Autocomplete in class attributes as well.
Type <div class="<CTRL-SPACE> and it will show you list of CSS classes defined in your project. Pick one, ctrl-click on it and you will be redirected to where it is defined.

Easy own language higlighting

Latest version has language injection, so you can declare that you custom JSTL tag usually contains JavaScript and it will highlight JavaScript inside it.

<ui:obfuscateJavaScript>function something(){...}</ui:obfuscateJavaScript>

Indexed search across all project.

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.

Improved debugger

When I look at HashMap in debugger's watch window, I see logical view - keys and values, last time I did it in Eclipse it was showing entries with hash and next fields - I'm not really debugging HashMap, I just want to look at it contents.

Spring & Hibernate configuration validation

It validates Spring and Hibernate configuration right when you edit it, so I do not need to restart server to know that I misspelled class name, or added constructor parameter so my Spring cfg is invalid.

Last time I tried, I could not run Eclipse on Windows XP x64.

and it will suggest you person.name or person.address. Ctrl-click on person.name and it will navigate you to getName() method of Person class.

Type Pattern.compile(""); put \\ there, hit CTRL-SPACE and see helpful hint about what you can put into your regular expression. You can also use language injection here - define your own method that takes string parameter, declare in IntelliLang options dialog that your parameter is regular expression - and it will give you autocomplete there as well. Needless to say it highlights incorrect regular expressions.

Other features

There are few features which I'm not sure are present in Eclipse or not. But at least each member of our team who uses Eclipse, also uses some merging tool to merge local changes with changes from source control, usually WinMerge. I never need it - merging in IDEA is enough for me. By 3 clicks I can see list of file versions in source control, by 3 more clicks I can compare previous versions, or previous and current one and possibly merge.

It allows to to specify that I need all .jars inside WEB-INF\lib folder, without picking each file separately, so when someone commits new .jar into that folder it picks it up automatically.

Mentioned above is probably 10% of what it does. I do not use Maven, Flex, Swing, EJB and a lot of other stuff, so I can not tell how it helps with them. But it does.

这篇关于在IntelliJ中有可能在Eclipse中是不可能的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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