Type-aware highlighting

Type-aware highlighting is a part of error highlighting that relies on type system.

Some errors can be found without using type information, for example:

Other errors, however, require a knowledge of entities type:

Type-aware highlighting allows to spot such errors before compilation.

Why isn’t it enabled by default?

The feature is in beta (or maybe in alpha) and sometimes may report “false errors” in regular code. Usually, such “errors” “found” only in a truly complex code, and, normally, everything works just fine.

Scala plugin doesn’t rely on compiler to analyze code. We’re implementing our own model of the language, and sometimes it’s challenging, especially when it comes to Scala’s type system and type inference (to size up the problem, you may try to formally “infer” a type of “foo”.map(_ + 1) expression by hand).

Should you enable it?

Unless such highlighting produces too much false “red code” in your project, you can benefit from better code analysis. It’s recommend to try type-aware highlighting in a particular project to evaluate whether it’s good there.

How to configure it?

In every project (with at least one Scala facet used) IDEA initially suggest to try type-aware highlighting, so you may configure it right off the bat:

You can always toggle type-aware highlighting using Ctrl+Alt+Shift+E shortcut or by clicking the highlighting icon on statusbar:

There’s a notification shown on each highlighting status change:

How to deal with false errors?

So, the truth is you have to remember that sometimes there’s no spoon error.
To help us to fix a highlighting glitch you may report it to YouTrack as usual or by pressing Alt+Enter on wrong highlight:

About Pavel Fatin

IntelliJ Scala plugin developer (http://pavelfatin.com)
This entry was posted in Uncategorized. Bookmark the permalink.

19 Responses to Type-aware highlighting

  1. Alain O'Dea says:

    I have been very happy with this feature. Besides some issues with XML patterns and DSL applications like Squeryl (both known and acknowledged in YouTrack) this works very well. It gets better with every nightly and is a very helpful way of seeing errors early without having to compile.

  2. wolverian says:

    It seems pretty crazy to implement your own Scala type inferencer. The presentation compiler isn’t powerful/usable enough?

  3. v6ak says:

    Great. But I don’t uderstand such crazy keyboard shortcut :(

  4. Chris Cobb says:

    I don’t see this features in intellij 12.1 CE on the mac (no icon on the bottom, trying the toggle shortcut and various mac equivalent bindings had no effect). Is this a UE only feature?

  5. Chris Cobb says:

    update: I just noticed that I’m in a java project and this is a feature of the scala plugin. Is it safe to say this is a scala only feature?

  6. my father have lots and numerous collectible coins that are very precious and uncommon,,

  7. Just a smiling visitant here to share the love (:, btw great design. “The price one pays for pursuing a profession, or calling, is an intimate knowledge of its ugly side.” by James Arthur Baldwin.

  8. read more... says:

    I’m extremely impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a great blog like this one nowadays..

  9. websites says:

    Simply wish to say your article is as surprising. The clearness in your post is simply spectacular and i could assume you’re an expert on this subject. Well with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please carry on the enjoyable work.

  10. Something else is that while looking for a good on the internet electronics store, look for web shops that are continuously updated, trying to keep up-to-date with the latest products, the perfect deals, in addition to helpful information on product or service. This will make certain you are handling a shop which stays ahead of the competition and give you what you should need to make intelligent, well-informed electronics buying. Thanks for the critical tips I have learned through your blog.

  11. more.. says:

    I am so glad I identified this weblog. Thank you for the information. You make a whole lot of excellent points in your post. Rated 5 stars!

  12. web page says:

    Sweet blog! I found it while surfing around on Yahoo News.
    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get
    there! Thank you

  13. PVC rails says:

    Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It’s very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.

  14. Donte says:

    I recommend buying one of the cheap Points2Shop items listed here to verify your address and level up your honor.
    I’ve managed to generate 3-4 hundred points from completing
    daily surveys during my spare time after college classes.
    Shifting World is based on the Shift series of games from developer
    Armor Games and this time around will be developed
    by Fishing Cactus specifically for the handheld. The term QR code itself is
    a registered trademark of Denso Wave Incorporated.
    Some smartphones that have this ability (either with a preloaded app, or with
    a downloaded app): Blackberry, Nokia, Android and Nintendo 3DS.

  15. fantastic post, very informative. I wonder why the other specialists of this sector do not notice this. You should continue your writing. I’m confident, you have a huge readers’ base already!

  16. sbobet 666 says:

    The right tie accessories can ensure you look professional and help you stand out for
    the right reasons. Affirmation for confidence not only boosts your morale but also
    refines your sense of compassion towards your fellow athletes.
    The engine placement meant a low center of gravity
    and easy riding characteristics. Below, it’s explained
    as to who is eligible and renter insurance for student sport pilots.

    my web page … sbobet 666

  17. The Windows Identity Foundation is a technology that helps simplify user access for developers by externalizing user access from applications.
    Other fonts may be substituted if they are
    not embedded in a PDF. An XDP can also package a PDF file, along with XML form and template data.

  18. I think this is one of the most vital information for me.
    And i am glad reading your article. But should remark on some
    general things, The site style is great, the articles is really nice :
    D. Good job, cheers

    Here is my web site – empower network review

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 class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">