raysilent / lslforge

LSLForge - Eclipse plugin to assist with LSL scripting for Second Life. This repository is used for development, pull requests and bug reports.
16 stars 8 forks source link
eclipse-plugin linden-scripting-language lsl second-life secondlife syntax-highlighting

LSLForge

An LSL Script Editor/compiler for Second Life's Scripting Language.

LSLForge is a fork of the popular LSLPlus editing environment, to provide Linden Scripting Language (LSL) support in Eclipse.

Description

LSLForge is a plugin for the Eclipse platform. The plugin allows editing, "compiling" (gathering code included in modules), executing, and unit testing your Second Life® Linden Scripting Language (LSL) code.

Because it is an Eclipse plugin, when you use LSLForge you can take advantage of many of the useful features of Eclipse. Integrated support of a source code control system such as Git, CVS and Subversion comes for "free", and there are many other features — task list management, integration with bug tracking tools, etc. You will of course need to make sure you get the appropriate plugins to use these features.

Forks Purposes

Changelog

Second Life® Group

The official group for LSLForge Editor tool is LSLForge Users. General announcements, questions and answers.

Installing

Eclipse Plugin

Incompatible Versions

Compatible Versions

The following Eclipse Distributions were found working:

NOTE: Oomph seems to restore LSLForge native setting despite attempts to overwrite the field. The only workaround for now is to check [X] Skip automatic task execution at startup time under Oomph > Setup Tasks in Preferences.

Platforms that used to work but not tested recently:

How to Install

To install a plugin into Eclipse, choose Help > Install New Software. Click Add... and enter the link for location:

If you don't see any items for installing, try to uncheck "Group items by category"

Run eclipse -clean to force it to forget cached downloads

Checkbox 2 items:

Install, accept and restart Eclipse

Switch to LSLForge Perspective and create a new LSLForge Project

Known Issues

Tips & Tricks

Importing Modules

This demonstrates:

Modules/Debug.lslm :

$module (integer DEBUG)
// pragma inline
bug(string place, string message) {
  if (DEBUG) llOwnerSay("["+llGetScriptName()+"."+place+"]: "+message);
}

Script.lslp :

integer DEBUG=TRUE; // has to be a variable
$import Modules.Debug.lslm(DEBUG=DEBUG) de;

do() {
  debug("do()", "This is a call of 'bug' function from 'de' module");
}

Referencing Modules From Other Projects

Imagine you move Modules folder to a separate project called ModulesProject to use it from different other projects. In the main project that uses ModulesProject, place a checkbox along its name under Project settings > Project References.

ModulesProject directory tree becomes part of the project's tree. It will still be imported as $import Modules.Debug.lslm without any additions.

Native Executable Compilation

If LSLForge is behind from the newest LSL definitions of functions and constants, you may compile an executable for yourself, by git cloning the source and digging into lslforge\haskell\src\Language\Lsl\Internal\FuncSigs.hs and/or lslforge\haskell\src\Language\Lsl\Internal\Constants.hs and following the already existing examples. You will need to compile the code now with Haskell compiler and specify newly built file in Eclipse LSLForge Preferences. This should be enough for a while. Continue reading for details.

Requirements

To compile the native LSLForge binary, you must have the cross-platform Haskell Stack tool installed.

Stack can then ensure that the correct compiler and dependencies for the project will be automatically downloaded and installed for you.

To install Stack, please visit the Stack Homepage and follow the instructions. It is likely that you can find a package available at many package managers e.g. chocolatey, homebrew and pacman, but check before installing that their stack version is up-to-date.

Configure Stack if desired:

Compiling Haskell native LSLForge binary

In a terminal, change directory to the project's lslforge/haskell subdirectory.

Run stack upgrade to upgrade to the latest version.

You will need to enter stack setup if you have a freshly installed Stack, or don't have the relevant compiler already set up. (Stack will tell you if you need to run this additional step.)

Now run with admin terminal stack install in lslforge/haskell folder to build and install the LSLForge binary in one step. (Weird access denied errors are due to Antivirus.)

Post-compilation

If your stack install is successful, an executable will appear at %APPDATA%\local\bin folder for Windows, or $HOME/.local/bin for other platforms (look at the message after install) - unless you changed the local-bin-path parameter in config.yaml to override default location.

To test the newly built file, you can specify it in the existing LSLForge Eclipse installation under Preferences > LSLForge settings. This will not make any new definitions show immediately, but they will after restarting Eclipse.

If you enable Eclipse Error Log View, it will print out current version of the executable in use, as well as its actual location.

Building for Publishing

Running Tests

Version Number Change

Compile Haskell Executable & Move to Eclipse Plugin Source Location

Switch to lslforge subfolder.

Eclipse Plug-in Compilation