Skip to content

Add luau-lsp files to the viewer#5327

Closed
tapple wants to merge 3 commits into
secondlife:project/lua_editorfrom
tapple:add-luau-lsp-files
Closed

Add luau-lsp files to the viewer#5327
tapple wants to merge 3 commits into
secondlife:project/lua_editorfrom
tapple:add-luau-lsp-files

Conversation

@tapple

@tapple tapple commented Jan 24, 2026

Copy link
Copy Markdown

These are the two files that any installation of the Luau Language Server (luau-lsp) needs to make sense of slua code. Currently, vscode plugin builds these two files based on these two files it fetches from the viewer:

Instead, I propose the viewer and/or simulator keep these two files on-hand so that the vscode plugin and other editors (including the viewer's builtin editor) can handle slua without complex file transformation.

These two files were generated by the latest unreleased version of the vscode plugin. Further auto-generated updates to these files will be in a seperate PR #5328 (View the diff)


Part of a set:

@marchcat

Copy link
Copy Markdown
Contributor

Thank you, @tapple!

@marchcat

Copy link
Copy Markdown
Contributor

@Rider-Linden, please take a look.

@Rider-Linden

Copy link
Copy Markdown
Contributor

The d.luau files are uses only by Lua LSPs that are forked from JohnnyMorganz' luau-lsp plugin. Although one of the most popular there are other plugins and editors that do not use the .d.luau format we would like to support (Neovim, Zed, Helix).

Delivering the JSON and having the plugin generate the appropriate configs file strikes me the correct approach.

I don't object to providing these two files as a reference but it should be made clear that they are not canonical.

@tapple

tapple commented Jan 26, 2026

Copy link
Copy Markdown
Author

These ones I found use JohnnyMorganz luau-lsp:

I can't quickly find any editors supporting luau that don't use JohnnyMorganz luau-lsp

@HaroldCindy

Copy link
Copy Markdown

Hmm, realistically, luau-analyze itself isn't sufficient for our purposes, and we need luau-lsp to be able to describe our API extensions correctly. luau-lsp is the choice of LSP for Luau, so I wouldn't feel too badly about depending on it for type checking. It also provides luau-lsp analyze for that purpose.

@HaroldCindy

Copy link
Copy Markdown

Spoke with @Rider-Linden about this. Seems like really what we want is to send down the current contents of the definitions YAML (maybe reserialized as JSON for the JSON-RPC stuff) to external consumers, rather than bundle a generated artifact from that source of truth that the viewer itself will not use. The keywords XML will probably have to remain in-repo because the in-viewer editor's syntax highlighting impl is a bit of a weird case, but otherwise we're looking at providing a way for the JSON-RPC clients to get the full definitions blob the server is currently using. They can generate whatever schema they want (.d.luau, Selene definition, etc) based on that blob.

@tapple

tapple commented Jan 27, 2026

Copy link
Copy Markdown
Author

Oh. Selene uses a third format I was unaware of: https://kampfkarren.github.io/selene/usage/std.html

If that's the official consensus though, I guess I'll work on generating types_lua.xml and updating the vscode plugin to work with the changes I made to its schema

@tapple

tapple commented Feb 5, 2026

Copy link
Copy Markdown
Author

This can be closed as harold is working on a better solution: https://github.com/secondlife/lsl-definitions/pull/46/files

@tapple tapple closed this Feb 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants