Skip to content

Commit 9ec9c7c

Browse files
authored
Merge branch 'next' into next
2 parents a7fafa5 + 7ca9028 commit 9ec9c7c

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,81 @@ Icons in the `./Resources/Custom/` directory were created by (or modified using
118118
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.
119119

120120
<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+
![A 'Refresh' button, and 'Pending' state label in the Rubberduck commandbar](https://cloud.githubusercontent.com/assets/5751684/21707782/2e5a1a42-d3a0-11e6-87a3-c36ff65f9a79.png)
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+
![button tooltip is "1 module(s) failed to parse; click for details."](https://cloud.githubusercontent.com/assets/5751684/21708236/810e9ade-d3a4-11e6-8b4c-c4ec223c066a.png)
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+
![Parser errors are all displayed in a "Parser Errors" search results tab](https://cloud.githubusercontent.com/assets/5751684/21708348/86e64b72-d3a5-11e6-9aa8-60cd8d0bec33.png)
149+
150+
The *Code Explorer* will also be displaying the corresponding module node with a red cross icon:
151+
152+
![Module "ThisWorkbook" didn't parse correctly](https://cloud.githubusercontent.com/assets/5751684/21708276/e8f67e50-d3a4-11e6-8c1d-e84d4e9ccce6.png)
153+
154+
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+
![Code Explorer toolwindow](https://cloud.githubusercontent.com/assets/5751684/21708614/90335a46-d3a8-11e6-9e76-61cc3f566c7a.png)
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.
159+
160+
![inspection results](https://cloud.githubusercontent.com/assets/5751684/21708911/d0c47bc4-d3aa-11e6-88f2-b0c9fcfda7ed.png)
161+
162+
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+
Sub DoSomething()
166+
With ActiveCell
167+
With .Offset(1, 2)
168+
If .value > 100 Then
169+
MsgBox "something"
170+
Else
171+
MsgBox "something else"
172+
End If
173+
End With
174+
End With
175+
End Sub
176+
````
177+
178+
Into this:
179+
180+
````vb
181+
Sub DoSomething()
182+
With ActiveCell
183+
With .Offset(1, 2)
184+
If .value > 100 Then
185+
MsgBox "something"
186+
Else
187+
MsgBox "something else"
188+
End If
189+
End With
190+
End With
191+
End Sub
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

Comments
 (0)