Closed sparr closed 1 month ago
Thanks for the merge!
I can see this in the Addon Manager now, and can install/enable it, which puts "Lua.workspace.library": ["${addons}/devilspie2/module/library"]
in my workspace settings... but the library doesn't seem to actually get used with my code. I previously had that same setting set to "/home/sparr/src/LuaLS-Addon-devilspie2/library"
and then ""/home/sparr/src/LLS-Addons/addons/devilspie2/module/library"
as I was preparing for this PR, and those works, but maybe I've mis-formed the addon module definition here somehow?
Having installed the addon, the folder button in the addon manager takes me to /home/sparr/.config/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/devilspie2/
which does have a module/library
folder matching what was merged in this PR.
@sparr, are you on v3.11.0
? I have tested it, and it seems to work fine. If you are, can you provide your OS?
I am on EndeavourOS (~Arch Linux), running VSCodium 1.93.1 and sumneko.lua-3.11.0-linux-x64.
I have no user or workspace settings for the lua extension. Here are the settings from defaultSettings.json:
When I open the Lua Addon Manager, depending on where I am in troubleshooting (with reinstalling various things, resetting settings, etc) I see one of the following four states:
Enable
buttonDevilspie2
at the top of the list with Enable
and Uninstall
buttonsDevilspie2
at the top of the list with Disable
and Uninstall
buttonsFrom state 2 or state 3 if I click Enable
then my workspace settings are populated with this:
{
"Lua.workspace.library": [
"${addons}/devilspie2/module/library"
],
"Lua.workspace.checkThirdParty": false
}
Clicking Disable
has no effect on the workspace settings or the state of the addon manager interface (the addon stays apparently enabled) aside from momentarily greying out the Disable
and Uninstall
buttons.
Clicking Uninstall
greys out the buttons for a moment then removes the Uninstall
button, leaving just a Disable
button, and producing a popup saying there was an error in the addon manager and offering to file a bug report which copies the following log:
At that point the devilspie2/module
directory has been deleted but devilspie2/info.json
still exists. This leaves the addons/
git repository in the following state:
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: devilspie2/module
no changes added to commit (use "git add" and/or "git commit -a")
I can't reproduce it right now, but I suspect the git error mentioned earlier is somewhere downstream of this situation.
At no point during any of the process described above, including when the module was apparently successfully enabled in my workspace settings, did the language server stop showing an Undefined global
in my test lua file containing local window_name = get_window_name()
.
I just discovered/noticed that the addons/*/module directories are empty. The git submodules for the addons repo were never updated / checked out. If I do a git submodule update
to check them all out, and use the workspace settings shown above, it still doesn't work. However, I can change those settings as follows:
{
"Lua.workspace.library": [
"/home/sparr/.config/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/devilspie2/module/library"
],
"Lua.workspace.checkThirdParty": false
}
and it works, so at least I know that library/devispie2.lua is good.
aaaaaand I found the (a?) problem!
elseif platform.os == "linux" then
local serverPath = util.expandPath(fs.path("~/.vscode-server/data"):string())
if fs.exists(serverPath) then
-- addons are installed via SSH remote
return serverPath .."/" .. dataPath
else
return "~/.config/Code/" .. dataPath
end
The path is hardcoded for Code
which means it will fail for VSCodium
and Code-OSS
and any other renamed versions of the app. I'll try to figure out how to fix this and open a PR.
This addon is for writing scripts and config for https://github.com/dsalt/devilspie2