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.
所有常見的語法錯誤以及其他一些可以被發(fā)現(xiàn)的編輯錯誤,都會在源代碼里被突出顯示。這意味著,你不用編譯程序就可以發(fā)現(xiàn)你所有的錯誤。錯誤突出會用紅色的波浪下劃線標示,你可以輕易的找到它,這個功能在大的源文件編輯時尤為突出。
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一些關(guān)于結(jié)構(gòu)和語法的規(guī)則,而且會發(fā)現(xiàn)一些在你的JavaDoc中相矛盾的地方,比如,不一致的參數(shù)申明,返回局部變量或沒有返回值方法的注釋等等。當發(fā)現(xiàn)一個未知的JavaDoc Tag 時,IDEA會提醒你將這個Tag加入到已知Tag列表中,這樣就再也看不到關(guān)于這個Tag的錯誤和警告提示了。
Detecting deprecated symbols(發(fā)現(xiàn)不合法的標識符)
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聲明,以及其他的多余的方法和變量標識符,并將在編輯器里突出顯示他們,并給出相應的建議,你可以輕易找到它們。你也可以從提示意見里獲得更過的相關(guān)信息。
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會認為是是不是需要繼承一些父類的聲明。有一個小燈泡出現(xiàn)會提示你完成這些操作。當你寫一個方法時也是這樣。如果你接受了“小燈泡”的建議,你需一點,他就會自動幫你完成。(意譯,可能有出入,但易于理解)
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.
?用符號(?和 ) 在代碼的左邊標示出當前方法是否是重載或?qū)崿F(xiàn)了父類或接口的相應方法. 移動鼠標到這些符號上,將會顯示出父類是顯得的詳細細節(jié)。如果你點擊鼠標, 相應的父類實現(xiàn)就會出現(xiàn)在編輯器里,并自動定位到那個方法上。
當符號??或 出現(xiàn)時,就意味著這個方法需要重載或?qū)崿F(xiàn)與父類的方法。?點擊鼠標就會彈出相應的列表讓你在其中選擇一個方法。