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

Sumneko don't do Lua diagnostics correctly. #102

Open
YPetremann opened this issue Nov 10, 2023 · 2 comments
Open

Sumneko don't do Lua diagnostics correctly. #102

YPetremann opened this issue Nov 10, 2023 · 2 comments

Comments

@YPetremann
Copy link
Contributor

I use my ~/.factorio/mods as workspace

here the workspace config:

{
  "factorio.versions": [
    {
      "name": "Home",
      "factorioPath": "~/.factorio/bin/x64/factorio",
      "active": true
    }
  ],
  "Lua.workspace.library": [
    "/home/ypetremann/.factorio/data"
  ],
  "Lua.workspace.userThirdParty": [
    "/home/ypetremann/.config/Code/User/workspaceStorage/41d17afb68f79f41547c41aa0b00bf09/justarandomgeek.factoriomod-debug/sumneko-3rd"
  ],
  "factorio.docs.docLinksVersion": "current",
  "factorio.package.zipLocation": "outside"
}

Sumneke throw me errors like :

Undefined global `game`.
Undefined global `serpent`.
Undefined global `rendering`.
Undefined global `script`.
Undefined type or alias `EventData.on_gui_checked_state_changed`.
...

This indicatre that sumneko don't work correctly with the factorio modding toolkit

@K1ngLui
Copy link

K1ngLui commented Nov 25, 2023

If you are using sumeko Lua V3.7.3 on Linux there are popups missing. I've had the same problem.
Those missing popups result in not having the correct path in "Lua.workspace.library"

You could change the Version to V3.7.0 then the popups should show up, or you can add this path to your libraries.

"/home/your_name/.config/Code/User/workspaceStorage/{hex-num}/justarandomgeek.factoriomod-debug/sumneko-3rd/factorio/library"

@justarandomgeek
Copy link
Owner

This seems to be related to the recent changes in LuaLS checking for libraries:
LuaLS/lua-language-server#2419
LuaLS/lua-language-server#2354

I've found setting "Lua.workspace.checkThirdParty": "ApplyInMemory" seems to work well, but i'm not sure i want to set that automatically yet (i expect it will change again in LuaLS, since it's not just us affected)

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

3 participants