Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuKevin
Visitor

Eclipse Plugin for Brightscript

Is available within eclipse at the following update site:

http://rokudev.roku.com/updates/

Bare bones eclipse plugin guide available here:
http://rokudev.roku.com/rokudev/eclipsePluginGuide.pdf

Let us know what you think. The plugin now supports eclipse v3.7 Indigo.

--Kevin
0 Kudos
108 REPLIES 108
jbrave
Channel Surfer

Re: Eclipse plugin for Brightscript Beta

I'm getting this error when trying to open and edit brightscript:

An error has occurred. See error log for more details.
org.eclipse.dltk.compiler.problem.DefaultProblem.<init>(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;IIIII)V


eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
Framework arguments: -keyring /Users/admin2/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86 -keyring /Users/admin2/.eclipse_keyring -showlocation

This is a continuation of log file /Users/admin2/Documents/workspace/.metadata/.bak_3.log
Created Time: 2011-08-20 09:25:30.212

Error
Sat Aug 20 09:26:41 PDT 2011
Problems occurred when invoking code from plug-in: "org.eclipse.jface".

java.lang.NoSuchMethodError: org.eclipse.dltk.compiler.problem.DefaultProblem.<init>(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;IIIII)V
at com.roku.brightscript.ide.eclipse.core.parsers.BrightScriptSourceParser.parse(Unknown Source)
at org.eclipse.dltk.core.SourceParserUtil.parse(SourceParserUtil.java:137)
at org.eclipse.dltk.core.SourceParserUtil.getModuleDeclaration(SourceParserUtil.java:197)
at org.eclipse.dltk.core.SourceParserUtil.getModuleDeclaration(SourceParserUtil.java:183)
at org.eclipse.dltk.core.SourceParserUtil.getModuleDeclaration(SourceParserUtil.java:168)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.parse(AbstractASTFoldingStructureProvider.java:1291)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.getCodeBlocks(AbstractASTFoldingStructureProvider.java:1274)
at com.roku.brightscript.ide.eclipse.core.editors.BrightScriptFoldingStructureProvider.getCodeBlocks(Unknown Source)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.getCodeBlocks(AbstractASTFoldingStructureProvider.java:1270)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.computeFoldingStructure(AbstractASTFoldingStructureProvider.java:794)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.computeFoldingStructure(AbstractASTFoldingStructureProvider.java:786)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.update(AbstractASTFoldingStructureProvider.java:721)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.initialize(AbstractASTFoldingStructureProvider.java:678)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.initialize(AbstractASTFoldingStructureProvider.java:674)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider.handleProjectionEnabled(AbstractASTFoldingStructureProvider.java:649)
at org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider$ProjectionListener.projectionEnabled(AbstractASTFoldingStructureProvider.java:501)
at org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:489)
at org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:537)
at org.eclipse.dltk.internal.ui.editor.ScriptSourceViewer.setVisibleDocument(ScriptSourceViewer.java:523)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2932)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:636)
at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:376)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:584)
at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:4030)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3558)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
at org.eclipse.dltk.internal.ui.editor.ScriptEditor.createPartControl(ScriptEditor.java:1868)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:424)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2887)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:355)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3971)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:344)
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:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: Eclipse plugin for Brightscript Beta

I'm not having much luck, either. I got it installed, and created a new project, but opening some files just hangs, and adding new files results in the following error:
Errors occurred during the build.
Errors running builder 'Script Builder' on project 'xxxxx'.
org.eclipse.dltk.compiler.problem.DefaultProblem.<init>(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;IIIII)V

I'm also seeing some really bizarre syntax highlighting on the files I am able to open. For example, I have an "IsNullOrEmpty" function, and it's highlighting like this:
If Not IsNullOrEmpty(favorites) Then

I also have a RemoveFavorite function in this same file that's highlighting bizarrely in both the declaration and implementation...
config.RemoveFavorite = Configuration_RemoveFavorite

