Making the Code Navigator your Project Explorer
Updated: 1 day ago
This is the last of three posts about VBE_Extras' Code Navigator. The first, Introducing the Code Navigator, covers what the Code Navigator shows and how to get around with it; the second, Keeping the Code Navigator in step with your code, covers how the Code Navigator stays up to date.
The Code Navigator shows everything the Project Explorer shows, and a whole lot more ... so why keep both? This post shows how to make the Code Navigator do the Project Explorer's job, so that one window does both, and how to make the Code Navigator "tree" of declarations look the way you want.
Replicate the Project Explorer
Check Replicate the Project Explorer in the Code Navigator's "Options" (the button with the "gear" icon in the Code Navigator's toolbar) and the Code Navigator does what the Project Explorer does:
The Project Explorer's commands (Properties, Insert, Import File, Export File, Remove and Print) appear at the top of the right-click menu for each Project and Module in the tree, followed by a 'VBE_Extras' submenu with all of VBE_Extras' Project window commands
The Project Explorer's own selection follows the Code Navigator's, so anything in the VBE that acts on "the selected item" (for example, the Properties window) acts on whatever is selected in the Code Navigator
The View Code, View Object and Toggle Groups buttons appear in the Code Navigator's toolbar

The keys you already know
Two more options change what a key does. Each works whether or not "Replicate the Project Explorer" is checked:
Ctrl+R moves to the Code Navigator - Ctrl+R, the VBE's own key for the Project Explorer, takes you to the Code Navigator instead (showing it first if it is hidden). If "Alternative VBE window navigation keys" is also checked, in the "Other" tab of VBE_Extras Settings, pressing Ctrl+R again takes you back to the code pane, UserForm designer or Object Browser you came from (while this option is checked, you can still get to the Project Explorer itself using View > Project Explorer in the VBE's main menu)
Tab moves between Projects - in the tree, Tab selects the next Project and Shift+Tab the previous one, as they do in the Project Explorer

What the tree shows
The Options decide how much of each Project the tree shows, and how:
Show in groups - Modules, Project References and CCAs in groups, or directly below their Project
Type before name - the type of each member before its name, or after it in parentheses
Show value type - the value type, for members that have (or return) one
Show Project References - each Project's references to libraries and to other Projects (see Adding / updating "Project References" in the VBE for more on how VBE_Extras can help with Project References)
Show CCAs - each Project's Conditional Compilation Arguments (see Sometimes it's just the little things - #6: Restore values for Conditional Compilation Arguments defined in the Project Properties dialog for more on how VBE_Extras can help with CCAs)
Sort alphabetically - declarations in alphabetical order, or in the order they are declared (Projects and Modules always keep the Project Explorer's order)
Scope - how far down the tree goes, from "Projects and Project members" to "All":
"Projects and Project members" … that is, Projects, Modules (of all types) plus Project References and CCAs if the option for them is checked
"Projects, Project members, procedures and properties" … everything above plus all procedures (i.e. Subs and Functions) and Properties (Let, Set and Get)
"Projects, Project members, all Module members" … everything above plus all other members of Modules (Enums, Types, Module-level variables, Module-level constants, Events, Declare Subs and Functions, #Consts and Controls)
"All" … literally all declarations … everything above plus variables, parameters, constants and statics within procedures and properties, Enum members, Type elements, parameters of Declare Subs and Functions

How it looks
Text colour - one colour ("Uniform"), a colour for each level of the tree ("By level") or a colour for each type of declaration ("By type") ... and "Select colours" lets you choose which specific colours
Use the code pane's font and Use the code pane's colours - the tree in the same font and / or the same colours as your code, which suits a dark theme particularly well
Some of the VBE_Extras-wide settings (VBE_Extras > Settings) apply too: "Stripy rows" and the font, in the UI tab, and the 'PdI' and 'Exp' markers after the names of Class Modules with VB_PredeclaredId or VB_Exposed set to True (see the user guide for full details)


And if you work in FullScreen, the Code Navigator can stay with you: check "Code Navigator" in the FullScreen tab of the Settings.
That's the Code Navigator
Even though I've done three posts on the Code Navigator, there's still more. For full details, see the "Code Navigator" chapter of the user guide. The Code Navigator is in VBE_Extras from release 1.8.0.0, and it is included in the free trial: if you are not yet a VBE_Extras user, head to the VBE_Extras page to try it for free.



Comments