Re: [scala-user] Problems with Eclipse Scala plugin, suggestion welcome.

97 views
Skip to first unread message

David Bernard

unread,
Sep 11, 2010, 4:34:33 PM9/11/10
to scala...@listes.epfl.ch, scala-i...@googlegroups.com
Do you enable JDT weaving into Preferences ?

see https://www.assembla.com/wiki/show/scala-ide/Troubleshooting

On 11/09/2010 22:19, Kenneth McDonald wrote:
> Well, having had show-stopping bugs with the IDEA Scala plugin, I moved on to try the Eclipse one, and am having problems with it as well. If anyone could offer comments as to what might be the cause and how to fix them, I'd be grateful. In the meantime, I'm dl'ing NetBeans, to see how that will work :-)
>
> Here are the problems I'm having:
>
> 1) In my projects "test" subdir, I have a file "ykken/rex/testrex.scala". For some reason, this is not recognized as a Scala file, instead its Package Explorer icon identifies it as a Java file. If I double-click to try to open it, I get a moderately lengthy stack trace, which I've appended at the end of this email. On the other hand, I can right click on it and open it explicitly in the Scala editor.
>
> 2) The "outline" window does not give an outline of my (correct) Scala files--it is blank.
>
> 3) Syntax highlighting works, but "on the fly" error detectioin does not. For example, if, in quite a short Scala file, I substitute "inal" for one of my "final" declarations, no error is indicated, I have to do a compile cycle to catch it.
>
> Any help most appreciated.
>
> Thanks,
> Ken McDonald
>
>
> org.eclipse.ui.PartInitException: No editor descriptor for id scala.tools.eclipse.Editor
> at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:598)
> at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)
> at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
> at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
> at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
> at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
> at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
> at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
> at org.eclipse.ui.internal.PartStack.presentationSelectionChanged(PartStack.java:843)
> at org.eclipse.ui.internal.PartStack.access$1(PartStack.java:829)
> at org.eclipse.ui.internal.PartStack$1.selectPart(PartStack.java:139)
> at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:133)
> at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:270)
> at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:279)
> at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
> at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$2.handleEvent(DefaultTabFolder.java:87)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
> at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3256)
> at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2045)
> at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:323)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>

David Bernard

unread,
Sep 11, 2010, 4:50:16 PM9/11/10
to scala...@listes.epfl.ch, scala-i...@googlegroups.com
Is it the single scala file of your project with this problem ?

Do you have a (S) as sub icon on the project ?

Do you enable scala nature (Right click on project> Configuration > Enable Scala Nature)?

How do you create project (New Scala Project, Import existing (maven) project, ....) ?

/davidB

On 11/09/2010 22:45, Kenneth McDonald wrote:
> It was already enabled, I didn't need to enable it. (For that matter, I didn't even know about this setting until you pointed it out :-) )
>
> Thanks,
> Ken

David Bernard

unread,
Sep 11, 2010, 5:26:12 PM9/11/10
to scala...@listes.epfl.ch, scala-i...@googlegroups.com
Could you send your .classpath and .project.
Some plugin ids (internal) changed since version 2.7.x and migration doesn't always run as expected.

/davidB

On 11/09/2010 23:12, Kenneth McDonald wrote:
> Thanks for all the help, David.


>
>
> On Sep 11, 2010, at 3:50 PM, David Bernard wrote:
>
>> Is it the single scala file of your project with this problem ?
>

> Yes, it's just the one file. The other two Scala files (in the "src" subdir) are correctly identified as Scala files.


>>
>> Do you have a (S) as sub icon on the project ?

> Yes


>>
>> Do you enable scala nature (Right click on project> Configuration> Enable Scala Nature)?

> When I right-click on the project, it already contains a menu item called Scala, which has a subitem called "Remove Scala Nature", so I take that as meaning the Scala Nature is enabled.


>>
>> How do you create project (New Scala Project, Import existing (maven) project, ....) ?

> This was a Scala project created with a previous version of Eclipse and under Scala 2.7.6. I installed Eclipse 3.5.2, and it picked up the project. I had to modify a bit of code to get things working again, but the Ant test run reports all tests as successful (though I really do need to write more :-) )
>
> One other thing of note: the rex project folder icon has an error indicator on it (white x in red box), even though none of the subfiles are showing an error.
>
> Many thanks,
> Ken

David Bernard

unread,
Sep 11, 2010, 7:44:07 PM9/11/10
to scala-i...@googlegroups.com
.project and .classpath are a the root of your project (file started by dot are hidden by default)
eclipse.ini is at the root of your eclipse installation (but it may be different on OS X)


On 12/09/2010 01:13, Kenneth McDonald wrote:
> David,
>
> I can't find these files, not in my home dir and not in the eclipse dir or config subdir. Nor can I find the eclipse.ini file mentioned in the troubleshooting wiki page. Sorry, I'm not yet an experienced eclipse user. Could you (or someone else) point me in the right direction?
>
> I'm on OS X 10.6.4--don't know if that affects things.
>
> Many thanks,
> Ken

Kenneth McDonald

unread,
Sep 12, 2010, 12:11:55 AM9/12/10
to Scala IDE User
As usual, I failed to look in the obvious places :-(

I opened up .classpath and made an obvious addition, the line
indicated by the arrow:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/> <--
<classpathentry kind="con"
path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="lib" path="/Applications/eclipse/scalatest.jar"/
>
<classpathentry kind="output" path="bin"/>
</classpath>

This solved the problem of my test file not being recognized as a
scala file (the Package explorer now displays its mini-icon with an S
on it), but double clicking it still gives me the error: "Could not
open the editor: No editor descriptor for id
scala.tools.eclipse.Editor"

My .project file is:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>rex</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>ch.epfl.lamp.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>ch.epfl.lamp.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

Bit by bit, things are getting better. I'm greatly in your debt!

FYI, on OS X, the eclipse.init file is a couple of levels down within
eclipse.app itself.

Thanks,
Ken

Kenneth McDonald

unread,
Sep 11, 2010, 7:26:49 PM9/11/10
to scala-i...@googlegroups.com

David Bernard

unread,
Sep 12, 2010, 5:32:53 AM9/12/10
to scala-i...@googlegroups.com
Nice, as Miles said, you can do the same by adding source folder :
* right click on the project and add call "New > Source Folder" ...
* or by right click on the project and call "Properties > Java Build Path > Source" ...

But there something that could finish update to new scala-ide id (not required as the current configuration works for you).
replace in .classpath
"ch.epfl.lamp.sdt.launching.SCALA_CONTAINER" by "org.scala-ide.sdt.launching.SCALA_CONTAINER"

replace in .project
ch.epfl.lamp.sdt.core. by org.scala-ide.sdt.core. (x 2)


And don't forgot, you can use the scala-ide-user mailing list[1] or open tickets[2] for futures issues (request,...)

[1] http://groups.google.com/group/scala-ide-user
[2] http://www.assembla.com/spaces/scala-ide/tickets

/davidB

Reply all
Reply to author
Forward
0 new messages