Your Digital Media Has Never Looked So Good

  • 1
  • 2
  • 3
  • 4
  • 5
  • 8
 
User avatar
RokuKevin
Roku Engineering
Topic Author
Posts: 796
Joined: Tue Sep 22, 2009 2:29 pm

Eclipse Plugin for Brightscript

Fri Aug 19, 2011 4:42 pm

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
 
jbrave
Posts: 716
Joined: Mon Mar 22, 2010 3:00 pm
Location: Ben Lomond, CA
Contact:

Re: Eclipse plugin for Brightscript Beta

Sat Aug 20, 2011 9:28 am

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!
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Eclipse plugin for Brightscript Beta

Sun Aug 21, 2011 9:44 pm

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)
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 12:26 pm

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
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 12:35 pm

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
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 1:31 pm

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.
 
jbrave
Posts: 716
Joined: Mon Mar 22, 2010 3:00 pm
Location: Ben Lomond, CA
Contact:

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 2:41 pm

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!
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 4:38 pm

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
 
jbrave
Posts: 716
Joined: Mon Mar 22, 2010 3:00 pm
Location: Ben Lomond, CA
Contact:

Re: Eclipse plugin for Brightscript Beta

Mon Aug 22, 2011 6:16 pm

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!
 
MidnightJava
Posts: 22
Joined: Wed Jul 20, 2011 2:03 pm

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 8:56 am

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.
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 9:33 am

malloys wrote:
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.

It looks like this was causing the problem I had with the files that were hanging. I rolled back to 3.6.2, and they're loading now.

On a side note (or maybe related?), it doesn't seem to like the "?" shortcut for "print". It might be a coincidence, but each of the files that wouldn't load contained at least one "?" line. 3.6.2 marks them all as invalid syntax.

I also can't seem to get code folding to work. Is there some trick to it? I'm new to Eclipse, so please excuse my ignorance, but should I be seeing +/- icon or something to fold a section?
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)
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 10:55 am

TheEndless wrote:
On a side note (or maybe related?), it doesn't seem to like the "?" shortcut for "print". It might be a coincidence, but each of the files that wouldn't load contained at least one "?" line. 3.6.2 marks them all as invalid syntax.


Yes, more than likely, the "?" print shortcut was omitted from the parser grammar... I had constructed the parser grammar by going through the BrightScript reference guide section by section, and the section on the Print command doesn't mention the shortcut (it shows up later in the guide in the examples and in the debugger help). I'll have that corrected in the next release.

TheEndless wrote:
I also can't seem to get code folding to work. Is there some trick to it? I'm new to Eclipse, so please excuse my ignorance, but should I be seeing +/- icon or something to fold a section?


With the current beta release, only comments can be folded. I should be able to get code folding fixed by the next release.
And BTW... comment folding is not turned on by default, has a bad default value for minimum lines threshold, and requires that the "Join Comments separated by empty lines" option be checked on in order to work (yes, that last bit is a known bug).

To turn comment folding on, goto: Window->Preferences->BrightScript->Editor->Folding, and:
Set the value for "Minimum lines required to enable folding" to 2 or greater, and check on the options for: "Join Comments Separated by empty lines"

Since we're on topic, what types of code structures would you like to see be fold-able?

I'm currently thinking: Subs/Functions and control blocks (if/then/else, while, for).

Should I extend this to array/associative array definitions as well?

Cheers
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 11:24 am

malloys wrote:
Since we're on topic, what types of code structures would you like to see be fold-able?

I'm currently thinking: Subs/Functions and control blocks (if/then/else, while, for).

Should I extend this to array/associative array definitions as well?

I'd like it on associative arrays at least.

I'm not sure if it matters, but there seems to be a lot of leeway in acceptable BrightScript syntax. For example, "End If / EndIf", "Else If / ElseIf", "For...Next / For...End For" are all valid, but aren't necessarily documented as such. I get sporadic highlighting/syntax errors when using various combinations of them in Eclipse. For the most part, VBScript syntax highlighting and code folding recognize these in Notepad++, so that might be a worthwhile reference point.

One other issue I've run across... The RSP Console window seems a bit spastic. The drop down with IP addresses isn't wide enough to show the full address, and it's constantly refreshing (constant as in every 500ms or so), so I can't seem to select any specific addresses. When I click the down arrow to pick one, it refreshes and ends up selecting the second address (I have three in the list) every time. If I highlight the text to type in an address, it refreshes two quickly for me to do so.

Now that I can actually open my files, this is looking pretty sweet. Thanks for putting the time and effort into it, and for listening to feedback!
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)
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 11:49 am

MidnightJava wrote:
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.


That's a known issue with the underlying core parser.
It's got a form of automatic recovery on parser errors, but it currently doesn't seem particularly good at recovering to a useful parser restart point for BrightScript code in most cases.
I'm looking into overriding and improving the recovery algorithm for future releases.

MidnightJava wrote:
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.


If you could provide specific examples via PM, that would help me to isolate the problem.

MidnightJava wrote:
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.


Thanks for the heads up - I'll look into these.


MidnightJava wrote:
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.


This is a known issue that should be fixed in the next release.
Although it allows you to enter an IP address, you shouldn't have to enter the IP address of a Roku box in the console dropdown - the plugin should automatically be able to query for them and list the IP address(es) automatically.

However...
There is a known race condition (with the plugin startup) bug which prevents the SSDP query mechanism from working correctly, so it falls back to relying on the Roku box SSDP 1-per-minute unsolicited broadcast.

Until the bug is fixed in the next release, you should wait a little while (in theory, at most 1+ minute) after the BrightScript console is becomes visible for the plugin to see the 1-per-minute unsolicited SSDP broadcast from the roku box. The plugin should eventually see that broadcast, and then add the IP address to the console window for you.

MidnightJava wrote:
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.


Understood, see response above in (1) about the current parser error recovery issue.

MidnightJava wrote:
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?


Yes, that's a known issue with code completion... or more accurately, with the current parser/parser grammar.
Only the base BrightScript language elements are currently known to the parser - the built-in objects and component types (and more to the point, the interface definitions) are not yet in the grammar.
Object/component/interface types are something I plan on adding over several releases.
As these get added, it will have useful follow-on effects, including improved code-completion (and eventually help/doc windows for items in the code completion list).

MidnightJava wrote:
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.


Good idea - I'll add that to the to-do list.

MidnightJava wrote:
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.


Agreed.
FYI - the error marker text (with a few special exceptions), is currently auto-generated by the parser code generator (read: not defined in my code or grammar file).
I've noticed that the default parser messages aren't always very clear, so that's a general area of improvement for my parser wrapper code that I've got on the to-do list.

Thanks very much for the feedback - please keep it coming!

Cheers.
Last edited by malloys on Tue Aug 23, 2011 12:07 pm, edited 1 time in total.
 
malloys
Posts: 208
Joined: Sat Jul 24, 2010 12:26 pm

Re: Eclipse plugin for Brightscript Beta

Tue Aug 23, 2011 12:05 pm

TheEndless wrote:
malloys wrote:
Since we're on topic, what types of code structures would you like to see be fold-able?

I'm currently thinking: Subs/Functions and control blocks (if/then/else, while, for).

Should I extend this to array/associative array definitions as well?

I'd like it on associative arrays at least.


You got it. Consider those added.

TheEndless wrote:
I'm not sure if it matters, but there seems to be a lot of leeway in acceptable BrightScript syntax. For example, "End If / EndIf", "Else If / ElseIf", "For...Next / For...End For" are all valid, but aren't necessarily documented as such. I get sporadic highlighting/syntax errors when using various combinations of them in Eclipse. For the most part, VBScript syntax highlighting and code folding recognize these in Notepad++, so that might be a worthwhile reference point.


Fortunately, my contacts at Roku have given me access to the Roku box's source code, so I plan on examining the box's parser grammar and using that as a reference for the plugin's parser grammar going forward, rather than relying solely on the BrightScript Language Reference guide (as I have to-date).


TheEndless wrote:
One other issue I've run across... The RSP Console window seems a bit spastic. The drop down with IP addresses isn't wide enough to show the full address, and it's constantly refreshing (constant as in every 500ms or so), so I can't seem to select any specific addresses. When I click the down arrow to pick one, it refreshes and ends up selecting the second address (I have three in the list) every time. If I highlight the text to type in an address, it refreshes two quickly for me to do so.


Yeah, just spotted this issue today myself (and related to something I mention in a previous post about the SSDP code and a race condition with eclipse's plugin startup).
I should have that corrected in the next release.

TheEndless wrote:
Now that I can actually open my files, this is looking pretty sweet. Thanks for putting the time and effort into it, and for listening to feedback!


Thanks much - there's lot's more on the to-do list and Roku seems pretty interested in having me continue to improve the plugin.
Please, by all means, let me know of any suggestions for new features, improvements to existing ones, and of course any bugs you may encounter.

Cheers
  • 1
  • 2
  • 3
  • 4
  • 5
  • 8

Who is online

Users browsing this forum: No registered users and 4 guests