Giter Club home page Giter Club logo

sublime-lsl's Introduction

License Requires Sublime Text Build 4073 or later Download =BB= LSL from Package Control Latest tag SublimeHQ Discord

Table of contents


=BB= LSL package for Sublime

Bringing Linden Scripting Language (LSL) support to Sublime Text.

About

With regards to the development of this package, supporting new features of Sublime Text as they become available takes precedence over ensuring backwards compatibility. Therefore this package targets and is tested against the latest Build of Sublime Text, releases are frequent and the requirements for this package will be updated accordingly. Implicitly this might require you to be on the dev release channel and consequently have a valid Sublime Text license.

Requirements

Installation

Make sure your setup meets the requirements before you:

  • open Sublime Text
  • open the command palette
    • via Tools > Command Palette
  • select Package Control: Install Package
  • select =BB= LSL

To get LSL syntax highlighting in tooltips, refer to the settings section.

Close and re-open Sublime Text.

Usage

When editing scripts in the viewer, click the EDIT button in the script edit window. Save and close view (tab) when done.

To use Sublime Text for editing your script in-world:

  • Enable: Me > Preferences > Advanced > Show Advanced menu
  • Go to: Advanced > Show Debug Settings
  • Edit: ExternalEditor

Setting consists of these three parts:

  • Path to editor (use quotes if path has spaces)
  • Optional command line params
  • "%s" will paste script path automatically (do NOT change this)

For a list of Sublime arguments run subl --help and/or refer to the OSX Command Line documentation.

Usage on Linux

"/usr/bin/subl" "%s"

Usage on macOS

"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" "%s"

Usage on Windows

"C:\Program Files\Sublime Text\subl.exe" "%s"

Building

runs lslint

  • Select Tools > Build on Linux or macOS.
  • Select Tools > Build with … on Windows and select a binary to use.

Output to a Build results panel, in which you can double click (possible) errors to move the cursor to that point in your file.

Color Scheme

Sublime Text 3 Color Scheme documentation

You can toggle using the official Color Scheme for LSL files by selecting Preferences > Package Settings > =BB= LSL > Settings > Use official color scheme for LSL files from the main menu.

The color scheme file can be overridden via Packages/User/LSL.hidden-color-scheme.

Contributing

The issue tracker can be found at https://github.com/buildersbrewery/sublime-lsl/issues.

Please read CONTRIBUTING.md and make sure tests pass before sending a pull request.

Linting

Requires the SublimeLinter package, uses the included binaries lslint if not found in PATH.

Linting of LSL files using the Firestorm preprocessor was deprecated in v5.0.0.

SublimeLinter with lslint

Indent styles

LSL Indent Styles

You can change the indent style of all LSL completions and snippets to:

  • Allman
  • GNU
  • Horstmann
  • K & R
  • Lisp
  • Pico
  • Ratliff
  • or Whitesmiths

by:

  • selecting Preferences > Package Settings > =BB= LSL > Settings > Choose indent style from the main menu
  • or selecting Preferences: LSL: Settings - Indent Style in the command palette

Settings

Sublime Text 3 Settings documentation

Open Preferences > Settings from the main menu.

These mdpopups.* settings are needed to get LSL syntax highlighting in tooltips:

//  "Packages/User/Preferences.sublime-settings"

{
    "mdpopups.sublime_user_lang_map":
    {
        "lsl":
        [
            [ "lsl" ],
            [ "=BB= LSL/.sublime/syntaxes/LSL" ]
        ]
    },
    "mdpopups.use_sublime_highlighter": true
}

Tooltips

LSL Tooltips

To get LSL syntax highlighting in tooltips, refer to the settings section.

Disclaimer

Second Life (R) and the Linden Scripting Language are trademarks of Linden Research, Inc.

The Builder's Brewery is neither affiliated with nor sponsored by Linden Research.

sublime-lsl's People

Contributors

buildersbrewery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublime-lsl's Issues

Wrong cursor-position after new-line (ENTER)

Hello again,

my indention-style is K & R, and it works when it comes to autocompletions. But something odd happens when I press the ENTER for the new line. Instead of being indented with 4 characters it suddenly doesn't indent and is on the same level as the parent.

I thought it is because the indention-styles and changed to others, but it seems not related with this selection.

How can I recover the default behavior again?

Expected behavior (see cursor)

default {
    if(x) { // <- Press ENTER
        |
    }
}

Actual behavior (see cursor)

default {
    if(x) { // <- Press ENTER_
    |
    }
}

Steps to reproduce

Press Enter on the position where the comment starts with the // characters in an LSL document.

Environment

=BB= LSL:
    version: 1.4.1
    installed via Package Control: True

Sublime Text:
    channel: stable
    build: 3143
    portable: False
    platform: MacOS Sierra ( 10.12.6 )
    architecture: x64

Firestorm preprocessor not parsed/linted correctly

According the project description, it's my understanding that directive like #include or switch should be implemented but, for me at least, they appears as error.

#define USE_SWITCHES
...

switch (function)
        {
            case RNDGETINT: 
            {   
                data=data+","+(string)lslPRNGRandomInteger(seed);
                break;
            }
            case RNDGETFLOAT: 
            {   
                for (i=0;i<NumDice;i++){

                }
                data=data+","+(string)lslPRNGRandomFloat(seed);
                break;
            }
            case RNDGETKEY: 
            {
                data=data+","+(string)lslPRNGRandomKey(seed);
                break;
            }
            case RNDSETSEED: 
            {   
                seed=llList2Integer(Payload, 1);
                data=data+","+"ok";
                break;
            }

        }

gave a syntax error at 'case RNDGETINT: '

Did I missed something in the settings or misunderstood that functionality for the linter ?

Thanks.

Environment

=BB= LSL:

    version: 1.4.1
    installed via Package Control: True

Sublime Text:

    channel: ?
    build: ?
    portable: ?
    platform: macOS
    architecture: x64

Error when running lslint: __init__() got an unexpected keyword argument 'cancel'

When I run lslint via ctrl+b, I get an error message:

__init__() got an unexpected keyword argument 'cancel'

Removing the "cancel": { "kill" : true}, part from LSL.sublime-build allows it to work as expected.

Environment

=BB= LSL:

    version: 1.2.0
    installed via Package Control: True

Sublime Text:

    channel: stable
    build: 3143
    platform: Linux
    architecture: x64

Opening any LsL script causes error.

Actual behavior

SublimeLinter: #1 lslint sl_script_d0a7becf2e4425b8834708da06decc0c.lsl
ERROR: ===
Linter crashed.

Traceback

Traceback (most recent call last):
  File "...\Sublime Text 3\Installed Packages\SublimeLinter.sublime-package\lint/backend.py", line 100, in execute_lint_task
    errors = linter.lint(code, view_has_changed, settings) or []
  File "...\Sublime Text 3\Installed Packages\SublimeLinter.sublime-package\lint/linter.py", line 758, in lint
    cmd = self.get_cmd()
  File "...\Sublime Text 3\Installed Packages\SublimeLinter.sublime-package\lint/linter.py", line 482, in get_cmd
    if '@python' in which:
TypeError: argument of type 'property' is not iterable

Steps to reproduce

  • This is the first step.
    1. Open a LsL script

Environment

=BB= LSL:

    version: 2.2.0
    installed via Package Control: True

Sublime Text:

    channel: dev
    build: 3156
    portable: False
    platform: Windows
    architecture: x64

lslint fails (Using wrong folder)

Tools > Build Fails

sublime-lsl is looking in the wrong folder for included lslint executable

it is looking inside the bin folder, the files are in the lib folder.

Expected behavior

pressing tools > build in the menu should not error with failure to find file

Actual behavior

Error thrown in console

[WinError 2] The system cannot find the file specified
[cmd: ['C:\\Users\\user\\AppData\\Roaming\\Sublime Text 3\\Packages\\=BB= LSL\\bin\\lslint\\windows\\lslint.exe', '-i', '-m', '-p', '-w', '-z', 'C:\\Users\\user\\projects\\sl\\lsl\\file.lsl']]
[dir: C:\Users\user\projects\sl\lsl]

Steps to reproduce

Open lsl file, press the build option in the tools menu and build for any windows

Environment

=BB= LSL:
    version: 4.3.0
    installed via Package Control: True

Sublime Text:
    channel: dev
    build: 3189
    portable: True
    platform: Windows
    architecture: x64

Packages:
    Package Control: v3.3.0
    PackageDev: v3.2.7

Dependencies:
    SublimeLinter: 4.9.4
    markupsafe: 0.23.0
    mdpopups: 3.4.0
    pygments: 2.0.2
    python-jinja2: 2.8.0
    python-markdown: 2.6.11
    pyyaml: 3.12.0
    ruamel-yaml: 1.2.0

