Eclipse plugin for Brightscript

I’ve thrown together a quick and dirty Eclipse plugin containing a very basic BrightScript file editor with syntax coloring and tab/indent preferences only.
It’s beta quality and doesn’t have the bells and whistles of full language support, but this plugin should be a step up from using a plain-text editor.
The keywords list is a subset of the complete list, and the categories are not complete yet - but it’s a start.
This plugin has only been tested on Eclipse 3.5 (Galileo) so far, but it should work on 3.6 (I’ll upgrade & test in the next week or so).

A full-featured plugin (i.e. syntax checking, auto-completion/suggestion, templates, on-line help, builder, debugger, project wizards, etc.) may be in the works if there’s sufficient interest from both the developer community and Roku.

I’ll be posting at least a few updates to this plugin over the next couple of weeks, so I’ve set up an Eclipse update site to make things easier for anyone interested:
Using the typical Eclipse software install mechanism (Help->Install New Software), the eclipse update site URL to add to your Eclipse instance via the above dialog’s Add button is:
http://www.domhain.com/eclipse/updates

The above website has absolutely nothing but the plugin on it at the moment, so any feedback (which is very much welcome) should be posted to this thread for now.

Enjoy.

Awsome. I just got a Roku and downloaded the SDK so I’m anxious to try out the plugin.

Good show! :mrgreen:

Cheers.

The plugin has been updated and posted to the update site http://www.domhain.com/eclipse/updates .

Just a reminder, but this is an eclipse plugin install-compatible site URL, so your best bet is to add it to your “Available Software Sites” in Eclipse (Help->Install New Software…->Add…) and then add the URL and give it a site name.
Once the site is selected, the BrightScript feature category should just show up.
Then you’ve got the usual advantages of automatic and over-the-wire updates, and plugin dependency checking and resolution.

Changes for this version (1.0.1.201008241730) are:

a) Support for Eclipse version 3.6 (Helios)
b) Many new syntax categories and keywords for those new categories (based on mainmanc’s original list for EditPlus - thanks!)
c) Removal of unused elements in both the Editor and Syntax Coloring BrightScript preferences dialogs.
d) Removal of single quotes as string delimeters
e) Use of one of the SDK example source files in the Syntax Color Preview window in Syntax Coloring Preferences dialog (Window->Preferences->BrightScript->Editor->Syntax Coloring).

The example file for (e) above is not ideal for the task, so I’ll probably be changing that out in the next rev.
If anyone wants to try to provide a brief but illustrative example file to demonstrate all the new syntax categories, I’ll include it in the next update.
I’ll also update the words list for each of the categories in the next rev with any missing words, so please let me know if you find a keyword that’s not being colored for any given category.

Cheers

I’m not seeing this exception in my installations of either 3.5 or 3.6, but I’ll be sure to look into this further.
How did you install the plugin?
Did you manually download and unzip it, or did you use the “Install New Software…” dialog?

“malloys” wrote:
I’m not seeing this exception in my installations of either 3.5 or 3.6, but I’ll be sure to look into this further.
How did you install the plugin?
Did you manually download and unzip it, or did you use the “Install New Software…” dialog?
Through the Install New Software dialog.

“hoffmcs” wrote:

“malloys” wrote:
I’m not seeing this exception in my installations of either 3.5 or 3.6, but I’ll be sure to look into this further.
How did you install the plugin?
Did you manually download and unzip it, or did you use the “Install New Software…” dialog?
Through the Install New Software dialog.

Sorry, forgot to ask…
Which specific version (3.5.0, 3.5.1, 3.5.2), and which base package (JavaEE, Java, Classic, PHP, etc.) are you using?

“malloys” wrote:
Sorry, forgot to ask…
Which specific version (3.5.0, 3.5.1, 3.5.2), and which base package (JavaEE, Java, Classic, PHP, etc.) are you using?
3.5.2, Java Package

OK, I’ve reproduced the problem and tracked down the cause.

It looks like the dependency list in the packaged feature/plugin is incorrect and points to an older version of one of the underlying supporting plugins.
I’ll be packaging up a fixed version of the BrightScript plugin soon.

If you can’t wait for the update, there is an easy workaround:
Use the software install dialog, and install the DLTK 2.0 Core Frameworks plugin from the DLTK update site (http://download.eclipse.org/technology/dltk/updates/)… then restart Eclipse, and you should be good to go.

Cheers

“malloys” wrote:
OK, I’ve reproduced the problem and tracked down the cause.

It looks like the dependency list in the packaged feature/plugin is incorrect and points to an older version of one of the underlying supporting plugins.
I’ll be packaging up a fixed version of the BrightScript plugin soon.

If you can’t wait for the update, there is an easy workaround:
Use the software install dialog, and install the DLTK 2.0 Core Frameworks plugin from the DLTK update site (http://download.eclipse.org/technology/dltk/updates/)… then restart Eclipse, and you should be good to go.

Cheers
That did the trick. Thanks.

FYI, I’ve begun work on a second, more full-featured plugin for Eclipse that will include at a minimum, the following features:

  • Syntax checking/error highlighting and reporting ( mostly done, just debugging it now, but will probably need to fine-tune the BrightScript parser a bit more ).

  • Structure outline with hyperlinking to Functions/Subs ( done ).

  • Code folding ( mostly done, need to integrate deeper AST processing ).

  • New Project wizard ( done ).

  • References/Declaration search ( mostly done, need to integrate deeper AST processing ).

  • Hover help/Online documentation ( started, but docs repackaging for this purpose will take some time ).

  • Code assist/Autocompletion ( not started ).

  • Code templates ( started ).

  • Builder & Deployment wizard i.e. packaging and uploading the code to the box ( not started ).

  • Launcher and Debugger integration (i.e. with the on-box Roku debugger) ( not started ).

  • Preference pages for most of the above ( started ).

While “in beta” I plan on making this available for free.
Once “in production”, this will be trialware, with a small, but reasonable purchase price.
BTW, the current basic plugin with just the syntax color-coding and tab/indentation prefs will stay free.

Anyone interested in the full-featured version?
Please let me know on this thread, so that I can gauge interest and plan my dev time accordingly.

Cheers

what is eclipse anyways?

“FML2010” wrote:
what is eclipse anyways?

Many things to many people :wink:

It’s primarily an IDE, but there’s the “Rich Client Platform” or RCP as well, which is used by some product companies to as the foundation of client applications.

As an IDE, it’s configurable to support different languages and supporting development technologies.
Just about everything in it is a plugin, much of it optional. So exactly “what it is” varies depending on who installed and configured it.

A more complete answer is here:

http://www.eclipse.org/projects/
http://www.eclipse.org

Note, the projects list at the eclipse.org site is just those hosted at eclipse.org.
The developer and add-on product community surrounding eclipse is much larger.

A new version of the basic (syntax coloring) BrightScript Eclipse plugin is available for download via the usual Eclipse software install mechanism (Help->Install New Software) at:
http://www.domhain.com/eclipse/updates

Eclipse 3.5.x (Galileo) users may have to manually enable the DLTK software updates site ( http://download.eclipse.org/technology/dltk/updates ) which is already in the “Available Software Sites” list, but disabled by default in 3.5.
Eclipse 3.6.x (Helios) users should not need to do this, since the DLTK update site is indirectly pointed to by the default Helios update list.

In this version:

  • Bugfix for the DLTK plugin dependency issue

  • Bugfix for (non)coloring of REM comment lines with no content

  • Several additions and removals of keywords in the various syntax coloring categories

  • Syntax coloring preferences dialog preview pane now uses the simplevideoplayer.brs content as the example

Cheers

Sweet! Thanks for pointing this out and for putting the effort in to make Roku development even more fun.

FYI, The 1.0 beta 1 version of the advanced BrightScript plugin for Eclipse is now available.
1.0 beta versions of the advanced plugin are free

Important notes:

  • The Basic BrightScript plugin and the Advanced BrightScript plugin can not co-exist in the same Eclipse install instance. You must first un-install the Basic plugin before installing the Advanced plugin.

  • This beta release will time-out on 12/1/2010.

As always, the best bet is to use the over-the-wire install mechanism built into Eclipse ( Help->Install New Software ).
The update site is the same as before: http://www.domhain.com/eclipse/updates

Features in this release (1.0 beta 1):

  • New Project wizard - creates the project, associates the other features listed here with the project, suggests a deployment-friendly directory structure, allows you to modify the list, and creates a manifest file

  • Syntax checking & in-editor error highlighting & persistent problem reporting in problems tab.

  • Syntax/keyword coloring - same as the basic version of the plugin

  • Structure outline - Hyperlinking to Functions/Subs declarations and Field (initial variable creation) declarations

  • Comments and Code folding - Editor collapsible regions for comments and Functions/Subs.

  • References/Declarations search for methods (Subs/Functions) and fields (any variable).

  • Hover help - Shows comments from above method or field declarations, or args/return types when there are no associated comments

  • Deployment wizard - does intelligent zip candidate file selection based on Roku supported file types, allows you to modify the list, and then creates zip file. Note, this is under the File->Export menu

  • Preference pages for various aspects of the above features

Known bugs and issues

  • Non-BrightScript projects can see the BrightScript Deployment Wizard as an option

  • Search for references on variables/fields are not scoped correctly (false-positive finds for out-of-method non-global references and not handling “m.” refs correctly)

  • Search for references on methods incorrectly includes component interface method calls of the same name

  • Anon functions/functions assigned to associative array members are not included in method declaration/reference searches, not in outline pane, etc.

  • Syntax chekcing is not yet 100% language correct for all the basic language elements - some things may be flagged as errors that are OK in BrightScript, and vice-versa.

  • There are several unneeded/irrelevent menu and preference items (type declaration search, open type hierarchy, folding prefs for things not in the language, etc.).

Features and improvements slated for not-so-distant future releases:

  • Deployment wizard improvements: various code & manifest sanity checks, and optional Roku DVP uploading (aka sideloading) step.

  • Packaging & Publishing wizard (may become optional part of Deployment wizard, may become separate wizard… opinions?)

  • Roku DVP on-box Debugger/Eclipse IDE integration

  • Hover help improvements/additions: showing documentation from SDK for global functions and components.

  • References search for built-in types (aka components)

  • Task Tags

  • Call hierarchy (bi-directional … caller/callee)

  • Code formatter/formatting profiles

  • Smart Typing/Autocompletion/Code assistance

  • Code templates

  • Code libraries & sub-projects - optional inclusion in project and Deployment wizard

  • Auto-highlighting of other references/declarations based on current editor selection

  • Syntax Checking improvements: support for global functions & components and their allowable args

  • Manifest form/raw dual-pane intelligent editor

  • Content attributes assoc array intelligent editor

Feedback is not only welcome, but very much desired.

Cheers

Well, I tried installing Eclipse on my mac the other day, and it turns out both the latest version and the earlier (3.5?) version don’t work on Tiger. I don’t expect to be able to upgrade my mac any time soon so I can’t use it. I’m using Jedit. Wish there was a plugin for that.

  • Joel

“jbrave” wrote:
Well, I tried installing Eclipse on my mac the other day, and it turns out both the latest version and the earlier (3.5?) version don’t work on Tiger. I don’t expect to be able to upgrade my mac any time soon so I can’t use it. I’m using Jedit. Wish there was a plugin for that.

  • Joel

Have you tried downloading the Mac carbon 32-bit version of either 3.5 or 3.6 (as opposed to the Mac cocoa versions)?
I’ve heard those work on Tiger.

whaddayaknow? it worked!

Thanks!

When I try to install the Eclipse plug-in I get the following error:

Cannot complete the install because one or more required items could not be found.
Software being installed: Basic BrightScript Support 1.0.1.201009051518 (com.domhain.brightscript.plugin.basic.feature.group 1.0.1.201009051518)