Resolving LibreOffice python imports in VS Code (com.sun.star...)

Thank you!
YES…I lost some hairs to get the stuff straight forward in the flatpak-case :sweat_smile:

2 Likes

Its not »substituted« its the very same as the global »XSCRIPTCONTEXT« which is initialized inside a Libreoffice-process.
(read the source $(instdir)/program/pythonscript.py )

Nice finding, but I’m not sure where it would be best served from. The flatpak’s /app/libreoffice/readmes/README_en-US (and its translations) is just the same as the vanilla LO version, and presumably obscure to find, and IMO at a wrong level for “programmability” findings like this anyway.

Maybe in the wiki-page, wich also lists other “setup”-information for IDE, and covers XSCRIPTCONTEXT

https://wiki.documentfoundation.org/Macros/Python_Basics#What’s_in_a_Macro