img dext

Intellij IDEA 4 新特性 之 Code Editing (代码编辑)

发表于2004/4/15 17:33:00  1419人阅读

分类: Java

Editing files with syntax highlighting(文件编辑时语法突出)

IDEA supports the editing of Java™, JSP, XML, HTML files, as well as custom file types that can be easily defined to be recognized and properly highlighted by the editor.

(IDEA支持对 Java™, JSP, XML, HTML等文件的语法突出编辑,即使是自定义的文件,也可以通过代码编辑器来使得其可以被识别和语法突出化)

Advanced Code Completion(先进的代码完成功能)

Code completion

Basic code completion finalizes a class, method, variable name, and Java keywords, plus commonly used names for fields and variables depending on their type. It can be automatically invoked, popping up the available methods and fields list.

Basic代码完成 可以完成对类、方法、变量名和Java关键字的识别,根据不同的类型,可以从自动弹出的列表框中选择已有的方法和域 名)

The SmartType code completion filters the method and variable list to match the expected expression type. It works at the right-hand side of assignments, in variable initializers, return statements and anywhere else where IDEA can guess the expected type.


The Class Name code completion finishes a class name anywhere in the project or libraries independently of imports in the current file.

Class Name 代码完成可以在任何工程、库以及当前独立的文件中帮你完成类名字的书写)

Closing brace auto-insert(复合语句的自动插入(前后括号自动匹配))

Auto Indent

Start a code block with an opening curly brace character and press Enter.
The corresponding closing brace is automatically inserted with the indentation specified in your preferences.


Matched brace highlighting(匹配括号的突出显示)

Brace matching

Place the Editor caret just after a closing (or just before an opening) brace or bracket of any type. If it is correctly matched, the matching pair highlights with light blue. If there is no matching bracket, the unpaired bracket highlights as a compile error. (You can change the default highlight colors in your configuration).


Pasted text auto-indent(粘贴代码自动缩进)

Formatted from paste

Paste a block of text into your code and IDEA automatically indents it to fit the new location.


Live Templates(动态模板)

Live template

Live Templates provide a fast way to code many typical constructs. Just type the Live Template name, press Tab, and the relevant code... simple or highly complex... is written to your file instantly. When you insert code from a Live Template, IDEA analyzes your existing code and suggests correct values for the template’s variables. Now you can apply Live Templates not only at a particular caret position, but for selected blocks of code/text as well.


Express code commenting(快速代码注释)

Use a single keystroke to quickly comment/uncomment a selected line or block with either block (/*…*/) or line (//…) comments. Comments insert at the first column, or at the indentation level, depending on your preferences.


Popup parameter info(参数弹出提示)

Parameter info

When coding a new method call, a tooltip showing the target method’s signature pops up after you type the opening “(” character or invoke code completion features. The parameter highlighted in bold is the one on which the caret is currently positioned. You can control the popup interval or disable the popup completely in Completion settings.

(当输入一个新的方法时,在输入“(”后就会有这个方法参数的弹出提示,当前参数将会以粗体显示,你可以在Completion settings中控制是否弹出,和弹出延时)

Code folding(代码折叠)

Code folding

Easily “fold” and “unfold” methods, Javadoc comments, or blocks of import statements, putting distracting detail out of your way. Fold/unfold a single block or everything in the file at once with a single keystroke.


Mouse over «folded» code icons to pop up the hidden detail for quick examination.


Split-pane editor(双块代码编辑)

Split-pane editor

Split the Editor into two half panes to work in two different places in the same file simultaneously. Move the pane splitters to adjust the size of the panes.


Clipboard stacking(超级剪贴版)

Clipboard stacking

Now store multiple clipboard entries and access them with a single shortcut. Customize the number of entries that can be stored in the clipboard stack.


0 0



取 消