Extend Excel-DNA’s IntelliSense with MacroOptions.
This repository shows a possible implementation to address Excel-DNA’s IntelliSense feature request to also use the .IntelliSense.xml file to add .MacroOptions (issue #119).
If you (@govert) like the code feel free to move it over to your repository or let me know if I should file a pull request.
- .vscode/cspell.json
-
Spell checker file for the Code Spell Checker extension for VS Code.
- .vscode/ExcelDNA_IntelliSense.code-snippets
-
(User defined) code snippet file for VS Code to make it really easy to functions and their arguments to the XML file.
- .vscode/settings.json
-
Useful settings for VS Code and the XML extension.
- src/IntelliSense.xsd
-
XSD file to easier check if the XML file is valid (to use content for
MacroOptions). - src/modIntelliSense_XML.bas
-
Module to extract the data from the XML file and to register the corresponding functions (using
MacroOptions). - src/modProcessASOpen.bas
-
Module to check if there is an active sheet. (Only then no runtime error is thrown when
MacroOptionsis used.) (This is based on a file from Jan Karel Pieterse’s awesome code to Fix Links To UDFs in AddIns.) - src/modProcessAfterASOpen.bas
-
Module to run individual code after there is an active sheet.
- tests/modIntelliSense_XML_Test.bas
-
Rubberduck’s (unit) test module to check if the
modIntelliSense_XML.basis doing what it should do. - tests/modMyTestFunctions.bas
-
Module with test functions (maybe it sounds familiar).
- tests/MyTest.IntelliSense.xml
-
You should know that (too).
- tests/MyTest.xlam
-
An example AddIn containing all relevant modules and the (unit) tests.
- tests/XMLs folder
-
Contains the XML file for the unit tests.
-
Because I don’t really have a clue how to test if functions are extracted correctly, most of the unit tests “just” cover error handling. Maybe one needs a fake/mock/stub. Do you have an idea?
-
In the
IntelliSense.xsdI couldn’t make theIntegerOrStringsimple type work for theCategoryargument (see theBUG:line in the code). Do you have an idea to make it work or is this impossible foruniontypes (or maybe a bug in VS Code’s XML extension)? (Before creating this file I didn’t had any clue about XSD files …) -
In the
IntelliSense.xsdI used the names of theMacroOptionsarguments. Thus, I usedHelpFileinstead ofHelpTopicwhich you used in your example. → Rename one of them if the intension is the same.
- What are the
'@...comments good for in the code? -
You should really have a look at the awesome Rubberduck project!