lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

non-`file:` URIs in library/userThirdParty settings don't work

Open justarandomgeek opened this issue 11 months ago • 1 comments

my extension generates a LuaLS userThirdParty bundle dynamically from Factorio's doc files (from the local game install, generally). I'm working on trying to switch to using a virtual FS provider for these files instead of cluttering up real workspace-associated folders with them. I've registered as the provider for fmtk: uris, and i can open all the files for the generated bundle in vscode in editor tabs, but LuaLS won't load them as libraries.

I set

"Lua.workspace.userThirdParty": [
        "fmtk:/luals"
    ],

in my settings.json, instead of setting the generated folder path as i had done previously, but LuaLS seems to have completely ignored it.

I also tried

    "Lua.workspace.library": [
        "fmtk:/luals/factorio/library"
    ],

but that also seems to ignore anything that isn't a plain file path.

justarandomgeek avatar Feb 08 '25 22:02 justarandomgeek

https://github.com/LuaLS/lua-language-server/blob/master/script/fs-utility.lua https://github.com/LuaLS/lua-language-server/blob/master/script/filewatch.lua https://github.com/LuaLS/lua-language-server/blob/master/script/utility.lua

With some cursory searching, these seem to be the main problematic files. I'm sure other files are, at their core, problematic in regards to dealing with URI's, but a foundational change like this will have knock-on effects everywhere.

As a side note, why are there two places with near identical loadFile functions? the one in fs-utility has an input path check, while the utility has a nil-check for the contents...

PennyJim avatar Feb 08 '25 22:02 PennyJim