Skip to content

Code Explorer

Mathieu Guindon edited this page Nov 29, 2018 · 3 revisions

Code Explorer

This dockable window pretty much replaces the Project Explorer, by adding member-level drill-down and other functionalities - if you're loading the VBE with a large enough project in the host application, it will look like this:

"Rubberduck doesn't see anything yet"

If the VBE is initialized with an empty project, Rubberduck typically immediately proceeds to parse it, automatically. Otherwise, there are multiple ways to trigger a parse:

  • Clicking the refresh link-button in the middle of the empty Code Explorer toolwindow
  • Clicking the reparse refresh/reparse button in the toolbar of any Rubberduck toolwindow
  • Clicking the parser state button in the main Rubberduck command bar; note that the caption of this button indicates the current parser state
  • Selecting "Refresh" from the main Rubberduck menu

Pending State
When parser state is 'Pending', Rubberduck does not know anything about the code in the VBE. The entire parsing process is explained in details here, but the fundamental thing to keep in mind, is that Rubberduck's internal representation of the code is never in real-time: when you make changes to the code, Rubberduck will not "see" these changes until the parser state is refreshed.
The initial parse will take longer, because every module and referenced type library needs to be processed; because of an extensive caching strategy, subsequent refreshes will only process the modules that have been modified since the last parse. Therefore, you will get the best out of Rubberduck if you regularly refresh after making changes to a module: the fewer modules modified since the last parse, the faster the refresh. Parsing occurs in the background, so you can still freely navigate the code while Rubberduck is processing. When everything is completed and all went as planned, parser state will be 'Ready'. Avoid modifying any code while Rubberduck is parsing.

Once the project is parsed, the Code Explorer reveals the contents of the project:

Code Explorer as of v2.3.0

  1. The client area displays all projects in the VBE in a treeview structure that drills down to member level. Modules annotated with a '@Folder("Parent.Child") annotation will appear under the folder described by the folder annotation.

  2. The bottom panel describes the selected node. If a module or member has a VB_Description attribute, the description text is shown here.

  3. A search bar can be used to filter the contents of the client area and quickly locate any module or procedure.

  4. The toolbar includes various buttons, including:

    • A 'Refresh' command to parse/reparse the loaded project(s).
    • An 'Add' menu to add new components to the active project.
    • A 'Sort' menu to group components by type and/or show them in alphabetical order or in the order they appear in code.
    • A 'Toggle Signatures' button to show or hide member signatures (parameters & return types).
    • A 'Show Designer' button to bring up a UserForm designer (double-clicking always brings up the code).
    • A 'Copy' button that conveniently formats the entire contents into an HTML-friendly table that can be pasted into Microsoft Word or Excel.
    • A 'Font Size' selector that controls the size of all text blocks in that toolwindow.

When hosted in VB6, Rubberduck offers more component types.

Clone this wiki locally