Yeah, like Baertram mentioned you need your own autocomplete files in addition to the ESO-Api ones.
You can add multiple ones. That's what one of my workspace configs looks like:
JSON Code:
"Lua.workspace.library": [
"S:/ESOAPI/IntelliJ_ESOUI_AutoCompletion/Releases/API100035",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/FurnitureShoppingList/FurnitureShoppingList.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibAddonMenu-2.0/LibAddonMenu-2.0.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCustomMenu/LibCustomMenu.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibAsync/LibAsync.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCharacterKnowledge/Public.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/LibCharacterKnowledge/Internal.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/sidTools/StartUp.lua",
"S:/ESOAPI/eso-api_base_manual.lua",
"Z:/Dokumente/Elder Scrolls Online/live/AddOns/FurnitureCatalogue/.scripts/luaDoc_Definitions.lua"
],
Most of the GUI elements are just Control. As long as you have a definition for Control somewhere, you can type hint global elements as Control in the autocomplete file and custom variables directly, if you want. Something like:
Lua Code:
-- In autocomplete file
---@class Control
GuiRoot = nil
-- or like this
GuiRoot = Control
-- type hinting of a local variable
---@class Control
local someControl = WINDOW_MANAGER:CreateControlFromVirtual(...)
someControl:SetHidden(true)
And this is what I have as Definition of control and GuiRoot in some file:
Lua Code:
---@class Control
---@field GetNamedChild fun(self: Control, childName: string): Control
---@field SetAnchor void
---@field SetHidden fun(self: Control, aHidden: boolean): void
---@field SetMouseEnabled void
---@field icon
---@field mats
---@field text Control
---@field comboBox ZO_ComboBox_Base
---@field SetText fun(self: Control, text: string): Control
---@field SetNormalTexture fun(self: Control, texture: string): Control
---@field SetMouseOverTexture fun(self: Control, texture: string): Control
---@field SetPressedTexture fun(self: Control, texture: string): Control
Control = nil
GuiRoot = Control
With the autocomplete hints you can get rid of all false positive errors and concentrate on the real error messages.
Generation Script
If you don't want to do it manually and have Python you can try my project specific generator. Should work with most other ESO-GUI XML files.
https://github.com/manavortex/Furnit...generateGui.py
And that's the result:
https://github.com/manavortex/Furnit...ns.lua#L22-L99