Skip to content

WolfGangS/sl_lua_types

Repository files navigation

Visit https://slua.wlf.io for documentation and static links for latest downloads.

See here and here for more information about lua in secondlife.

Example of syntax highlighting and hovertips

Created with plenty of help and original findings from @gwigz

This project is not associated with Linden Lab any use of trademarks or copyrighted terms (like Second Life) is done in good faith to explain clearly what this project is for, and not an attempt to misrepresent

VSCode installation

With SL External Editor extension

  • Install SL External Editor extension
  • Install Luau Language Server extension
  • Install Selene extension
  • Enable the SL External Editor extension for your workspace with the > SL External Editor: Enable command
  • Definitions should automatically update
    • They can be manually updated with the > SL External Editor: Update LSP Defs command

Manual installation without extension

Download a sl_lua_types.zip from here and extract

Setup Snippets

  • Copy the luau.code-snippets file to your workspaces .vscode folder

Setup luau-lsp (Inline type checks, code completion, some linting)

Work is happening to add support for setting urls for definitions in the vscode extension, to allow automatic updating of the definitions. For now you will need to update them manually. When they change

  1. Install vscode

  2. Install this extension (github link)

  3. Extract and place those files somewhere memorable (<user_dir>/.sl-luau/ for instance)

  4. Then Either globally or in your project add the 2 files to the options with the following config

    "luau-lsp.types.definitionFiles": [
        "~/.sl-luau/ll.d.luau"
    ],
    "luau-lsp.types.documentationFiles": [
        "~/.sl-luau/ll.d.json"
    ],
    "luau-lsp.platform.type": "standard"

    or through the UI

  5. You may need to restart vscode or reload the ui

Setup Selene (linting)

  1. Install this extension to vscode (github link)
  2. Add the the sl_selene_defs.yml to your project
    • if you choose to put it in a folder rather than the project root you will need to edit the std entry in the toml to reflect that
  3. Copy the provided selene.toml to the root of your project or write your own with a format similar to this
    std = "sl_selene_defs"
    
    [rules]
    global_usage = "allow"
    shadowing = "allow"
    
    [config]
    empty_if = { comments_count = true }
    unused_variable = { ignore_pattern = "^_|^touch_start$|^touch_end$|^touch$" }
  4. Selene should pick this up and start giving you linting hints.

Recommendations

About

Type Defs for SL lua

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •