Posts Tagged ‘Editor’

30 Days with IntelliJ IDEA. Editor Basics

Monday, May 20th, 2013

As you remember last week we announced the plans to publish articles from the 30-day guide on getting started with IntelliJ IDEA. The first article was about the user interface. Today we would like to share with you one more article about the editor basics in IntelliJ IDEA.

Structural selection. A definite must-know

Did you know that IntelliJ IDEA provides an alternative way to select code? Structural selection allows you to select expressions based on grammar. By pressing Ctrl + W (Cmd + W for Mac) you keep expanding your selection (starting from the caret). And vice versa, you can shrink it by pressing Shift + Ctrl + W (Shift + Cmd + W for Mac).

(more…)

Groovy support improvements in IntelliJ IDEA 11.1

Tuesday, April 3rd, 2012

Here I would like to tell you about some of the Groovy language support improvements available in IntelliJ IDEA 11.1.

Unused Symbol Highlighting

If a class, method or property is unused even if it is in fact public, you may notice it immediately with new unused symbol highlighting feature.

(more…)

Custom code folding regions in IntelliJ IDEA 11.1

Wednesday, March 7th, 2012

This is a cross-post from WebStorm & PhpStorm blog, originally posted by Rustam Vishnyakov.

This long-awaited feature gives you a possibility to define your own code-folding regions with special line comments.

(more…)

Renewed File Structure in IntelliJ IDEA 11.1

Tuesday, February 21st, 2012

We know that one of the most popular ways to navigate within a file is File Structure popup. We’ve recently redesigned it to make the navigation more comfortable. New File Structure is tree-based and shows everything in your file when you first invoke it with Control+F12.

The following short screencast should explain better what we did.

Did you notice you can use Show Quick Doc and Show Implementations action from File Structure popup?

You can already try it in the latest IntelliJ IDEA 11.1 EAP. Let us know what you think and we can improve it even further before 11.1 is shipped.

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:

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!

Icons Preview in Gutter Bar

Friday, June 26th, 2009

Maia supports preview of icons you are using in Java code directly from the editor. For each of the icon definitions (javax.swing.Icon), Maia tries to locate a file from which it is loaded and then shows a preview in the gutter bar. You can click it to open the image for editing, of course.