justarandomgeek / vscode-factoriomod-debug

Factorio Mod Tool Kit
Other
97 stars 21 forks source link

Inconsistent behaviour #83

Closed Sharparam closed 1 year ago

Sharparam commented 1 year ago

There seems to be some inconsistent behaviour when "activating" the extension (selecting a Factorio version).

In the first mod I tried it in, it added the following to .vscode/settings.json:

    "Lua.workspace.library": [
      "~/factorio/data",
      "~/.config/Code/User/workspaceStorage/f23c1250e734b3c648d8349862d0d76e/justarandomgeek.factoriomod-debug/sumneko-3rd/factorio/library"
    ],
    "Lua.workspace.userThirdParty": [
      "~/.config/Code/User/workspaceStorage/f23c1250e734b3c648d8349862d0d76e/justarandomgeek.factoriomod-debug/sumneko-3rd"
    ],
    "Lua.diagnostics.globals": [
      "__DebugAdapter",
      "__Profiler"
    ],
    "Lua.runtime.builtin": {
      "io": "disable",
      "os": "disable",
      "math": "disable",
      "debug": "disable",
      "coroutine": "disable",
      "package": "disable"
    },
    "Lua.runtime.version": "Lua 5.2",
    "Lua.runtime.special": {
      "__object_name": "type"
    },
    "Lua.runtime.plugin": "~/.config/Code/User/workspaceStorage/f23c1250e734b3c648d8349862d0d76e/justarandomgeek.factoriomod-debug/sumneko-3rd/factorio/plugin.lua",

(I manually changed /home/sharparam to ~)

However, in the second mod I tried it in, it only added this:

    "Lua.workspace.library": [
      "/home/sharparam/factorio/data"
    ],
    "Lua.workspace.userThirdParty": [
      "/home/sharparam/.config/Code/User/workspaceStorage/19194ab926a005c1b8add80c8d001947/justarandomgeek.factoriomod-debug/sumneko-3rd"
    ],

(In addition to also adding entries for the Factorio versions)

What gives?

Sharparam commented 1 year ago

I think one issue is that the popup that asks you to configure the workspace doesn't always appear for some reason.

An option to trigger this manually via the command palette would help a lot.

justarandomgeek commented 1 year ago

https://github.com/justarandomgeek/vscode-factoriomod-debug/blob/current/doc/language-lua.md#configuration

I only set .library and .userThirdParty, LuaLS is responsible for the rest.