Is this an eclipse or Scala IDE Bug/Package Explorer?

34 views
Skip to first unread message

Eric Peters

unread,
May 31, 2013, 12:21:20 PM5/31/13
to scala-i...@googlegroups.com

I created a folder structure such as fm/model/package, create a Scala source file with the with "package" in the name:

package fm.model.`package`

object TestObjectInPackage {

}

It results in the object not getting interpreted in the package explorer.  Screenshot: http://cl.ly/image/0a15072A3U3u

It's totally legal, tho maybe poor convention to use the backticks to name the package "package", it partially makes sense because the types of classes I"m generating actually do describe a physical package (height/weight/shipping details/etc)

Is this a bug in Scala IDE or something in Eclipse?

I'm currently using Eclipse 3.7.2, with the Scala IDE 3.0 Nightly

Regards,

Eric


Mirco Dotta

unread,
Jun 4, 2013, 3:17:29 AM6/4/13
to scala-i...@googlegroups.com
Hi Eric,

The bug is due to a limitation of the current Scala IDE design.

The Scala support is built on top of the Java one, and Java doesn't allow using Java keywords for names for things 
like packages, class names, and alike. While Scala the language does not prevent you from doing so (by using the 
backtick notation, as you pointed out), the Scala IDE has some limitation with respect to that, and the bug you are 
seeing is one manifestation.

Unfortunately, this is not a bug that we can easily patch up. It would require a major resource investment and I feel the 
outcome would be pretty low. My suggestion is to work around the problem and pick a different package name.

Cheers,
  Mirco

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


---------------
Mirco Dotta
PSE-D, 1015 Lausanne, Switzerland
Twitter: @mircodotta

See you at Scala Days 2013 in NYC!
June 10th - June 12th








Reply all
Reply to author
Forward
0 new messages