Intellij + Lift red lines problem

118 views
Skip to first unread message

Chenguang He

unread,
Jul 28, 2012, 1:36:40 AM7/28/12
to lif...@googlegroups.com
Hey guys,
I am ready curious about the red lines in my Intellij.

Please take a look at following code:


This code works fine, it can be complied in Intellij.

However, I use Intellij open this file. 

I got a lot of red lines.

For example:

 override def validations =
      valMaxLen(64, "Name must be 64 characters or less") _ ::
      super.validations

i got :
Expression of type List[(name.ValueType)=>scala.List[FieldError]] doesn't conform to expected type scala.List[nameValidationFunction]


and 

def whenCreated: DateTime = new DateTime(id.is.getTime)

i got:
can't solve symbol getTime


I don't know why there are "red line" error, but do not effect on the compiler?

Thank you 




Chenguang He




Dennis Haupt

unread,
Jul 28, 2012, 1:47:59 AM7/28/12
to lif...@googlegroups.com
because intellij parses the file itself and therefore can be out of sync
with the compiler.
post a bug here: http://youtrack.jetbrains.com/issues/SCL
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>


--

Chenguang He

unread,
Jul 28, 2012, 1:53:37 AM7/28/12
to lif...@googlegroups.com
I will post them.
I know many people in here who use Intellij. 
How do you guys fix them? or just ignore them?

Chenguang He



Dennis Haupt

unread,
Jul 28, 2012, 3:12:58 AM7/28/12
to lif...@googlegroups.com
i rarely have such errors in my code, so i just report everything and it
gets fixed sooner or later. in library code, i ignore the errors.
as a workaround, it usually helps to specify a type explicitly since out
of sync type inference is the most common reason for such false
positives (at least for me)

Sergey Trofimov

unread,
Jul 28, 2012, 3:31:07 AM7/28/12
to lif...@googlegroups.com
Generally such problems are caused but invalid project structure settings or missing libraries on the computer. Don't you have warnings in Project structure dialog?

Also do you have last scala plug-in installed.

There are still some cases when scala plug-in reports incorrectly, but rarely.

Also I use sbt to compile project instead of IDEA.


--
Sergey Trofimov

Chenguang He

unread,
Jul 28, 2012, 5:25:06 AM7/28/12
to lif...@googlegroups.com
Do you guys enable Type-aware highlighting, what level of it you guys use?

Chenguang He



IL

unread,
Jul 28, 2012, 7:23:22 AM7/28/12
to lif...@googlegroups.com
I enable it most of the time. except for scala 2.10.

compile projects with sbt and ignore those red lines.


IL

Dennis Haupt

unread,
Jul 28, 2012, 7:57:47 AM7/28/12
to lif...@googlegroups.com
there are different levels?
>>>> http://liftweb.net <http://liftweb.net/>
>>>> Code: http://github.com/lift
>>>> Discussion: http://groups.google.com/group/liftweb
>>>> <http://groups.google.com/group/liftweb>
>>>> Stuck? Help us help you:
>>>> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>>>> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> --
>>> --
>>> Lift, the simply functional web framework: http://liftweb.net
>>> <http://liftweb.net/>
>>> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
>>>
>>>
>>>
>>
>>
>> --
>> --
>> Lift, the simply functional web framework: http://liftweb.net
>> <http://liftweb.net/>
>> https://www.assembla.com/wiki/show/liftweb/Posting_example_code <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
>>
>>
>>
>>
>>
>>
>> --
>> --
>> Lift, the simply functional web framework: http://liftweb.net
>> <http://liftweb.net/>

Diego Medina

unread,
Jul 28, 2012, 9:12:51 AM7/28/12
to lif...@googlegroups.com
Like others have said, the best thing you can do is report them as
bugs, and then you can post the link to those bugs here, and we can
then "vote" them on the intellij site. The more votes, higher the
changes it gets fixed.

Speaking of which, I just entered this one

http://youtrack.jetbrains.com/issue/SCL-4493

Thanks.
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Brent Sowers

unread,
Jul 28, 2012, 9:52:14 AM7/28/12
to lif...@googlegroups.com
What version of IntelliJ and the Scala plugin are you using?  Several months ago when I upgraded to 11.1 from 11.0 I had the same issue, it turned out to be a problem in the Scala plugin for 11.1.  I downgraded to 11.0 and it's been working fine for me since.  I believe the Scala compiler has been updated though to fix the problem in 11.1 so I'd suggest re-installing that before downgrading to 11.0.

Brent Sowers
Senior Software Engineer, Audax Health (We're hiring Scala and Lift developers! https://gist.github.com/3025609)

Dennis Haupt

unread,
Jul 28, 2012, 10:02:35 AM7/28/12
to lif...@googlegroups.com
the plugin switched from using scala 2.9 to 2.10 i think, that's were
the bugs came from

Am 28.07.2012 15:52, schrieb Brent Sowers:
> What version of IntelliJ and the Scala plugin are you using? Several
> months ago when I upgraded to 11.1 from 11.0 I had the same issue, it
> turned out to be a problem in the Scala plugin for 11.1. I downgraded
> to 11.0 and it's been working fine for me since. I believe the Scala
> compiler has been updated though to fix the problem in 11.1 so I'd
> suggest re-installing that before downgrading to 11.0.
>
> Brent Sowers
> Senior Software Engineer, Audax Health (We're hiring Scala and Lift
> developers! https://gist.github.com/3025609
> <https://gist.github.com/3025609>)
> brent....@audaxhealth.com <mailto:brent....@audaxhealth.com>

Chenguang He

unread,
Jul 29, 2012, 4:22:35 AM7/29/12
to lif...@googlegroups.com
I am using scala 2.9.1 and intellij 11.1.3 with scala plug-in 0.5.907 



Chenguang He



Chenguang He

unread,
Jul 29, 2012, 4:27:16 AM7/29/12
to lif...@googlegroups.com
Yes, There are three levels of Type-ware highlighting:  none, syntax and inspections

Chenguang He



Reply all
Reply to author
Forward
0 new messages