Posts Tagged ‘Code Assistance’

Javadoc improvements in IntelliJ IDEA 10.5

Wednesday, March 23rd, 2011

We are coming close to opening the Early Access for IntelliJ IDEA 10.5 which we have announced some time ago. So, we are starting a series of blog posts that will describe some additions we are introducing in this new release.

Here is a list of newly added features that simplify working with Javadocs even more. Note that all of them are available in both Ultimate and Community Editions:

  • Smart enter — caret moves to an expected position after pressing ‘Enter’ in situations like the one below:
    /**
     * <ul>
     *     <li>[caret]
     *         [caret moves here on Enter]
     * </ul>
     */
    class Test {
    }
  • Automatic insertion of closing tag — controlled by a corresponding new setting that resides under ‘IDE Settings | Editor | Smart Keys’;
  • Customizable font size — documentation popup font size can be changed on the fly with Ctrl+mouse wheel or via a dedicated GUI control:

Stay tuned for the news about IntelliJ IDEA 10.5 EAP availability!

Intelligent Groovy Coding Assistance

Tuesday, August 4th, 2009

As most of you would know, IntelliJ IDEA includes intelligent Groovy support. We have created two live demos that demonstrate how you can effectively use IntelliJ IDEA to build your Groovy applications: Transparent Groovy Assistance and Groovy Specific Support.

Finding Spring Beans Quickly

Thursday, March 12th, 2009

You can quickly find Spring Beans in your context files: simply press Ctrl+Alt+Shift+N (or invoke Symbol command from the Go To menu) and start typing a bean name — IntelliJ IDEA will find it for you in no time.

For example:

Using Local History to restore deleted files

Monday, January 28th, 2008

Suppose you have accidentally deleted a file from your project, and want to have it back. Sure, you can restore it using the file system, but IntelliJ IDEA suggests a better way to do it, without leaving the IDE.
This is where IntelliJ IDEA’s local history on the project or folder level comes to help, preserving all modifications that affect the nested files, including the changes to the contents and to the file tree in general. Each change is marked with its time stamp, revision, and action description. Unlike version control that keeps track of the committed revisions only, the local history preserves all local changes you make as you edit, compile or test, during few days (it is up to you to define how long you want this history to be). This “personal version control” will help us restore the deleted file.
In the example below, a file Lost.txt has been deleted from the FontChooser project. Let’s try to restore it. Go to the Project tool window and right-click the project node or just a folder, where the file used to exist:

On the context menu, choose Local History, and click Show History on the submenu:

The local history view for a project or folder shows you everything that you have done during the last few days. In the Action column of the lower part of the dialog box, select the action you want to roll back. In our case, this is the “Deleting” action. So doing, the upper part of the dialog box shows the tree view of changed files.
If you want to restore the deleted file only, regardless of the other changes that have been done since then, you can select the file Lost.txt in the tree view and click the Revert button on the upper toolbar. The file will be restored silently.

A different situation occurs, if you want to restore the deleted file and the whole project or folder state as of a certain revision. In this case, place the cursor on the revision prior to the “Deleting” action, or on the action itself, and click the Revert button on the lower toolbar. If the other files have been changed since the “Deleting” action, you will be prompted that the other changes will be reverted too. Look again at the Project view – our file is here:

Technorati tags: ,

IntelliJ IDEA Local History: A Life Saver

Saturday, June 9th, 2007

Some of you may not be aware of the fact that IntelliJ IDEA constantly tracks any changes you make to the project files. On the other hand, people who have used it for a while, call this feature a real life saver. The fact is, that IntelliJ IDEA maintains an internal changelist every time you’re editing, compiling or checking them out from a VCS — with the help of the Local History feature. This is why we decided to film a short live voice demo to get you familiar with the benefits of Local History.

So, what’s in it for you? Simply - you are always on the safe side because you can revert or repeat any change to any file in just few clicks. The Local History is equipped with an advanced Diff Tool which lets you spot the differences at a glance and manage them on the fly.

Local History is your personal VCS which you can use either standalone or in combination with your project VCS like Subversion, ClearCase or Perforce. Either way it extends your capabilities of controlling source code changes and provides more flexible way to managing them.

Local History: Advanced Diff Tool

Watch this feature live in Local History Voice Demo

Technorati tags: , , , ,

Using Smart Line Joins

Friday, March 16th, 2007

Here’s a handy feature for those times when you want to clean up your code a little. When you want to condense two or more lines into one, you would normally use Home or End and then Delete or Backspace. But not all Java statements can be so easily combined, and joining lines manually can become a tedious time-waster. Thankfully, IntelliJ IDEA adds a little extra intelligence by providing the Smart Line Join editor command.

For example, when a String concatenation expression spans multiple lines, it can be a pain to delete the quotes and plus signs, but Smart Line Join will handle this with just one shortcut.

Joining string literals

With the cursor on the first line, press Ctrl-Shift-J and the String literals on both lines are joined together, removing the redundant concatenation:

String literal after joining

Likewise, when a declaration and initialization of the same variable are split onto two lines, they are quickly joined into one line.

Joining declaration and initialization

Press Ctrl-Shift-J and the initialization is embedded into the declaration:

Initializtion and declaration joined

The Smart Line Join feature is also able to handle other not-so-simple joins, like joining several line-comments (//) joined into a single line-comment, etc.

This article was originally posted in JavaLobby Tips by Rob Harwood
Technorati tags: , , ,