vscode-wow-api icon indicating copy to clipboard operation
vscode-wow-api copied to clipboard

Update removes Annotations/Lua from Lua.workspace.library setting

Open emmericp opened this issue 1 year ago • 4 comments

my user settings.json prior to updating the vscode extension:

	"Lua.workspace.library": [
(...)
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Data",
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Interface",
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Libraries",
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Type",
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Widget",
		"~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations\\Lua"
	],
	"wowAPI.luals.configurationScope": "User",
	"wowAPI.luals.setLuaRuntime": false,

after updating to 18.2:

	"Lua.workspace.library": [
(..)
		"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations\\Data",
		"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations\\Interface",
		"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations\\Libraries",
		"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations\\Type",
		"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations\\Widget"
	],
	"wowAPI.luals.configurationScope": "User",
	"wowAPI.luals.setLuaRuntime": false,

Which made it complain about missing all those WoW-specific Lua functions

emmericp avatar Jan 04 '25 12:01 emmericp

Isn't this related to https://github.com/Ketho/vscode-wow-api/issues/159#issuecomment-2282203652 where you wanted the extension to not replace the Lua runtime? I remember you didn't really mind the warnings about them.

Or do you mean that the Wow-specific Lua functions like wipe and strjoin should always be loaded regardless of that option? Maybe that would be a better solution and stop the warnings.

There wasn't anything that changed between 0.17.6 and 0.18.2 with regards to the LuaLS library path iirc. Although I'm not sure why on 0.17.6 the Annotations/Lua folder still was included when wowAPI.luals.setLuaRuntime is set to false.

Ketho avatar Jan 05 '25 02:01 Ketho

There wasn't anything that changed between 0.17.6 and 0.18.

I haven't updated in quite some time, and I've probably hand-maintained the include paths. I do want to have the extra WoW Lua functions defined, but I also want non-WoW things like "io" and "os" defined; without the setLuaRuntime option this just gets force-disabled.

Anyhow, overall the situation is a mess because of us mixing non-WoW and WoW code in a repo, and it's obviously not ideal and unless LuaLS adds proper supports for environments (unlikely) it's likely not fully fixable :/

emmericp avatar Jan 06 '25 09:01 emmericp

I'm thinking of removing the wowAPI.luals.setLuaRuntime option again since it's rather confusing for everyone, including me.

I thought of maybe adding some hidden option where the extension just doesn't touch "Lua.runtime.builtin" and "Lua.workspace.library" ~and moving the wow-specific Lua API like wipe and strjoin to a different folder~. This way you would get full control over which Lua API you want. But the drawback is you'd have to keep the paths with version numbers updated yourself.

Ketho avatar Apr 01 '25 06:04 Ketho

I added a "Dev Mode" hidden option if you don't mind manually updating your User/Workspace settings.json

https://github.com/Ketho/vscode-wow-api/wiki/Settings#dev-mode

Ketho avatar Apr 02 '25 04:04 Ketho