LuaLS / vscode-lua

Release lua-language-server for VSCode
https://github.com/LuaLS/lua-language-server
MIT License
182 stars 52 forks source link

Cannot install addons that aren't installed that are defined by a `${addon}` path in `.luarc.json` #159

Open Cynosphere opened 1 week ago

Cynosphere commented 1 week ago

Which OS are you using?

Windows

Expected Behaviour

An "Install" button on the addon

Actual Behaviour

A "Disable" button that when clicked errors

Reproduction steps

  1. Have no addons installed through the addon manager
  2. Open a folder that already has a .luarc.json with workspace.library pointing to a path with ${addons} placeholder (e.g. "${addons}/garrysmod/module/library")
  3. Try to install the addon through the addon manager to see that you only get a "Disable" button

Additional Notes

The only workaround is to open another folder/workspace and then enable the addon manually.

It would also be nice to have a settings option you can throw into .vscode/settings.json to prompt the user to install addons required by the folder/workspace if they don't already have it installed.

Log

Log
#### STARTUP ####
[2024-11-13 12:15:25] |   DEBUG   |       GENERAL      | Starting language server
[2024-11-13 12:15:25] |   DEBUG   |       GENERAL      | Language server has started
[2024-11-13 12:15:25] |   DEBUG   |       WebVue       | Workspace Open: true
[2024-11-13 12:15:25] |   DEBUG   |     Filesystem     | Created directory at "/C:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager"
[2024-11-13 12:15:25] |  VERBOSE  |       Command      | Executing "getAddons" ({"command":"getAddons","data":{"page":1}})
[2024-11-13 12:15:26] |   ERROR   |    Addon Manager   | Failed to fetch addons! Please check your connection to GitHub.
[2024-11-13 12:15:26] |   ERROR   |    Addon Manager   | Cannot rebase onto multiple branches.
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found ao
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found argparse
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found bee
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found busted
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found cc-tweaked
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found cocos4.0
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found devilspie2
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found dkjson
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found dontstarve
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found fenster
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found fivem
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found garrysmod
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found halion
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lapis
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lldebugger
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lmathx
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found love-nuklear
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found love2d
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lovr
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lpeg
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lua-cjson
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luaecs
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luafilesystem
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luaharfbuzz
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lualogging
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luasocket
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luassert
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luaunit
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luazip
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found luvit
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found lzlib
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found md5
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found minetest
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found mirai
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found moneymoney
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found moonloader
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found nodemcu-esp32
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found nodemcu-esp8266
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found openresty
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found penlight
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found powder-toy
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found RavenscriptIDEA
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found RavenscriptIDEA_withRavenM
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found REFramework-LLS
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found skynet
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found slnunicode
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found smbx2-lunalua
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found starfallex
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found StormworksAddonLua
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found tex-lualatex
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found tex-lualibs
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found tex-luametatex
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found tex-luatex
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found toml-edit
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found transformice
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found trilogyloader
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found TTSLua
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found umbrella
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found unbound-api
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found xmake
[2024-11-13 12:15:26] |  VERBOSE  |    Addon Manager   | Found yue
[2024-11-13 12:15:26] |    WARN   |         Git        | Failed to pull LLS-Addons!
[2024-11-13 12:15:26] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
[2024-11-13 12:15:27] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
[2024-11-13 12:15:32] |   DEBUG   |       WebVue       | Workspace Open: true
[2024-11-13 12:15:32] |   DEBUG   |     Filesystem     | Created directory at "/C:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager"
[2024-11-13 12:15:32] |  VERBOSE  |       Command      | Executing "getAddons" ({"command":"getAddons","data":{"page":1}})
[2024-11-13 12:15:32] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
[2024-11-13 12:15:32] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
[2024-11-13 12:16:33] |  VERBOSE  |       Command      | Executing "disable" ({"command":"disable","data":{"name":"garrysmod"}})
[2024-11-13 12:16:33] |    WARN   |        Addon       | "garrysmod" is already disabled
[2024-11-13 12:16:33] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
[2024-11-13 12:16:33] |   ERROR   |     Filesystem     | Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/c/AppData/Roaming/VSCodium/User/globalStorage/sumneko.lua/addonManager/addons/garrysmod/module'
carsakiller commented 1 week ago

Currently, as mentioned, the addon manager does not check for the existence of an addon's files locally, it just checks your config file to determine what is “installed”. Ideally, when opening a workspace, it would check the paths and install any missing ones.