Replies: 1 comment
-
I'd try to achieve this by using per-workspace-specific configuration settings. Looks like you are using VS Code. So, in that case, you can set it up like this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I'm writing scripts for OpenComputers, where each computer runs its own Lua machine running on its own virtual file system separated from file systems of other computers.
Currently my workspace in VS Code, if simplified, is organized like this:
lib
contains scripts that are placed into every opencomputer (and everything in it should berequire
able). \c1 contains files that are uploaded only on one computer named C1. \c2 contains files that go to another opencomputer C2.In other words, VM of opencomputer C1 has all files that locally are stored in \c1 and \lib, VM of C2 sees all files that are stored in \c2 and \lib. C1 has no access to files in \c2 and C2 has no access to files of C1.
I want to setup runtime.path such way that when \c1\app1.lua does
require "config.lua"
language server would resolve it into "\c1\config.lua". When \c2\app2.lua doesrequire "config.lua"
language server must resolve it into "\c2\config.lua"When runtime.pathStrict disabled, language server thinks that

require "config.lua"
is too ambiguousand refuses to auto-complete anything from it.
If runtime.pathStrict is enabled, it seems LS searches for "config.lua" inside root directory only.
I tried to add
${relativeFileDirname}/?.lua
which, when editingc1/app.lua
, would be evaluated as "c1/?.lua", but it seems LS doesn't support it. I even tried./?.lua
, but it seems that is still relative to ${workspaceFolder} anyway, not to the file I'm editing.I can edit runtime.path manually each time to include only subdirectories I'm editing right now, but it's tedious. I also probably can open workspace inside c1 directory and link lib/ in Lua.workspace.library, but I switch between c1,c2 and lib a lot.
Beta Was this translation helpful? Give feedback.
All reactions