Skip to content

Generate slua_default.d.luau file#42

Merged
HaroldCindy merged 26 commits into
secondlife:mainfrom
tapple:generate-luau-lsp-files
Jan 27, 2026
Merged

Generate slua_default.d.luau file#42
HaroldCindy merged 26 commits into
secondlife:mainfrom
tapple:generate-luau-lsp-files

Conversation

@tapple

@tapple tapple commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Any instance of the Luau Language Server (luau-lsp) needs two files to make sense of slua code:

  • slua_default.d.luau (for type checking)
  • slua_default.docs.json (for documentation comments)

Currently, the code to autogenerate these files lives in the vscode plugin. I propose the code to generate these two files is moved here so it can be done once, and any future slua code editor (including the viewer's builtin editor) can make use of them.

To inspect the autogenerated files, see this PR, where I add them to the viewer:

This PR autogenerates slua_default.d.luau. docs will follow in another PR


Part of a set:

@tapple tapple changed the title Generate luau lsp files Generate slua_default.d.luau file Jan 26, 2026
@tapple tapple marked this pull request as ready for review January 26, 2026 22:18
@HaroldCindy

Copy link
Copy Markdown
Collaborator

May want to rebase on top of the current main, since #38 was merged in squashed form

@tapple tapple force-pushed the generate-luau-lsp-files branch from ba74c08 to 853fcc0 Compare January 27, 2026 19:36
@tapple

tapple commented Jan 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased

@HaroldCindy HaroldCindy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, thanks!

Comment thread gen_definitions.py
if self.callable:
f.write("(")
f.write(self.callable.type_def_string())
f.write(") & ")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, seems obvious in retrospect, thanks!

@HaroldCindy HaroldCindy merged commit 5715f66 into secondlife:main Jan 27, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 27, 2026
@HaroldCindy

Copy link
Copy Markdown
Collaborator

@tapple This is great! I think I'll set up a Github release action that generates and posts a zip of the relevant syntax files. I'd also like to add a capability to the sim so you can request whatever pre-generated output from the simulator's lsl_definitions.yaml you want.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants