VS Code IntelliSense for the PYTHA 3D-CAD Lua plugin API.
Features
Autocomplete and inline documentation for the full pytha, pyui, pyio, pyux, pygeo, pyplot namespaces and the pyloc function — every entry links straight to the PYTHA Lua API Wiki.
Open wiki from the editor: place the cursor on any pytha.* / pyui.* / pyloc symbol and run PYTHA: Open wiki for symbol under cursor (Ctrl+F1) or right-click → "PYTHA: Open wiki…". The command palette also exposes PYTHA: Open API Wiki as a shortcut to the wiki home.
pyloc linting: warns when pyloc() is called with a non-literal argument — the translation extractor cannot resolve variables, so a non-literal call silently produces an untranslatable string.
config.xml schema: ships an XSD validated against the wiki documentation. Combined with the Red Hat XML extension you get autocomplete and validation for plugin config files.
Code snippets: scaffolds for dialogs, group boxes, primitive creation, identify calls and persistent storage (prefixes start with pytha-).
Type checking via sumneko.lua (declared as a hard dependency). Element handles, control handles, materials etc. are modelled as distinct ---@class types so wrong handles get flagged.
Workspace setup on first activation:
Lua.runtime.version is set to Lua 5.3 (PYTHA's Lua version)
Lua.runtime.builtin.io is disabled (PYTHA does not expose io)
the bundled API stub folder is added to Lua.workspace.library
PYTHA globals (pytha, pyui, ...) are added to Lua.diagnostics.globals
Idempotent activation — settings are only written when they actually differ, so the extension does not churn settings.json on every reload.
Requirements
The extension activates automatically when a .lua file is opened. No additional setup is required beyond installing this extension; sumneko.lua will be pulled in automatically.
Known Issues
API stubs are generated by hand from the wiki and may lag behind the very latest PYTHA release.
Some functions whose wiki documentation is ambiguous use any for parameters — those are marked with a TODO comment in libs/pytha.lua.
Contributing
Stubs live in libs/pytha.lua and follow the LuaLS ---@meta convention. To add or fix a function: