<div dir="ltr"><div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">Hi,</span></div><br>So, my last status update was on mail subject: GSoC25: BASIC IDE Phase 1/Part 1 -<br>SymbolInfo + Cache Interface (Regarding new files for cache), May 14, 2025.  <br><a href="https://gerrit.libreoffice.org/c/core/+/185362">https://gerrit.libreoffice.org/c/core/+/185362</a><br><br>That was a rushed step, and after the first meeting, I had an "aha" moment.<br>I realised I should not have jumped directly into writing code and defining<br>structures and enums. Instead, I should have begun by figuring out what data<br>is available, where it resides, and how to access it.<br><br><u><b><i>Core Mentor Directive from Meeting 1:</i></b></u><br>Figure out how to get the data first. Create a table that maps "what is there"<br>to "where it's from".<br><br>They want a comprehensive inventory of all the elements needed for auto-<br>completion (Library names, Module names, Procedure names, parameters, variable<br>types, UDTs, UNO objects, methods, properties, etc.), where this information<br>currently resides in the LibreOffice codebase or related resources, and how it<br>can be programmatically accessed.<br><br><b><i>Mentor-Suggest<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span>i<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span><span class="gmail_default" style=""><font face="arial, sans-serif">ons</font></span> for Exploration:</i></b><br><br><b>Reflection Mechanism (Dynamic/Runtime):</b><br>This refers to querying live UNO objects to see what they can do and getting<br>information by inspecting live objects. For UNO, this means inspecting<br>SbUnoObject. For BASIC, it might mean querying a loaded StarBASIC or SbModule<br>instance for its members after it's compiled/loaded.<br><br><b>Offline Availability (Static Cache):<br></b>This means pre-processing information so it's ready when the IDE starts.<br>Creating a pre-compiled database of information that ships with LibreOffice.<br>This is particularly relevant for the vast UNO API, which is relatively stable<br>between releases.<br><br><b>Source for UNO:</b><br>They suggested looking at SDK documentation, Doxygen, and hinted at the tools<br>used to build the UNO system (javamaker, cppumaker), which all point back to the<br>IDL files as the canonical source.<br><br><b>Source for BASIC:</b><br>This means analyzing the BASIC libraries themselves.<br><br><b><i>"How to get the data first?" - Potential Sources Mentioned:</i></b><br><br><b>a. UNO SDK documentation to generate cache? IDL files? Doxygen output?</b><br><br><b><u>IDL Files (.idl):</u></b><br>These are the canonical definitions of UNO interfaces, services, and types.<br>They are the ultimate source of truth for the UNO API structure. Tools like<br>idlc (IDL compiler) and cppumaker process these.</div><div><br></div><div><a href="https://wiki.documentfoundation.org/Documentation/DevGuide/IDL_Documentation_Guidelines">https://wiki.documentfoundation.org/Documentation/DevGuide/IDL_Documentation_Guidelines</a></div><div><a href="https://docs.libreoffice.org/offapi.html">https://docs.libreoffice.org/offapi.html</a><br><br><b><u>Doxygen:</u></b><br>If LibreOffice generates Doxygen API documentation from its C++ source (which<br>it does for internal C++ APIs, and IDLs are a form of API definition), this<br>could be parsed. However, parsing human-readable docs is often less reliable<br>than parsing IDL<font face="arial, sans-serif">s<span class="gmail_default" style=""></span><span class="gmail_default" style="">?</span></font></div><div><span class="gmail_default" style=""><font face="arial, sans-serif"><br></font></span></div><div><a href="https://wiki.documentfoundation.org/Development/Doxygen">https://wiki.documentfoundation.org/Development/Doxygen</a></div><div><a href="https://api.libreoffice.org/docs/idl/ref/index.html">https://api.libreoffice.org/docs/idl/ref/index.html</a></div><div><a href="https://api.libreoffice.org/docs/cpp/ref/index.html">https://api.libreoffice.org/docs/cpp/ref/index.html</a></div><div><a href="https://api.libreoffice.org/">https://api.libreoffice.org/</a><br><br><b><u>regview tool output / RDB files (.rdb):</u></b><br>UNO components register their type information in RDB files (e.g.,<br>services.rdb, types.rdb). The regview tool can inspect these. This is a<br>structured, machine-readable format of the registered UNO type system. This is<br>a very strong candidate for building a static cache of UNO APIs.</div><div><br></div><div><a href="https://wiki.documentfoundation.org/Documentation/SDKGuide/Coding_UNO_Components">https://wiki.documentfoundation.org/Documentation/SDKGuide/Coding_UNO_Components</a></div><div><a href="https://www.openoffice.org/udk/common/man/tutorial/uno_registries.html">https://www.openoffice.org/udk/common/man/tutorial/uno_registries.html</a><br><br><b>b. "files? like python stub, javamaker, cppumaker?"</b><br><br>Intermediate files generated by tools like cppumaker (which generates C++<br>headers from IDLs) or javamaker. Python stubs (.pyi) are a direct analogy for<br>providing type information for tooling.</div><div><br></div><div><a href="https://wiki.documentfoundation.org/Documentation/DevGuide/Writing_UNO_Components">https://wiki.documentfoundation.org/Documentation/DevGuide/Writing_UNO_Components</a></div><div><a href="https://www.openoffice.org/framework/index.html">https://www.openoffice.org/framework/index.html</a></div><div><a href="https://wiki.openoffice.org/wiki/VBA_Stub">https://wiki.openoffice.org/wiki/VBA_Stub</a></div><div><a rel="noopener" class="gmail-cursor-pointer">https://www.openoffice.org/api/docs/common/ref/com/sun/star/ucb/</a><br>
XCachedDynamicResultSetStubFactory.html</div><div><a href="https://www.openoffice.org/tools/ext_comp.html">https://www.openoffice.org/tools/ext_comp.html</a><br><br><b>c. "UNO related stuff in currently opened file from Tools > Development Tools?"</b><br><br>This refers to the UNO Object Inspector (reachable via Tools -> Development<br>Tools, then inspect an object). This tool dynamically introspects a live UNO<br>object using XIntrospectionAccess to show its methods, properties, and<br>interfaces. This is an example of runtime reflection. We can learn from how it<br>works. It shows what's possible to get dynamically.</div><div><br></div><div><a href="https://www.openoffice.org/udk/cpp/man/tutorial/unointro.html">https://www.openoffice.org/udk/cpp/man/tutorial/unointro.html</a></div><div><br></div><div><a href="https://tomazvajngerl.blogspot.com/2021/03/built-in-xray-like-uno-object-">https://tomazvajngerl.blogspot.com/2021/03/built-in-xray-like-uno-object-</a>  <br>inspector_24.html#:~:text=The%20object%20inspector%20shows%20various%20  <br>information%20about,is%20always%20shown%20for%20the%20current%20object.<br></div><div><br></div><div><b>d. "ScriptForge"</b><br><br>ScriptForge is a set of BASIC libraries providing easier access to common UNO<br>tasks. Its API is relatively stable and well-defined. The .xlb files? define<br>the structure of BASIC libraries, including module names. The source code is in<br>wizards/source/scriptforge/.</div><div><br></div><div><a href="https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/lib_ScriptForge.html">https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/lib_ScriptForge.html</a></div><div><a href="https://forum.openoffice.org/en/forum/viewtopic.php?t=104896">https://forum.openoffice.org/en/forum/viewtopic.php?t=104896</a></div><div><a href="https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_intro.html">https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_intro.html</a></div><div><a href="https://wiki.documentfoundation.org/Macros/ScriptForge">https://wiki.documentfoundation.org/Macros/ScriptForge</a><br><br><b>e. "Object Catalog in LO"</b><br><br>The current Object Catalog in the BASIC IDE (basctl/ObjectCatalog.cxx) is very<br>limited. It probably doesn't have the rich data we need. However, the concept<br>of an object catalog is what we're building, but a much more powerful one.</div><div><br></div><div><a href="https://help.libreoffice.org/latest/en-ZA/text/sbasic/shared/uno_objects.html">https://help.libreoffice.org/latest/en-ZA/text/sbasic/shared/uno_objects.html</a>?<br>DbPAR=DRAW&System=UNIX<br></div><div><a href="https://help.libreoffice.org/25.2/ro/search?P=object+catalog">https://help.libreoffice.org/25.2/ro/search?P=object+catalog</a></div><div><a href="https://wiki.documentfoundation.org/Documentation/DevGuide/LibreOffice_Basic">https://wiki.documentfoundation.org/Documentation/DevGuide/LibreOffice_Basic</a></div><div><a href="https://www.openoffice.org/udk/common/man/uno.html">https://www.openoffice.org/udk/common/man/uno.html</a></div><div><br><br><b><i>Mentor-Mentioned Tools/Sources to Investigate:</i></b><br><br><b>"Tools > Development Tools":</b><br>This is a live example of runtime reflection in action. It shows what's<br>possible when we have an instance of a UNO object.<br><br><b>"ScriptForge" libraries:</b><br>These are standard BASIC libraries shipped with LO. They must be treated as a<br>source of BASIC symbols.<br><br><b>"Object Catalog":</b><br>The existing, limited sidebar. It confirms the IDE can query BasicManager for<br>user macros, but it's not a source for comprehensive data.<br><br><b><i>Key Questions Raised by Mentors:</i></b><br><b>Cache Strategy:</b> Online (live reflection/parsing) vs. Offline (pre-computed)?<br><b>Scalability: </b>How to handle the vast UNO API and potentially large user<br>libraries?<br><b>Parser: </b>New parser vs. adapting the existing SbiParser?<br><br><b><i>Our Conclusion from Meeting One Analysis:</i></b><br>The best path forward is to create the <i>"Master Information Table" </i>and use it to<br>guide a series of Proof-of-Concept (PoC) experiments. This directly addresses<br>the mentors' primary request.<br><br>Which I have attached in this mail. Here I have added an additional new entry<br>based on our next meeting.<br><br><br><div class="gmail_default" style=""><font face="arial, sans-serif">-------------------------------------------------------------------------------</font><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span></div><br><i><b>Hossein's Email: ScriptForge Python Stubs</b><br></i>Key File: wizards/source/scriptforge/python/scriptforge.pyi  <br><a href="https://gerrit.libreoffice.org/c/core/+/164867">https://gerrit.libreoffice.org/c/core/+/164867</a><br><br><b>Purpose:</b><br>This is a Python "stub file." It provides type hints and function signatures<br>for the ScriptForge Python library. Python IDEs use these .pyi files to offer<br>auto-completion and type checking for Python developers using ScriptForge.<br><br><b>Relevance to Us:</b><br>This is a concrete example of externalizing API information for<br>tooling. We <span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span>n<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span>eed to do something similar for BASIC, but our "Knowledge Base"<br>will be more dynamic and integrated.<br><br><b>Process Inspiration:</b><br>How is scriptforge.pyi generated or maintained? Understanding this might give<br>clues for how to process other static information sources. Which I am looking<br>for in more detail.<br><br><a href="https://help.libreoffice.org/latest/en-US/text/sbasic/python/python_programming.html">https://help.libreoffice.org/latest/en-US/text/sbasic/python/python_programming.html</a></div><div><a href="https://mypy.readthedocs.io/en/stable/stubs.html">https://mypy.readthedocs.io/en/stable/stubs.html</a></div><div><a href="https://github.com/Amourspirit/python-types-scriptforge">https://github.com/Amourspirit/python-types-scriptforge</a></div><div><a href="https://typing.python.org/en/latest/guides/writing_stubs.html">https://typing.python.org/en/latest/guides/writing_stubs.html</a></div><div><a href="https://help.libreoffice.org/latest/nn/text/sbasic/shared/code-stubs.html">https://help.libreoffice.org/latest/nn/text/sbasic/shared/code-stubs.html</a></div><div><br></div><div><br><font face="arial, sans-serif">-------------------------------------------------------------------------------</font><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span></div><div><div class="gmail_default" style=""><font face="arial, sans-serif"></font></div><br><b><u><i>Core Mentor Directive from Meeting 2:</i></u></b><br>Compare the different ways of getting information, focusing on speed and what<br>data is actually available. They want to see a dump file as concrete evidence<br>from these experiments.<br><br><b>Comparison of Data Acquisition Methods:</b><br><b><br>Method 1: Doxygen/IDL-like approach:</b><br>This confirms their interest in the static/offline method of parsing IDL files.<br>They want to know what info we can get this way.<br><br><b>Method 2: Using Functions or Services:</b><br>This refers to the runtime reflection approach. They want to know its speed and<br>what data it yields.<br><br><b>Key Question:</b><br>What are the pros/cons (speed, completeness) of each?<br><br><b>Concrete Output: The "Dump File"</b><br>This is the most critical, actionable item. They want to prove that we can get<br>the data. This "dump file" is the output of our PoCs. It's the evidence.<br><br><b>Specific Example to Investigate: <u>MsgBox</u></b><br>This is a perfect test case. It's a built-in BASIC function.<br><br><b>The Task:</b><br>Find where MsgBox is defined in the C++ source  <br>(basic/source/runtime/stdobj.cxx, basic/source/runtime/methods.cxx  <br>void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)).  <br>Analyze its C++ implementation to see how its parameters are defined. Then,<br>compare this to how it's documented in the Help files and how <b>MS VBA </b>presents<br>it. The goal is to show we can extract its full signature:  <br>MsgBox(Prompt As String, [Buttons As Integer = 0], [Title As String]) As<br>Integer.<br><br><b>Refining the Table:</b><br>They suggested adding a new column. Considering the emphasis on MsgBox and<br>comparing it with MS VBA Help, a column like Help/VBA Analogy or Doc & Expected<br>Output might be what they meant. This column would contain the "user-friendly"<br>signature string, like the MsgBox example.<br><br><b>How to get the dump files:</b><br>This is what I have looked for and the possible (conceptual) ways to<br>get/generate the dump files. But before this, the main emphasis was on using<br>the debugger and understanding where what is available and going.<br><br><b><i><span class="gmail_default" style="font-family:"comic sans ms",sans-serif">1. </span>UNO API Dumps (Offline/Static):</i></b><br><br><u>Dump 1 (IDL):</u><br>Write a Python script<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span><span class="gmail_default" style=""><font face="arial, sans-serif">?</font></span> to parse a few .idl files and print their structure<br>(interfaces, methods, params, docs) to uno_idl_dump.txt.<br><br><u>Dump 2 (regview):</u><br>Run regview? on types.rdb and save the output to uno_regview_dump.txt.<br>Compare this to Dump 1.<br><br><u>Dump 3 (Runtime):</u><br>Use the C++/debugger technique to introspect a live object like StarDesktop and<br>copy-paste the output of its members to uno_runtime_dump.txt.<br><br><b><i><span class="gmail_default" style="font-family:"comic sans ms",sans-serif">2. </span>BASIC Built-in Dumps (Offline/Static):</i></b><br><br><u>Dump 4 (Built-ins):</u><br>Write a script/code/test? to iterate the SbRtl object's methods and print their<br>names to basic_builtins_dump.txt. Manually add the extra columns for MsgBox and<br>a few others by reading their C++ implementation, just like filling in our<br>Excel sheet.<br><br><b><i><span class="gmail_default" style="font-family:"comic sans ms",sans-serif">3. </span>User Code Dumps (Dynamic/IDE-Time):</i></b><br><br><u>Dump 5 (Parser Symbols):</u><br>Modify the SbiParser in a test branch to, instead of compiling, just dump the<br>contents of its symbol pool (SbiSymPool) after it parses a test .bas file.<br>Save this to user_code_symbols_dump.txt.<br><br><br><br>Now regarding the file <b>BASIC_IDE_MODULE_FLOW.odt</b>:<br>While working for the Master Analyzer Table sheet, I felt that it would be<br>great if we had a module-wise separation of files. That would be good to<br>segregate and identify the sources and their regions of possible availability.</div><div><br></div><div><div class="gmail_default" style=""><font face="arial, sans-serif">----------------------------------------------------------------------------------</font><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">-------</span><span style="font-family:arial,sans-serif">------</span><span style="font-family:arial,sans-serif">-------</span></div><br><p>So<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span> for this week my task is to run some BASIC scripts and investigate where  <br>what is going, and I will also re-validate my BASIC_IDE_MODULE_FLOW.odt  <br>if something is off with it. Go in full debugging mode and get the dump  <br>files to prove what we can get and simultaneously look in MSO VBA what  <br>they have and are doing.<br></p></div><div>Maybe later, the file BASIC_IDE_MODULE_FLOW.odt could lay down the  <br>foundation for documenting LibreOffice BASIC source code<span class="gmail_default" style="font-family:"comic sans ms",sans-serif"></span>?<br></div><div><br></div><div><a href="https://ask.libreoffice.org/t/where-can-i-find-documentation-for-">https://ask.libreoffice.org/t/where-can-i-find-documentation-for-</a>  <br>libreoffice-basic/95965<br></div><div><a href="https://learn.microsoft.com/en-us/office/vba/library-reference/concepts/">https://learn.microsoft.com/en-us/office/vba/library-reference/concepts/</a>  <br>getting-started-with-vba-in-office<br><a href="https://learn.microsoft.com/en-us/office/vba/api/overview/">https://learn.microsoft.com/en-us/office/vba/api/overview/</a></div><div><br></div><div>I would love to have feedback on this, and if there's anything similar or  <br><div class="gmail_default" style="">important I should be looking into, please let me know.<font face="arial, sans-serif"> </font></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-family:monospace"><b>Regards,</b></span></div><div><span style="font-family:monospace;color:rgb(153,0,255)"><b>Devansh</b></span><br></div></div></div></div>