Add Definition Files for Steamodded - #399
Conversation
Aurelius7309
left a comment
There was a problem hiding this comment.
looks good i totally checked everything no cap frfr
|
Oh heh, I guess if you're providing type definitions for vanilla stuff to, I might drop what I have in case it helps y'all |
Looked through it, I already have a general structure idea but this also has a ton of the |
Currently, Steamodded is not written in a way that allows you to comfortably run Lua LSP. A massive majority of functions do not have any indications of what they do besides name along with lacking any typing on their parameters. the LSP fails completely at finding API functions since they're either not defined in the workspace itself or are created inside tables which the LSP doesn't recognize. Lower-end computers may also run into performance issues if they throw the whole repo + Balatro + any mods into the workspace.
These definition files are the fix. The files are picked up by the LSP allowing auto-complete during object creation, typing for SMODS function parameters, and any additional warning (e.x. deprecated) required. Ideally with these files already set up, keeping them up-to-date with the repo is relatively simple and mostly low-maintenance.
How to Set Up / Test
lsp_deffolder) is downloaded..luarc.jsonsettings file into your directory.This should make the definition files inside
lsp_defa part of the workspace, making any.luafile have autocomplete for Steamodded params/functions that have been added intolsp_def.Currently written files:
Classes:
Other
generate_card_UI,poll_edition, etc.). This is to ensure that mod devs don't run into errors from function params going missing because the vanilla code is heavily modified.ui.luafile specifically)Note that these completions may still be missing fields tied to their classes, or have incomplete/missing descriptions.