Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

ByronStar SL - Eclipse IDE - LSL Editor

ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-09-2007 04:50
For my convenience I have created an eclipse plugin to deal with SL script editing. Since this might be of interest to other as well, I now have published it on SourceForge.

ByronStar SL (OpenSource under EPL - http://byronstar-sl.sourceforge.net/) provides an IDE for SecondLife and Linden Scripting Language. The initial release consists of a text editor (including parser) for LSL with rich features: syntax highlighting, auto completion, content folding, error markers and outline view. The plugin is based on Eclipse 3.2 and there is an eclipse update site availabe: http://byronstar-sl.sourceforge.net/update.

Hope this is regarded useful, there are further enhancements in the pipe and any feedback is appreciated.

Regards,
ByronStar
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
01-09-2007 17:27
Sounds very cool! I've downloaded the Eclipse 3.2 SDK and installed the plugin using the Software Updates feature (at least I think it's installed). Is there any information you can give to non-eclipse users on how to jump into creating LSL files?
_____________________
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-10-2007 01:25
To have a quickstart, just do the following:

- Start eclipse with a workspace of your choice
- Create a new project (File->New->Project->General->Project) with any name
- Create a new file under this project (File->New->File) with any name and extension .lsl
- Start editing the file (the SL editor plugin should be opened as editor by default)
- Once you are ready to test you have to use Cut&Paste to transfer the source to SL

There are a lot of Eclipse standard features (version control and shared code in a team via CVS or SVN to be mentioned) which add value to this approach but can not be covered here in detail.

Hope this helps to get started,
ByronStar
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-10-2007 02:19
You aren't the first to build a LSL module for Eclipse.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Thygrrr Talaj
Registered User
Join date: 2 Jan 2007
Posts: 46
01-10-2007 02:25
From: Strife Onizuka
You aren't the first to build a LSL module for Eclipse.


So? He didn't claim otherwise. It's still a good deal, diversity means evolutions and choice.

Good job!
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-10-2007 04:23
From: Thygrrr Talaj
So? He didn't claim otherwise. It's still a good deal, diversity means evolutions and choice.

Good job!


I'd say more, but i don't remember if there was an NDA involved :confused:
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
01-10-2007 06:35
From: ByronStar Comet
To have a quickstart, just do the following:
- Start editing the file (the SL editor plugin should be opened as editor by default)


Scite-ez keeps opening the file. If I right-click the LSL file and choose Open With > I get Text Editor, System Editor, In-place Editor, and Default (which is Scite). Should I have another option?

One of the main reasons I want to try this is the Outline window on the side... I find myself always getting lost in big scripts.
_____________________
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-10-2007 10:58
From: Stylez Gomez
Scite-ez keeps opening the file. If I right-click the LSL file and choose Open With > I get Text Editor, System Editor, In-place Editor, and Default (which is Scite). Should I have another option?

One of the main reasons I want to try this is the Outline window on the side... I find myself always getting lost in big scripts.


Interesting...
There should be an editor option "BS LSLEditor" under "Open With" and
under "Window->Preferences" there should be an BS LSL preferences page as well.

You can check the installation status (Help-> Software Updates -> Manage Configuration) of the plugin: SecondLife IDE Plugin 1.1.3 (or 1.1.2) should be there and enabled. If not something went wrong during installation and you should retry.
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
Use release 1.1.4
01-10-2007 15:29
From: Stylez Gomez
Scite-ez keeps opening the file. If I right-click the LSL file and choose Open With > I get Text Editor, System Editor, In-place Editor, and Default (which is Scite). Should I have another option?

One of the main reasons I want to try this is the Outline window on the side... I find myself always getting lost in big scripts.


Ok, I have found the problem on my side! The plugin does not get active with the standard Eclipse 3.2.1 SDK, because of a dependency which only is available in the Eclipse 3.2.1 based WTP edition. In addition the 1.1.3 feature is pointing to the wrong update side, therefore "Find and Install...→Search for update of the currently installed features" does not work, use "Find and Install...→Search for new features to install" instead to install the fixed 1.1.4 release.

