Package information is not propagated until files are opened in the editor
Package information is not propagated - packages that do not respect the Java folder rule are not visible in the editor until the file is actually opened.
Steps to reproduce:
1. Create the following two files outside eclipse:
TestA.scala:
TestB.scala:
2. Create a Scala project
3. Drag the two files in the src folder and copy them
4. Double click on TestB.scala and try to Ctrl-click on TestA (in the "class TestB extends TestA" statement) - no success
5. Clean and rebuild project
6. Try to Ctrl-click TestA again - no success
7. Double click on TestA.scala and close it
8. Try to Ctrl-click TestA again - now it's visible
Details:
- Eclipse version: Helios Service Release 2 Build id: 20110218-0911
- ScalaIDE version: 2.0.0.201106012217-beta5-816aa9f
Steps to reproduce:
1. Create the following two files outside eclipse:
TestA.scala:
package something.very.complex
package more.complex
class TestA {
def print = println("A")
}
TestB.scala:
package something.very.complex
package not.so.complex
import more.complex._
class TestB extends TestA {
override def print = println("B")
}
2. Create a Scala project
3. Drag the two files in the src folder and copy them
4. Double click on TestB.scala and try to Ctrl-click on TestA (in the "class TestB extends TestA" statement) - no success
5. Clean and rebuild project
6. Try to Ctrl-click TestA again - no success
7. Double click on TestA.scala and close it
8. Try to Ctrl-click TestA again - now it's visible
Details:
- Eclipse version: Helios Service Release 2 Build id: 20110218-0911
- ScalaIDE version: 2.0.0.201106012217-beta5-816aa9f
Leave a comment
on 2011-06-22 11:39 *
By vlad.ureche
The problem is actually a bit different:
The package information is propagated if the scala source file is in the correct folder. (java style, net.some.prog.MyClass -> net/some/prog/MyClass.java)
If it's not in the correct folder, it will only become visible after being loaded in the editor.
The package information is propagated if the scala source file is in the correct folder. (java style, net.some.prog.MyClass -> net/some/prog/MyClass.java)
If it's not in the correct folder, it will only become visible after being loaded in the editor.
I confirm it is not a duplicate.
on 2011-08-12 08:28 *
By Mirco Dotta
This may be somewhat related to #1000541. The problem only happens when the phisical location of the source file does not match its package declaration. I just tested your example by placing the files in a directory that matches their package, and everything is fine. Therefore, for the moment I would suggest to follow this convention (which Java actually enforce with compilation errors).
A simpler example for reproducing the problem is the following (place the files in the root directory):
I will investigate now if this is a presentation compiler issue, or maybe due to how Eclipse works.
A simpler example for reproducing the problem is the following (place the files in the root directory):
// file A.scala
package a
class A {}
// file B.scala
package b
import a._
class B extends A {}
I will investigate now if this is a presentation compiler issue, or maybe due to how Eclipse works.
on 2011-08-12 12:20 *
By Mirco Dotta
Eclipse version changed from Helios to Helios & Indigo
Assigned to changed from login to Mirco Dotta
on 2012-01-30 10:50 *
By skyluc
Version changed from 2.0.0-beta5-29 to 2.0.0-final-29
Assigned to changed from Mirco Dotta to -none-
Milestone changed from Helium to Backlog
Permission type changed from None to Public
on 2013-09-18 09:03 *
By Iulian Dragos
Version changed from 2.0.0-final-29 to 3.0.1-210
Eclipse version changed from Helios & Indigo to Indigo - Eclipse 3.7
Component changed from Eclipse to Presentation Compiler