Updates the require resolution logic when the clusterio option is enabled.
1) The clusterio loader now creates the file modules/plugin_name.lua if the plugin contains a module_exports.lua file in it's source. Therefore any require paths of the form ^modules/plugin_name$ should resolve to plugin_name/module/module_exports.lua. Change: This new logic was added.
2) There is the assumption that the workspace of vscode is external_plugins when working on plugins, similar to how mod development assumes the workspace is mods. The previous logic discarded the plugin name which could cause multiple files to be resolved for a single path. e.g. modules/plugin_a/foo would resolve to both plugin_a/module/foo.lua and plugin_b/module/foo.lua which was particularly noticeable for module exports. Change: the plugin name is no longer discarded.
Updates the require resolution logic when the clusterio option is enabled. 1) The clusterio loader now creates the file
modules/plugin_name.lua
if the plugin contains amodule_exports.lua
file in it's source. Therefore any require paths of the form^modules/plugin_name$
should resolve toplugin_name/module/module_exports.lua
. Change: This new logic was added. 2) There is the assumption that the workspace of vscode isexternal_plugins
when working on plugins, similar to how mod development assumes the workspace ismods
. The previous logic discarded the plugin name which could cause multiple files to be resolved for a single path. e.g.modules/plugin_a/foo
would resolve to bothplugin_a/module/foo.lua
andplugin_b/module/foo.lua
which was particularly noticeable for module exports. Change: the plugin name is no longer discarded.