Smart Type Completion Becomes Even Smarter

Most of you are aware of IntelliJ IDEA smart type completion feature that is invoked with Ctrl+Shift+Space shortcut. If you are not familiar with this feature, I totally recommend you to read the post about it, because this thing is a real developer’s gem. Besides, in the latest IntelliJ IDEA 8 Milestone 1 release, this gem became even shinier.

Long story short, let’s cut to the chase and inquire into the matter through the examples.

  • Consider we have the following code:
    Collection is expected
    If we press Ctrl+Shift+Space and get no results, because a collection type is expected, we can press Ctrl+Shift+Space again to make IntelliJ IDEA search for arrays with the same component type and suggest to convert them with Arrays.asList() call.
    Collection is expected 2
  • Press Ctrl+Shift+Space twice, and IntelliJ IDEA will search for chained expressions of the expected type.
    Chained Expressions
  • When an array type is expected, but no suggestions can be made in the current context, press Ctrl+Shift+Space one more time. IntelliJ IDEA will search for collections with the same component type and suggest to convert them with toArray() call.
    Array type expected
    Array type expected 2
Technorati tags: , ,
This entry was posted in Tips & Tricks. Bookmark the permalink.

3 Responses to Smart Type Completion Becomes Even Smarter

  1. James Victor Henry III says:

    Fantastic! You are always ahead of competition wrt to suchlike features.

  2. James Victor Henry III says:

    By the way, the default key bindings for IDEA are not OSX/Leopard-friendly. They clash with Spotlight, Spaces, Spotlight, etc. You should review the whole key bindings and have a separate configuration for them on OSX.

  3. dmitryx says:

    please-please-please add drag’n'drop for editor tabs, or shortcuts to move them, like ctrl+alt+right, ctrl+alt+left.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>