Posts Tagged ‘editor’

New in 11: Javadoc editing improvements

Thursday, October 20th, 2011

Recently I realized that javadoc editing may be easily improved by introducing some handy little features. After using them for a couple of days, I can say they are cool, so, it’s time to share them with you. And you can try them all in the latest IntelliJ IDEA 11 EAP.

The main idea is to ease fulfilling method javadoc stubs that IntelliJ IDEA generates for you:

  • Smart “End”
    Pressing End when the caret is located after javadoc parameter name relocates it to the position where description should start. It respects ‘Align parameters description’ code style setting as well (‘Code Style | Javadoc | Alignment’).
    Before:
    After:
  • Smart “Enter”
    We rather often need to write a multi-line javadoc parameter description. Now pressing Enter preserves previous line indent if a corresponding option is enabled (‘Editor | Smart Keys | Enter | Smart indent’).
    Before:

    After:
  • Smart complete statement
    Corresponding support is added for smart complete statement (Ctrl+Shift+Enter by default).
    Before:

    After:

In-place Replace in IntelliJ IDEA 10.5

Friday, April 29th, 2011

Hi everyone!

Long time ago IntelliJ IDEA got a face-lift for Find functionality where the old Find dialog was replaced with the editor’s toolbar. Now we’re introducing a similar, more comfortable and less modal Replace.

A planned killer is that when you are doing a regular expression replace you can see the result preview in a tooltip, as shown on the screenshot above.

So, try it in a latest IntelliJ IDEA 10.5 EAP and let us know how it works for you.

New in 10.5: Highlighting of HTML tag tree

Wednesday, April 20th, 2011

Recently we’ve added a new code highlighting feature that should make it easier to work with big and complex HTML files, with deep nested tags structure:

Please note that highlighting is only activated when there is more than one tag with the same name in the hierarchy.

By default, only 6 parent tags are highlighted with 6 different colors. You can change the depth to highlight or completely disable the feature in Settings | Editor | Appearance | Enable HTML tag tree highlighting.

Also you can tweak the colors in Settings | Colors & Fonts | HTML.

This feature is very new and we want your opinions. You are welcome to try it in the latest IntelliJ IDEA 10.5 EAP build and let us know what you think.

Custom file types in IntelliJ IDEA

Tuesday, September 14th, 2010

IntelliJ IDEA is a great IDE for Java, Groovy, Flex, Python, Ruby and many other languages. The text editor with camel-hump completion, and version control support are so great that it may be hard to switch to another editor which may lack some useful features. So, when a need arises for me to code in a language that’s not listed on the features page, I just teach IDEA some basics about that language, and feel much more comfortable than I would if I was editing a plain text. Luckily, you don’t have to write a plugin for that, it is possible via the GUI.

Assume you want to edit Haskell code in IDEA. You go to IDE Settings | File Types and press the ‘Add‘ button next to the file types list:

This brings a dialog where you can provide some knowledge about Haskell: case sensitivity, brace matching settings, ways of defining comments and keywords. You can have up to four lists of keywords, which will be colored differently in the editor. And, of course, all of them will be auto-completed.

After you are done with this dialog, all that remains is to assign the *.hs extension to the newly created file type:

And enjoy hacking:

Database Table Editor in IntelliJ IDEA 10

Monday, August 30th, 2010

IntelliJ IDEA X features a simple database table editor and viewer. You can add and remove rows, sort by specific column and choose columns to display just by pressing F4 on a table in the Data Sources view.

If you find the console-like way better than the GUI way, you can still run all those delete from… and insert into… statements in the Database console.

Try this in the latest IntelliJ IDEA 10 EAP and let us know your thoughts on it.

Full-featured IntelliJ IDEA Editor for Injected Language Fragments

Tuesday, August 10th, 2010

You probably know about IntelliJ IDEA’s language injection feature. Right?

IntelliJ IDEA X takes it even further. Now you can edit fragments of code injected in literals in a designated full featured editor with all your changes immediately reflected in the original code.

You do not see all other code around the injected fragment. There’s no need to worry about code escaping. No modal popups. Just do what you need to. The fragment editor opens in a convenient split mode remembering your caret position and closes instantly when Esc is pressed.

The feature is available for any combination of injected language that IntelliJ IDEA supports, e.g. SQL in Java, HTML in JavaScript, and many others.

All the editor functionality including completion, code inspections, intention and code style actions is of course available in the fragment editor.

And a couple of examples. JPA QL fragment editor:

HTML fragment editor:

Your feedback is welcome!

Show Parameter Info in SQL

Monday, June 1st, 2009

In Maia the Show Parameter Info action (Ctrl+P) is available in SQL function calls and value expressions.

Using Scope-Based Code Highlighting

Sunday, May 10th, 2009

One of not so well-known features of IntelliJ IDEA is an ability to differently highlight certain scopes in code editor.

To use it, open the Settings dialog, under IDE Settings expand Editor, then expand Colors & Fonts, and select Scope Based preferences. You will see a list of predefined scopes, and the Edit Scopes button that lets you easily create your own.

Each scope is assigned a distinct color/font scheme — just like different language elements in Java, which makes it easy to distinguish from other code in the editor.

In the following example, it is used to quickly differentiate between real testing code and JUnit Classes (pattern: lib:org.junit..*):



Other use cases include highlighting of, for example, third-party framework code, distinguishing normal code from assertions, etc.