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.

25 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. van wrapping says:

    Thank you a bunch for sharing this with all of us you really recognise what you’re talking approximately! Bookmarked. Kindly additionally consult with my website =). We will have a link trade arrangement between us

  5. 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?

  6. 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?

  7. German says:

    It can be a good choice for you, you earn $25 per
    order form your Web site and have garcinia cambogia side effects you up and running.
    Garcinia Cambogia is a step in the right direction garcinia cambogia side effects and I always strive to make him proud.
    Visits to practitioners of alternative medicine. The
    fact that this plant is similarly used in curing diarrhea and
    even dysentery in individuals. Others eat when they are put
    out for sale.

    My blog; garcinia cambogia trial (German)

  8. Hello, I think your site might be having browser compatibility issues.
    When I look at your blog site in Opera, it looks fine but when opening in
    Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up!
    Other then that, terrific blog!

    Here is my web-site blog beast reviews

  9. Decouvrir mon nouveau blog : Sutter

  10. I will straight away grasp your rss as I can not obtain your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly permit me recognize so that I might subscribe. Thanks.

  11. The cast is hands-down the standout reason why this movie operates.

  12. quite good post, i certainly enjoy this incredible website, persist with it

  13. Simply wanna input that you have a very nice web site , I enjoy the pattern it really stands out.

  14. My partner and I stumbled over here from a different
    web page and thought I should check things out.
    I like what I see so now i am following you. Look forward to looking over your web page again.

    my blog; Top Eleven Tokens

  15. I’m curious to find out what blog platform you are using? I’m having some small security difficulties with my latest website and I would like to locate something much more secure. Do you have any solutions?

  16. quite nice post, i actually really like this internet internet site, keep on it

  17. Hello to every one, because I am in fact keen of reading this
    blog’s post to be updated regularly. It consists of good stuff.

  18. Thanks for revealing your ideas. I’d also like to express that video games have been ever evolving. Today’s technology and innovative developments have made it simpler to create genuine and fun games. All these entertainment games were not as sensible when the actual concept was first of all being tried. Just like other areas of technological know-how, video games also have had to advance by way of many many years. This is testimony on the fast continuing development of video games.

  19. I truly enjoy looking through on this site, it has got excellent articles . “A man of genius has been seldom ruined but by himself.” by Samuel Johnson.

  20. the says:

    After I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the exact same comment. There has to be an easy method you can remove me from that service? Thanks a lot!

  21. you have got an amazing weblog right here! would you like to make some invite posts on my blog?

  22. jrt-ark.info says:

    I am speechless. This is a superb web site and very engaging too. Brilliant work! That’s not really much impending from a amateur blogger such as me, yet it’s all I should have suggest after enjoying one s posts. Superb grammar and vocabulary. Distinct other blogs. Anyone genuinely learn exactly what you’re thinking regarding too. So lot of that you manufactured me want to check out greater. Your own web site is now a stepping mineral into me, my friend. Thank anyone to make the complete voyage. I genuinely enjoyed the 6 posts the I need check out so far.

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