分享
 
 
 

IntelliJ IDEA 4 新特性 之 On-the-Fly Code Analysis(动态代码分析)

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Intelligent error highlighting(智能突出显示错误)

All common syntax errors, as well as all other errors that would be detected during compilation, are highlighted in the source code so you do not need to compile your code in order to find all your mistakes. Each error is highlighted in the editor and has the corresponding red link on the right gutter area for easy navigation to the erroneous places, which is especially useful when working with large files.

所有常见的语法错误以及其他一些可以被发现的编辑错误,都会在源代码里被突出显示。这意味着,你不用编译程序就可以发现你所有的错误。错误突出会用红色的波浪下划线标示,你可以轻易的找到它,这个功能在大的源文件编辑时尤为突出。

JavaDoc error highlighting(JavaDoc错误突出)

IDEA knows general javadoc rules, such as structure and syntax, and will detect any common inconsistencies found in your javadoc comments, e.g. wrong parameter references, return attributes in the field or void method comments, etc.

Having found an unknown javadoc tag, IDEA will suggests that you add this tag to the known tags list, so that you never get an error or warning indications about it.

IDEA晓得一般的JavaDoc一些关于结构和语法的规则,而且会发现一些在你的JavaDoc中相矛盾的地方,比如,不一致的参数申明,返回局部变量或没有返回值方法的注释等等。当发现一个未知的JavaDoc Tag 时,IDEA会提醒你将这个Tag加入到已知Tag列表中,这样就再也看不到关于这个Tag的错误和警告提示了。

Detecting deprecated symbols(发现不合法的标识符)

If any deprecated code is used in any class or interface, IDEA will recognize it and highlight the corresponding statements directly in the editor.

如果有任何不合法的代码在你得class或interface里,IDEA会找出它,并在编辑器里直接标记出它。

Highlighting unused imports, throws declarations and other unused symbols(突出显示没有被使用的import和 throw声明以及其他没有使用的标识符)

IDEA will point out all redundant import statements, throws declarations and other unused symbols (like variables and methods), and will highlight them in the editor with the corresponding links on the right gutter area for easier navigation. More information on other code analysis features can be found here.

IDEA将会指出多余的import和throw声明,以及其他的多余的方法和变量标识符,并将在编辑器里突出显示他们,并给出相应的建议,你可以轻易找到它们。你也可以从提示意见里获得更过的相关信息。

Import Assistant - helps to automatically insert import statements while typing code, and detects non-imported classes found in pasted blocks of code(Import助手——在编辑代码时帮你自动插入import声明,并自动找出你粘贴代码时没有导出的class)

When you use the name of a class from anywhere in a project library, but the class has not been imported into the current file, a hint with the suggestion to import the class pops up over the text. Pressing Alt + Enter inserts the import statement. Moreover, when you copy a block of text from one file and paste it into another, IDEA automatically detects all the classes that are used inside the copied block but have not been imported to the destination file. It then shows a list of all such classes and allows you to select classes you want to import into the new file.

当你随便使用一个package里的class时,而且这个class没有在当前文件中声明时,就会有一个提示来建议你import一些有这个class声明的package,你只需按下Alt + Enter就会import相应package了。当然,这个功能也会在你粘贴代码时起作用,他会提示出所有需要import的package。IDEA还会给出一个列表让你选择呢?

Intention actions(意图识别)

When you are typing your source code, know that IDEA is always one step ahead of you. For example, if you assign a value to a variable that represents an instance of one of its ancestors, IDEA will immediately interpret your intention as wanting either to cast the ancestor type to the variable type or to define the type of variable the same as the ancestor. A light bulb will appear suggesting that you perform one of these two operations. Also you can start using a method before it has been declared. When this occurs, IDEA’s light bulb popup will appear suggesting you create a new method from its usage. If you accept the suggestion, the new method will be created in the corresponding class. More features related to automatic code generation in IDEA are described here.

当你在输入源代码时,IDEA会知道你下一步将会做什么。例如,当你成声明一个继承于某个父类的变量时,IDEA会认为是是不是需要继承一些父类的声明。有一个小灯泡出现会提示你完成这些操作。当你写一个方法时也是这样。如果你接受了“小灯泡”的建议,你需一点,他就会自动帮你完成。(意译,可能有出入,但易于理解)

Visual indication of overriding/overriden and implementing/implemented methods(醒目的指出override和implement的方法)

Special signs (

and
) on the left gutter area of the editor indicate that the current method overrides or implements the corresponding method of an ancestor class/interface. Moving the mouse to one of these symbols will bring up a tooltip with the base method details. If you click the symbol, the corresponding class/interface will be immediately opened in the editor, with the caret automatically positioned at the base method.

When icons

or
are shown, it means that the method is overriden or implemented in inheriting classes. Pressing the icon will open a lookup list with these classes, for selecting the desired one to open at the corresponding method.

用符号(

) 在代码的左边标示出当前方法是否是重载或实现了父类或接口的相应方法. 移动鼠标到这些符号上,将会显示出父类是显得的详细细节。如果你点击鼠标, 相应的父类实现就会出现在编辑器里,并自动定位到那个方法上。

当符号

出现时,就意味着这个方法需要重载或实现与父类的方法。 点击鼠标就会弹出相应的列表让你在其中选择一个方法。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有