Sub Configuration_RemoveFavorite(favorite As Object)

I'd think it might have something to do with the word "favorite", but I've got a number of other "favorite" functions that don't highlight the same, and other IsNullOrEmpty's that do.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
malloys
Visitor

Re: Eclipse plugin for Brightscript Beta

"jbrave" wrote:
I'm getting this error when trying to open and edit brightscript:

An error has occurred. See error log for more details.
org.eclipse.dltk.compiler.problem.DefaultProblem.<init>(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;IIIII)V

...



I'm not sure how to translate eclipse buildids to specific versions yet, so can you tell me which specific version and package of eclipse you are running?

Cheers
0 Kudos
malloys
Visitor

Re: Eclipse plugin for Brightscript Beta

"TheEndless" wrote:
I'm not having much luck, either. I got it installed, and created a new project, but opening some files just hangs, and adding new files results in the following error:
Errors occurred during the build.
Errors running builder 'Script Builder' on project 'xxxxx'.
org.eclipse.dltk.compiler.problem.DefaultProblem.<init>(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;IIIII)V

I'm also seeing some really bizarre syntax highlighting on the files I am able to open. For example, I have an "IsNullOrEmpty" function, and it's highlighting like this:
If Not IsNullOrEmpty(favorites) Then

I also have a RemoveFavorite function in this same file that's highlighting bizarrely in both the declaration and implementation...
config.RemoveFavorite = Configuration_RemoveFavorite

Sub Configuration_RemoveFavorite(favorite As Object)

I'd think it might have something to do with the word "favorite", but I've got a number of other "favorite" functions that don't highlight the same, and other IsNullOrEmpty's that do.



To diagnose the build errors: which specific version and package of eclipse are you running?

For the file hangs, I'll need to get a copy of the files that hang on an open attempt. I'll PM you in a bit with my email address.

I'll dive into the stated syntax highlighting issue, see what I can find, and get back to you. It's probably due to a regexp in the syntax highlighter that's a little off from what it was intended to be.

Cheers
0 Kudos
malloys
Visitor

Re: Eclipse plugin for Brightscript Beta

"TheEndless" wrote:

I'm also seeing some really bizarre syntax highlighting on the files I am able to open. For example, I have an "IsNullOrEmpty" function, and it's highlighting like this:
If Not IsNullOrEmpty(favorites) Then

I also have a RemoveFavorite function in this same file that's highlighting bizarrely in both the declaration and implementation...
config.RemoveFavorite = Configuration_RemoveFavorite

Sub Configuration_RemoveFavorite(favorite As Object)

I'd think it might have something to do with the word "favorite", but I've got a number of other "favorite" functions that don't highlight the same, and other IsNullOrEmpty's that do.


Found the problem on this one.
The syntax highlighter sees the string "REM" (case insensitive) and decides that from that point to the end of the line is all a comment.
So, that's a definite bug in the syntax highlighter pattern specification for comments. Should be easy enough to correct, and so expect a fix for this in the next plugin update.
0 Kudos
jbrave
Channel Surfer

Re: Eclipse plugin for Brightscript Beta

"malloys" wrote:
I'm not sure how to translate eclipse buildids to specific versions yet, so can you tell me which specific version and package of eclipse you are running?


Version: 3.7.0
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
malloys
Visitor

Re: Eclipse plugin for Brightscript Beta

"jbrave" wrote:
"malloys" wrote:
I'm not sure how to translate eclipse buildids to specific versions yet, so can you tell me which specific version and package of eclipse you are running?


Version: 3.7.0


There's the problem.
The BrightScript plugin was developed and informally tested under Eclipse 3.6. It does not yet work under Eclipse 3.7.
So far, the most obvious problem is that Eclipse 3.6's update sites pointed to DLTK 2, while Eclipse 3.7's update sites point to DLTK 3. The DLTK 3 API is not 100% backward compatible with DLTK 2.

