Nova

Extensions


Readme

Linden Scripting Language (LSL) Nova extension

A Nova extension providing syntax highlighting for Linden Scripting Language (LSL), the scripting language used in the Second Life® and OpenSimulator virtual world platforms.

Based on the amazing work by Sei Lisa and Mako Nozaki, who compiled the LSL2 Keywords Database (version 0.0.20210612000), also known as KWDB, without which I would need to do everything manually (like I did for the first release!).

Language Support

This extension currently supports the following features of Linden Scripting Language:

  • Syntax Highlighting for the latest version of LSL (as of the current release of the KWDB)
  • Auto-completions for major LSL constructions, functions and constants (as far as I could make them work)
  • OpenSimulator & Aurora Sim LSL functions/constants (not all are correctly tagged, though)

Not done yet:

  • Hovering tooltips. I haven't figured out how that works without using a Language Server Protocol application.
  • Distinguishing global from local scopes for variables. This shouldn't be too hard, since LSL is rather rigid with declarations, but I haven't done it yet.
  • Making the jumps to definition work consistently.
  • Getting the scope selections to work.
  • Automagically updating the syntax auto-completions every time Lisa & Nozaki update their own database (there are now a few tools to help with that).

Disclaimers, Acknowledgements & Warnings

Like many other LSL syntax highlighters, this extension now uses the most excellent work done by Sei Lisa and Mako Nozaki on the LSL2/OSSL/AA Keywords Database and Derived Files Generator (also known as KWDB), providing a complete LSL2 Keywords Database for Second Life®, OpenSimulator, and AuroraSim.

While not affiliated with Linden Lab, the developers of KWDB have collected information from a lot of different sources and attempt to maintain a list of keywords as current as possible. They also provide a few conversion utilities to transform the kwdb.xml database into several popular syntax highlighting schemes.

But please note that LSL is a language in perpetual flux, with Linden Lab (and the OpenSimulator core developer team!) constantly adding new features and functionality, and sometimes making older versions obsolete, shuffling parameters around, etc. so at some point in time this extension will be inevitably out of sync, until I figure out a way to automatically parse the XML from the KWDB from within this Nova extension...

While this extension is mostly working, and should give you adequate syntax colouring (and even reasonable scoping) don't expect the results to be exactly the same as inside the viewer's editor. In particular, the colours will match your Nova theme, not the conventions set by Linden Lab. It's theoretically possible to create a new, specific theme to deal with the LL colour conventions, but I haven't done that yet (I'm not expecting many people to use this extension!).

Extra goodies!

Warning: for tinkerers, hackers, and hard-core Nova extension programmers only!

I've used the directory /Tools to keep around a few tools used to extract information from the KWDB and convert it into the XML that the Nova syntax extensions require. You're welcome to tinker with those, as well as submit push requests with your own contributions.

Although it's more conventional to do those tools in either Perl or Python, which are especially well-suited to the task of parsing XML quickly, or, alternatively, do them in JavaScript, so that they could be simply integrated into Nova, I'm not proficient enough in either of those, so I simply did it in Go. The directory also includes a README.md with some simple tips on how to properly compile those.

Legal Acknowledgements

Second Life®, Linden Scripting Language and the inSL logo are trademarks of Linden Research, Inc. No infringement is intended.

Nova® and the Nova logo are registered trademarks of Panic Inc.

The KWDB (a.k.a. LSL2/OSSL/AA Keywords Database and Derived Files Generator) is copyrighted by Sei Lisa and Mako Nozaki and released under a GNU Lesser General Public License 3, with parts also copyrighted by Linden Lab and released under the same license.

Some of the test files under the /Tests directory have been shamelessly copied from the LSL Portal section of the Second Life Wiki, and, for the OpenSimulator dialect of LSL, from the OpenSimulator Wiki; their authors are credited on each of them.

Gwyneth Llewelyn is not affiliated with either of these companies or organisations, much less endorsed by any of them.


Changelog

Version 1.5.0

Syntax highlighting now based on parsing elements of the KWDB LSL2 Keywords Database (version 0.0.20210612000).

Version 1.0.0

Initial release with most of the syntax, some auto-completions, and a menu option.


License

BSD 3-Clause License

Copyright (c) 2021, Gwyneth Llewelyn All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.