Live syntax checking?

I'm new to using Scala and trying to work through some programming
exercises to get up to speed.

I'm having quite a few problems with actual syntax - mostly accidentally
using Java syntax instead of Scala syntax - that is NOT identified as
erroneous by the syntax checker.

I realize that the plug-in is not a final release yet - is syntax
checking just one of the areas that is still under development?

It's very frustrating for me, being used to the exceptionally helpful
Java syntax checking, to see nothing but green in the editor window only
to get compile errors. Actual compile errors - who would have thought?

0
9 comments

In my experience, there is very little mis-diagnosed Scala syntax in the current IDEA plug-in.


Randall Schulz

0

Randall Schulz wrote:

In my experience, there is very little mis-diagnosed Scala syntax in the current IDEA plug-in.


Are you saying that I should submit bug reports for false negatives?

Donald

0

Sure. How certain are you that they're erroneous? Could you post some examples here?

The one remaining defect I know of is the flagging as red of non-object values with initial upper-case names used as match extractors. Most commonly this is a Regex instance.


Randall Schulz

0

Randall Schulz wrote:

Sure. How certain are you that they're erroneous? Could you post some examples here?


Well, if I compile the file and it give me a compiler error - that means
that it is erroneous by definition. (since the compiler is the ultimate
arbiter of erroneous)

For example - I wrote the code shown below. "factorizeCurrent" hasn't
been written yet. When I compile the file, I get the error message
"Error:Error:line (26)error: block must end in result expression, not in
definition". Yet, the syntax checker has no problem with it. What I
SHOULD get is an error squiggle and an intention to define the function.
That's how IDEA works for Java - why should it do any less for any other
allegedly supported language?

     def factorize(value : Int): Unit = {

         var current = factorizeCurrent(value)


     }

0

I certainly get a red under-squiggle when I end a block in a val definition.

But you might be suffering from a mismatch between the Scala dialect (2.7 vs. 2.8) between IDEA and your compilation environment.


Randall Schulz

0

Randall Schulz wrote:

I certainly get a red under-squiggle when I end a block in a val definition.

But you might be suffering from a mismatch between the Scala dialect (2.7 vs. 2.8) between IDEA and your compilation environment.


Ah. Ok - is the nightly build the only way to get a 2.8 download? I
would prefer something moderately stable since I am still trying to
learn the language.

0

I'm still sticking with 2.7. My recommendation for learners is to do the same. 2.8 is still a moving target and nightly builds are understandbly of varying quality.

Randall Schulz

0

Randall Schulz wrote:

I'm still sticking with 2.7. My recommendation for learners is to do the same. 2.8 is still a moving target and nightly builds are understandbly of varying quality.


That's what I expected. Should I be using a different version of the
Scala plug-in then? (I'm running IDEA 90-193 with plug-in version 0.3.108)

0

No, I don't believe it works that way. As I understand it, the plug-in adapts to the Scala release you've configured as a dependency in your project.

Randall Schulz

0

Please sign in to leave a comment.