I'll be working toward testing and bugfixing for Eclipse 3.7 over the next few weeks, but in the meantime, if you want to use the BrightScript plugin and get support on this thread you'll have to use Eclipse 3.6 instead.

Alternatively (note - without support yet), you can try to use Eclipse 3.7 by:
a) Uninstall the BrightScript plugin
b) Explicitly install DLTK 2.0 (only the DLTK Core Framework is needed) from the DLTK update site: http://download.eclipse.org/technology/dltk/updates
c) Re-install the BrightScript plugin
This fixes the DLTK issues, but there may be other Eclipse 3.7 specific issue that I haven't yet encountered.

Cheers
0 Kudos
jbrave
Channel Surfer

Re: Eclipse plugin for Brightscript Beta

Incidentally, the Brightscript mode for jEdit had the same issue with words beginning with rem...

so :

<!EOL_SPAN TYPE="COMMENT1" AT_WORD_START="TRUE">rem</EOL_SPAN>


I commented this out, seems to have fixed the issue.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
MidnightJava
Visitor

Re: Eclipse plugin for Brightscript Beta

malloys, thanks for your work on the plug-in, and for your support getting the Beta version running. I have a few issues, described below. I'm using Eclipse 3.6.2. I removed the previous basic Brightscript plugin and installed the new one. I converted an existing project with Brightscript code into a Brightscript plug-in using the command on the Project context menu. I also created a Brightscript project from scratch, with a generated template. The following problems occur on both projects.

1. The outline was incomplete, missing the vast majority of my functions. This was corrected by commenting out a line in the script that was causing a false positive error marker. See item 3 below.

2. Searching for a function declaration with a reference to the function highlighted works for some references and doesn't work for others. For many references, Search doesn't find a declaration, even though it is there, and shows up in the Outline view. Highlighting a function reference and then selecting Show in-> Outline View doesn't do anything in any case. Also Link With Editor works from Outline View to editor, but not in the other direction.

3. The telnet console doesn't work. I enter the local IP address of my roku box, and it doesn't do anything. I successfully side-loaded the box, so I know the plug-in can see it. I see the progress monitor for a user job as soon as I enter the IP address for the roku box in the deploy wizard, but the telnet console doesn't seem to be able to connect. Also the drop-down combo in the console where I enter the IP address is only one character wide. I have to scroll through horizontally to read the IP address one character at a time.

4. I have a false positive error marker, due to an issue you mentioned previously, i.e. code with adjacent () or [] will show an error. This causes a cascading of error markers, which of course is par for the course when parsing a grammar; but I thought I'd mention one in particular in case something can be done about it. The following reference has an error marker due to the bug mentioned above

 ShowArtist(Indexes[curIndex][msg.GetIndex()])


However, after the line above there are some statements that close if and while blocks. It seems the parser misses these, and consequently there are a number of markers later in the code for various end xxx statements, of the nature "expected if, found while, or expected function, founded if", etc. I commented out the line above, and all the error markers went away, and the Outline was then found to be complete.

The following are some comments, not necessarily bugs.

1. I see that code completion works when I'm in the midst of a word, but never after a dot operator. I understand that's problematic with a dynamically typed language, but it is possible in certain contexts where the type of the object is known to the parser. I've seen Javascript editors that make a best effort at such completion, although it's not as deterministic as, say, for a Java editor. Is there indeed no support for code completion after the dot operator, and is that something planned for future versions?

2. Is there any plan to enable navigating from reference to declaration with a single key (e.g. F3)? I use that a lot in Java development in Eclipse, and it's far more convenient than using the Search commands, which seems to be the only way such a thing is supported now.

3. I had some reserved words in a script I tried to edit. This caused some error markers that were at first confusing to me until I realized I had some reserved words in the script. It would be helpful if use of reserved words was recognized and called out explicitly by the parser.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.