Linting and tooltips broken in Sublime Text `Build 4107`

After updating or installing Sublime Text Build 4107 and installing all the packages, linting doesn't work and after restarting Sublime Text tooltips are not displayed.

I have tried to do a clean install, removing everything related to previous versions, and it doesn't solve the issue.

Environment

Sublime Text:
  build: 4107
  channel: dev
    portable: false
  platform: windows x64

Packages:
    =BB= LSL:
        version: 6.0.0
        installed via Package Control: True
    Package Control: 3.4.1
    PackageDev: 3.2.16

Dependencies:
    SublimeLinter: 4.16.3
    markupsafe: 1.1.1
    mdpopups: 4.1.2
    pygments: 2.0.2
    python-jinja2: 2.10.1
    python-markdown: 3.1.1
    pyyaml: 5.1.1
    ruamel-yaml: 1.2.0
    sublime_lib: 1.4.0

lslint binaries not executable on Linux and Mac

The linux and mac binaries need to be chmod +x in order to run.

Expected behavior

lslint should run.

Actual behavior

lslint doesn't run (errno 13)
Makopo/siblime-text-lsl does the chmod in init.py, but not sure that's needed (vs. just distributing the files with the right file permissions.)

Environment

=BB= LSL:

    version: 1.2.0
    installed via Package Control: True

Sublime Text:

    channel: stable
    build: 3143
    portable: True
    platform: Linux
    architecture: x64

SublimeLinter: reason: [Errno 13] Permission denied (lslint)

Get a error-message in console that the directory/file for lslint wasn't found or permission is when startup Sublime.

Actual behavior

No lint and following error-message in console:

SublimeLinter: ERROR: could not launch ['/Users/slunardi/Library/Application Support/Sublime Text 3/Packages/=BB= LSL/bin/lslint/osx/lslint', '--version'] 
SublimeLinter: reason: [Errno 13] Permission denied 
SublimeLinter: PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 
SublimeLinter: WARNING: no lslint version could be extracted from:
 
CodeFormatter: Plugin Initialized
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 210, in on_api_ready
    m.plugin_loaded()
  File "/Users/slunardi/Library/Application Support/Sublime Text 3/Packages/=BB= LSL/main.py", line 94, in plugin_loaded
    chmod_lslint()
  File "/Users/slunardi/Library/Application Support/Sublime Text 3/Packages/=BB= LSL/main.py", line 85, in chmod_lslint
    stat.S_IXOTH)
FileNotFoundError: [Errno 2] No such file or directory: '=BB= LSL/bin/lslint/linux/lslint'

I've looked into the directory and the files are available, and they're:

  • /Users/slunardi/Library/Application Support/Sublime Text 3/Packages/=BB= LSL/bin/lslint/linux/lslint
  • /Users/slunardi/Library/Application Support/Sublime Text 3/Packages/=BB= LSL/bin/lslint/osx/lslint

Terminal:

drwxr-xr-x   3 slunardi  staff     102 26 Dez 23:13 .
drwxr-xr-x  10 slunardi  staff     340 26 Dez 23:35 ..
-rw-r--r--   1 slunardi  staff  406040 26 Dez 23:13 lslint

Tried also to do chmod +x lslint but even with executable attribute, it doesn't work. I can't even execute it in the Terminal.

I can touch, edit, modify the file, so it can't be a permission issue.

Settings are set as like in the guidelines. (do i need to add the lsl-linter into the SublimeLinter settings, too? (just have add the code of the guidelines into my Preferences.sublime-settings for user.

Sublime-User-Preferences:

{
	"color_scheme": "Packages/User/SublimeLinter/base16-ocean.light (SL).tmTheme",
	"font_size": 13,
	"ignored_packages":
	[
		"Vintage"
	],
	"tab_size": 4,
	"theme": "Default.sublime-theme",
	"translate_tabs_to_spaces": true,

    "mdpopups.sublime_user_lang_map": { 
        "lsl": [
            [ "lsl" ],
            [ "=BB= LSL/.sublime/syntaxes/LSL" ]
        ]
    },
    "mdpopups.use_sublime_highlighter": true
}

Environment

=BB= LSL:
    version: 1.4.1
    installed via Package Control: True

Sublime Text:
    channel: stable
    build: 3143
    portable: False
    platform: MacOS Sierra ( 10.12.6 )
    architecture: x64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.