-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Support for custom module resolution #2947
Comments
It is possible to change {
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"completion.requireSeparator": "/",
"runtime.path": [
"?",
"?.lua"
],
"runtime.special": {
"VFS.include": "require"
}
} Here is a similar question before (but in chinese): #2900 (comment) However this affects standard require "lib.A" --> this equals to requiring a file named "lib.A" or "lib.A.lua", instead of "lib/A.lua"
require "lib/A" --> you have to use `/` if you want to require "lib/A" |
Thanks you @tomlau10! That appears to be working. 🙏 |
We have a custom module loader that uses full file paths to resolve files.
To get proper type inference we need to add
@module
to every call.It's possible to alias VFS.Include to act like
require
:But this won't work because
VFS.Include
accepts a path, andrequire
accepts a module name. Is there any way to write a custom module resolver so that we can supportVFS.Include
project-wide?The text was updated successfully, but these errors were encountered: