#lsp / language server pack

1 messages · Page 1 of 1 (latest)

brave quail
#

https://github.com/frostice482/balatro-lsp

if you're doing mod development and wanting to autocomplete vanilla features, then you might want to get yourself a language server & language server packs.
this project tries to bring more documentation for the balatro's api, giving autocompletes, highlighting potential mistakes, and reducing the undefined global G warnings.

installation

  1. install lua language server (see https://luals.github.io/#vscode-install for guide)
  2. install love2d's language pack through addons manager (see https://luals.github.io/wiki/addons/#enabling-addons for guide)
  3. grab a local copy of the lsp from the repo
    • if you have git, simply run git clone https://github.com/frostice482/balatro-lsp.
      otherwise, grab a local copy (https://github.com/frostice482/balatro-lsp/archive/refs/heads/master.zip, extract it)
    • the easiest way to adding it is by putting it somewhere in your workspace.
      • If you .gitignore the folder, you'll need to include the folder in workspace.library configuration,
        e.g. { "Lua.workspace.library": ["balatro-lsp"] } for VSCode
    • if you decided to put it outside of your workspace, include the lsp's folder in workspace.library configuration (Lua.workspace.library on VSCode's .vscode/settings.json).

SMODS

if you have SMODS' lsp_def included, some vanilla definitions from SMODS may conflict (see vanilla.lua). you can remove it from your workspace.

GitHub

(Incomplete) LSP for Balatro. Contribute to frostice482/balatro-lsp development by creating an account on GitHub.

edgy haven
#

thats very good

fair moth
#

peak

brave quail
#

peak

brave quail
#

example .vscode/settings.json, assuming balatro-lsp is in the workspace

{
    "Lua.workspace.library": [
        "${addons}/love2d/module/library",
        "balatro-lsp"
    ],
    "Lua.runtime.version": "LuaJIT",
    "Lua.workspace.checkThirdParty": false,
    "Lua.runtime.special": {
        "love.filesystem.load": "loadfile"
    }
}
#

i think ive made 10 edits on the post, this should be final one

obtuse vale
#

Oh neat

#

I had my LSP working by just pointing it to the game files

#

I know @brave compass was working with vanilla LSP stuff for smods might be worth considering adding this to smods directly

brave compass
#

Merging this with my current work makes sense

brave quail
naive swan
obtuse vale
#

Usually I do just vanilla files. Modded dumps are probably fine but there's a chance of missing info from files not patched and also a mod changing a function signature might mislead you into thinking that is how it is always

naive swan