I did install the Eclipse 3.2.1 SDK and tested again - now it works fine! Sorry for the inconvenience.
Stylez Gomez
Union Micro
Join date: 4 Jun 2004
Posts: 146
01-10-2007 16:17
Okay, I reinstalled and all is good now! Thanks! :D

Edit: I've noticed that it doesn't like my http_response events, it is underlining them and not updating the Outline window - this script builds fine in lslint and SL. How can I tell it to not parse for script errors? The Outline also doesn't seem to be detecting states other than default.
_____________________
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-11-2007 00:29
From: Stylez Gomez
Okay, I reinstalled and all is good now! Thanks! :D

Edit: I've noticed that it doesn't like my http_response events, it is underlining them and not updating the Outline window - this script builds fine in lslint and SL. How can I tell it to not parse for script errors? The Outline also doesn't seem to be detecting states other than default.


Send (byronstar@users.sourceforge.net) or post the script - I'll have a look. The outline is not refreshed in case of errors, so that explains the outline behaviour. The other symptoms are strange, but probably I have to adjust the grammar and the parser. I can easily check and adapt based on your code example.
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-13-2007 02:15
From: Stylez Gomez
Okay, I reinstalled and all is good now! Thanks! :D

Edit: I've noticed that it doesn't like my http_response events, it is underlining them and not updating the Outline window - this script builds fine in lslint and SL. How can I tell it to not parse for script errors? The Outline also doesn't seem to be detecting states other than default.


You are absolutely right the http_respose event was missing! I did base the event syntax on the client side lsl_guide, where this event is not documented. I have fixed it now in release 1.1.5 available on sourceforge. See http://byronstar-sl.sourceforge.net/update.html for additional enhancements to auto completion.
Tangletwigs Fairymeadow
Registered User
Join date: 30 Apr 2006
Posts: 57
01-13-2007 04:51
This is fantastic thank you ByronStar for your hard work in contributing this :)
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-15-2007 15:22
From: Tangletwigs Fairymeadow
This is fantastic thank you ByronStar for your hard work in contributing this :)


Thank you very much for that encouraging feedback! As a "gift" I have fixed three bugs with release 1.1.6 of the plugin. Most important the auto completion has been brought to the current level of functions and events as documented in the lslwiki. And a nasty bug in the lexxer and parser has been removed as well. See http://byronstar-sl.sourceforge.net/changes.html for details.

:) Enjoy :)
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-24-2007 13:54
There is a new version of ByronStar SL available on SourceForge (http://byronstar-sl.sourceforge.net/). Release 1.1.7 includes the following addons and fixes:

Code formatter added (new)
- A simple minded (no config / no templates) format action has been added to the editor's context menu
Text hover function finalized (new)
- For events and functions the syntax and an usage explanation is now shown as hover information
Parser did not accept negative float values (bug)
- This was at least the case in vector/rotation initializers

Hope this helps speeding up your LSL development - I have upgraded all syntax support to the 1.13 level as documented in the LSL Wiki.

Currently I am working on a CVS Library representation in SL, so that scripts can automatically be updated from there. Still it is a matter of Cut&Paste to update the Lib itself, but the distribution could be done via llRemoteLoadScriptPin. Any thoughts on this?
CyanAura Femto
Registered User
Join date: 1 Feb 2004
Posts: 14
01-25-2007 16:25
I have downloaded and installed Eclipse and ByronStar's plugin. I am not familiar with Eclipse so I don't know what to expect. I fired it up and pasted one of my scripts into it. All is well, no errors show.

Then I introduce an error by commenting out one of my variable definitions and go to "save" it. No errors noted. I figured it should tag an undefined variable. Should it - or am I expecting too much?
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-25-2007 23:23
From: CyanAura Femto
I have downloaded and installed Eclipse and ByronStar's plugin. I am not familiar with Eclipse so I don't know what to expect. I fired it up and pasted one of my scripts into it. All is well, no errors show.

Then I introduce an error by commenting out one of my variable definitions and go to "save" it. No errors noted. I figured it should tag an undefined variable. Should it - or am I expecting too much?


It definetively should, but for sure not in this version! The parser does not yet support semantical analysis, it just checks whether the syntax is correct. I am in the process of augmenting the code, but this will still take some time. Anyway checking of variables is the first item on that list.
Akiko Akebono
Registered User
Join date: 12 Jun 2004
Posts: 7
01-26-2007 22:25
I have installed this, but can't use it, and an error showed up:

Unable to create this part due to an internal error. Reason for the failure: The editor class could not be instantiated. This usually indicates that the editor's class name was mistyped in plugin.xml.

:confused: ?
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-27-2007 01:30
From: Akiko Akebono
I have installed this, but can't use it, and an error showed up:

Unable to create this part due to an internal error. Reason for the failure: The editor class could not be instantiated. This usually indicates that the editor's class name was mistyped in plugin.xml.

:confused: ?


In the details of this error or in the error log, there must be more explanation to this. Some Java stack trace would be necessary, to see where the problem arises. If you can post this or send it offline to [email]byronstar@users.sourceforge.net[/email] I can hopefully see where the problem is.
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-29-2007 13:07
From: Akiko Akebono
I have installed this, but can't use it, and an error showed up:

Unable to create this part due to an internal error. Reason for the failure: The editor class could not be instantiated. This usually indicates that the editor's class name was mistyped in plugin.xml.

:confused: ?


Finally I got it. There actually have been multiple problems with the source distribution. Most prominently there was a resource bundle missing. In addition I now have included .project and .classpath files. By following the instructions in the projects web the source distribution 1.1.7.1 can easily be imported: http://byronstar-sl.sourceforge.net/develop.html.
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
01-31-2007 23:09
There is a new version of ByronStar SL available on SourceForge (http://byronstar-sl.sourceforge.net/). Release 1.1.8 includes the following new feature:

o Template support for AutoCompletion

Now it is possible to create user defined templates for the most common code blocks (including template variable support). The template

myfunc (integer ${parm1}, string ${parm2}) {
${indent} llSay("parm1="+(string)${parm1}+",parm2="+${parm2});
${indent}}

is evaluated to

myfunc (integer a, string b) {
llSay("parm1="+(string)a+",parm2="+b);
}

while the next occurences of the variables automatically get replaced by the value supplied for the first occurence on syntax expansion. To create above text one has to type:

my<CTRL-SPACE><ENTER>a<TAB>b<ENTER>

Enjoy!
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
02-08-2007 14:54
From: ByronStar Comet
It definetively should, but for sure not in this version! The parser does not yet support semantical analysis, it just checks whether the syntax is correct. I am in the process of augmenting the code, but this will still take some time. Anyway checking of variables is the first item on that list.


With release 1.1.9 this request has been implemented!:cool:

There is a new version of ByronStar SL available on SourceForge (http://byronstar-sl.sourceforge.net/). Release 1.1.9 includes the following new features:

o Autocompletion for user variables and functions
o Variable Checking - detect undefined variables
Akiko Akebono
Registered User
Join date: 12 Jun 2004
Posts: 7
02-08-2007 18:39
hi, I got a ClassNotFoundException with this new version, and I'm sure the path is correct.

java.lang.ClassNotFoundException: de.byronstar.lsl.editors.LSLEditor

could you help me~~
ByronStar Comet
Registered User
Join date: 8 Dec 2006
Posts: 16
02-09-2007 00:17
From: Akiko Akebono
hi, I got a ClassNotFoundException with this new version, and I'm sure the path is correct.

java.lang.ClassNotFoundException: de.byronstar.lsl.editors.LSLEditor

could you help me~~


Sure, just post the Stack trace from the Eclipse .log file (you can find it in the .metadata folder of your current workspace) - even better send the complete file to [email]byronstar@users.sourceforge.net[/email] after you have emptied it and reproduced the error. This should provide me with some more details. Do you use the source package or the local update site or the remote update site for installation?
Udo Tuxing
Registered User
Join date: 17 Oct 2006
Posts: 5
02-17-2007 06:34
Could you explain how code formating works? I dont get it ;-(
1 2