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.

14 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.

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="">