The root module (entry point) in a luabundled script doesn't have an explicit filename, as it's not ever itself require'd. By default luabundle gives the root module the placeholder name __root, and that's the name this Atom plugin sticks with.
When unbundling (fetching lua scripts) we do need to grab the root module and write it to a temporary file. Prior to this PR, we assumed Atom created the TTS mod, and thus we expect to find a module named __root.
However, VSCode does not use the default module name __root, so our assumption that one exists leads to the following error when opening a mod created with the aforementioned VSCode plugin:
luabundle has built-in support retrieving the utilised root module name when unbundling, so this PR takes advantage of this functionality rather than using the hard-coded module name __root.
The root module (entry point) in a luabundled script doesn't have an explicit filename, as it's not ever itself
require
'd. By default luabundle gives the root module the placeholder name__root
, and that's the name this Atom plugin sticks with.When unbundling (fetching lua scripts) we do need to grab the root module and write it to a temporary file. Prior to this PR, we assumed Atom created the TTS mod, and thus we expect to find a module named
__root
.However, VSCode does not use the default module name
__root
, so our assumption that one exists leads to the following error when opening a mod created with the aforementioned VSCode plugin:luabundle has built-in support retrieving the utilised root module name when unbundling, so this PR takes advantage of this functionality rather than using the hard-coded module name
__root
.