Missing and extra parens not highlighted in java files

In my install, missing and extra parens are highlighted as errors in js and cfml files, but not in java files.

Do others see this? Is there some setting I missed that could cause it?

Thanks,
Dave

4 comments
Comment actions Permalink

I'm not seeing that issue in  11.1.1. Since extra/missing parentheses is a compile issue, I would not imagine it is an inspection setting. Sometimes when I get weird things like that, running File > Invalidate Caches and then restarting will solve them.

0
Comment actions Permalink

Thanks for your reply Mark.

Are you saying you *do* see missing and extra parens highlighted in your editor? You mention that it's a compile error; are you saying you see that warning in the editor after you run a compile, and not before?

I work much more in cfml and js (and other things) than in java. In those other (dynamic) languages, I'm used to seeing many kinds of errors highlighted in IDEA before I run the code, and it's a great timesaver.

Does IDEA not provide that convenience for java, figuring compilation will catch it? It will of course, but IDEA flags lots more complicated things than that all the time, and that in other languages, so I'm a bit suprised.

Thanks again,
Dave Merrill

0
Comment actions Permalink

Sorry for the confusion. IDEA does highlight ant parenthesis imbalance as an error.
screenshot-01.png
When I said that it was a compile error, what I meant was that it is a core Java Syntax error. As such, it is covered by IDEA's overall syntax inspection and not by a specific inspection that might have been turned off (such as say the "possible NullPointerException" inspection). As long as you have you syntax inspection on, you should see the warning. Hector the inspector in the lower right corner of the status bar will tell you the status of your inspection settings:
screenshot-03.png
You can click him to make a change:
screenshot-02.png

So to answer this question:

Does IDEA not provide that convenience for java, figuring compilation will catch it?

It does provide such a convience.

Did you try running the invalidate caches as I suggested? Like I said, sometimes that will fix some the weird things like this. If the caches become corrupt, it can cause weird issues.

0
Comment actions Permalink

Ok, got it, thanks.

It appears that it's just the one file I happened to notice this on. Inspections are all the way on, and I get red highlighting and a red error bar in the gutter on the right in other files, including java, when there are missing or exra parens, but neither of those in that one file. I did the invalidate thing, no change.

That one file is probably kond if weird to parse; it's the main bits of a code generator, full of escaped code strings that are getting written to a file. I'd guess that IDEA is having a hard time building its usual structure for it, even though the structure pane looks normal from what I can see. The symtoms of unparsable code that I usually see -- glaringly obvious complaints about code that's actually legal -- aren't happening here, but still, that must be the problem.

Thanks for being explicit about what to expect, it prompted me to look further.

Dave

0

Please sign in to leave a comment.