Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>PYTHA Lua SupportNew to Visual Studio Code? Get it now.
PYTHA Lua Support

PYTHA Lua Support

pytha-3d-cad

|
4 installs
| (1) | Free
IntelliSense, type hints and inline documentation for the PYTHA 3D-CAD Lua plugin API.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PYTHA Lua Support

Marketplace Version Installs Rating License

VS Code IntelliSense for the PYTHA 3D-CAD Lua plugin API.

Autocomplete demo

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:

  1. Find the matching .md file in the API wiki.
  2. Add or update the function in libs/pytha.lua using the existing format (short bold description, wiki link, @param/@return annotations).
  3. Use ---@overload for alternative signatures rather than duplicate function declarations.

Release Notes

See CHANGELOG.md.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft