You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78Lines changed: 78 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -118,3 +118,81 @@ Icons in the `./Resources/Custom/` directory were created by (or modified using
118
118
Since the project's early days, JetBrains' Open-Source team has been supporting Rubberduck - and we deeply thank them for that. ReSharper has been not only a tool we couldn't do without; it's been an inspiration, the ultimate level of polished perfection to strive for in our own IDE add-in project. So just like you're missing out if you write VBA and you're not using Rubberduck, you're missing out if you write C# and aren't using ReSharper.
119
119
120
120
<sub>Note: Rubberduck is not a JetBrains product. JetBrains does not contribute and is not affiliated to the Rubberduck project in any way.</sub>
121
+
122
+
---
123
+
124
+
# Overview
125
+
126
+
The first thing you will notice of Rubberduck is its commandbar and menus; Rubberduck becomes part of the VBE, but at startup you'll notice almost everything is disabled, and the Rubberduck commandbar says "Pending":
127
+
128
+

129
+
130
+
This button is how Rubberduck keeps in sync with what's in the IDE: when it's Rubberduck itself making changes to the code, it will refresh automatically, but if you make changes to the code and then want to use Rubberduck features, you'll need Rubberduck to *parse* the code first.
131
+
132
+
The status label will display various steps:
133
+
134
+
-**Loading declarations**: Rubberduck noticed new project references and is retrieving information from the COM type libraries.
135
+
-**Parsing**: Rubberduck is creating a parse tree for each new module, and/or updating the parse trees for the modified ones.
136
+
-**Resolving declarations**: The parse trees are being traversed to identify all declarations (variables, procedures, parameters, locals, ...line labels, *everything*).
137
+
-**Resolving references**: The parse trees are being traversed again, this time to locate all identifier references and resolve them all to a specific declaration.
138
+
-**Inspecting**: At this point most features are enabled already; Rubberduck is running its inspections and displaying the results in the *inspection results* toolwindow.
139
+
140
+
That's if everything goes well. Rubberduck assumes the code it's parsing is valid, compilable code that VBA itself can understand.
141
+
142
+
It's possible you encounter (or write!) code that VBA has no problem with, but that Rubberduck's parser can't handle. When that's the case the Rubberduck commandbar will feature an "error" button:
143
+
144
+

145
+
146
+
Clicking the button brings up a tab in the *Search Results* toolwindow, from which you can double-click to navigate to the exact problematic position in the code:
147
+
148
+

149
+
150
+
The *Code Explorer* will also be displaying the corresponding module node with a red cross icon:
You'll find the *Code Explorer* under the *Navigate* menu. By default the Ctrl+R hotkey to display it instead of the VBE's own *Project Explorer*. The treeview lists not only modules, but also every single one of their members, with their signatures if you want. And you can make it arrange your modules into folders, simply by adding a `@Folder("Parent.Child")` annotation/comment to your modules:
155
+
156
+

157
+
158
+
The *inspection results* toolwindow can be displayed by pressing Ctrl+Shift+i (default hotkey), and allows you to double-click to navigate all potential issues that Rubberduck found in your code.
Rubberduck also features a port of the popular "Smart Indenter" add-in (now supports 64-bit hosts, and with a few bugfixes on top of that!), so you can turn this:
163
+
164
+
````vb
165
+
SubDoSomething()
166
+
WithActiveCell
167
+
With.Offset(1,2)
168
+
If.value>100Then
169
+
MsgBox"something"
170
+
Else
171
+
MsgBox"something else"
172
+
EndIf
173
+
EndWith
174
+
EndWith
175
+
EndSub
176
+
````
177
+
178
+
Into this:
179
+
180
+
````vb
181
+
SubDoSomething()
182
+
WithActiveCell
183
+
With.Offset(1,2)
184
+
If.value>100Then
185
+
MsgBox"something"
186
+
Else
187
+
MsgBox"something else"
188
+
EndIf
189
+
EndWith
190
+
EndWith
191
+
EndSub
192
+
````
193
+
194
+
...with a single click.
195
+
196
+
---
197
+
198
+
There's *quite a lot* to Rubberduck, the above is barely even a "quick tour"; the project's [website](http://www.rubberduckvba.com/) lists all the features, and the [wiki](https://github.com/rubberduck-vba/Rubberduck/wiki) will eventually document everything there is to document. Feel free to poke around and break things and [request features / create new issues](https://github.com/rubberduck-vba/Rubberduck/issues/new) too!
0 commit comments