Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua-enet, luasocket, and utf8 support #9

Open
chipsenkbeil opened this issue Jan 6, 2025 · 1 comment
Open

lua-enet, luasocket, and utf8 support #9

chipsenkbeil opened this issue Jan 6, 2025 · 1 comment

Comments

@chipsenkbeil
Copy link

Hi there! I was looking into setting up the Lua language server to work with love2d for definitions, and was trying to figure out what the process is to include definitions for some of the other libraries and implementations bundled by love.

Specifically, my understanding is that alongside the global love instance, there are three libraries that can be required:

  1. lua-enet
  2. luasocket
  3. utf8

I've been able to set up a .luarc.json for neovim that works with love, but haven't been able to figure out a setup for the three above.

.luarc.json

I created a .addons directory at the root of my project and within it I created a git submodule for LuaCATS/love2d and LuaCATS/luasocket. This works for the global love, but not the luasocket import as local socket = require("socket") and there aren't equivalents that I'm aware of for enet and utf8 implementations within love.

{
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  "runtime": {
    "version": "LuaJIT"
  },
  "workspace": {
    "library": [
      ".addons/love2d",
      ".addons/luasocket",
    ],
    "userThirdParty": [
      ".addons"
    ]
  },
}
@chipsenkbeil
Copy link
Author

From the friendly folks on the love2d discord, I can get utf8 working from the builtin Lua 5.3 definition by adding:

{
  "runtime": {
    "builtin": {
      "utf8": "enable",
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant