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

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.


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.


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)

Import assistant

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(意图识别)

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.


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

Special signs (overrides and implements) 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 overriden or implemented 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.

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

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

  • 0
  • 0
  • 打赏
  • 1


  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论 1




¥2 ¥4 ¥6 ¥10 ¥20
余额支付 (余额:-- )



钱包余额 0