Rubberduck is an open-source COM add-in project for the VBA IDE written in C#. Use this tag for reviews of the C# source code, or for reviews of VBA client code.
3
votes
3answers
55 views
Unit Test Settings
Recently, I redesigned the Rubberduck settings pane. Here is the unit test settings view, which is posted in this question:
The part we are referring to is the section in the right pane. The rest ...
3
votes
1answer
38 views
Displaying inspection results, grouped per user selection
The Rubberduck 2.0 Code Inspections UI was recently redesigned (again!), this time featuring a GroupingGrid control (thanks @BrunoCosta!), and what appears to be a ...
6
votes
4answers
127 views
Unit Testing the Duck
I recently reinstated the unit tests in Rubberduck. Previously, our parser was a synchronous parser, with everything running in sequence, and we could just request a parse result. Now, however, it ...
9
votes
1answer
95 views
Code Explorer 2.0: A folder hierarchy to organize VBA projects
Next release of Rubberduck will introduce a very cool @Folder annotation system that the Code Explorer will use to organize modules into - you guessed it - folders:
...
6
votes
1answer
69 views
Inspector Rubberduck and the abstract inspections
The Rubberduck code inspections have just seen yet another structural change, hopefully for the better.
The IInspectionModel interface was originally named ...
5
votes
1answer
61 views
Convert Procedure to Function
My latest inspection for Rubberduck determines whether a procedure should be a function by checking whether it has a single ByRef parameter (either explicit or ...
11
votes
1answer
80 views
Extract Interface
One of the latest refactorings for Rubberduck is Extract Interface. This refactoring will take a class, display all public members, and allow you to select which members you wish to include in your ...
6
votes
1answer
65 views
Implement Interface Refactoring
The latest refactoring for Rubberduck is Implement Interface. This refactoring will check whether the active class fully implements the selected interface by comparing the definitions. It knows the ...
10
votes
1answer
71 views
Move Closer To Usage
One of my latest refactorings for Rubberduck is Move Closer To Usage. The refactoring will take a field and move it just above the reference to it only if it is used in a single method, or take a ...
6
votes
1answer
73 views
The Realtor-duck: Encapsulating Fields with Properties
The latest new refactoring for our friend Rubberduck is Encapsulate Field:
This image, for the sake of brevity, shows the result of the refactoring and the UI together. The three properties below ...
8
votes
1answer
64 views
Climbing the Totem Pole - Local Variables Become Parameters
Along with the Introduce Field refactoring, I wrote an Introduce Parameter refactoring.
I actually wrote this refactoring first, but due to a bug in the parser/resolver, I was unable to fully test it ...
16
votes
4answers
3k views
You are Promoted, You are Promoted, We All are Promoted!
My latest refactoring for Rubberduck is called Introduce Field - it promotes a local variable to a private field.
The three overridden Refactor() methods are the ...
15
votes
5answers
146 views
Step by Step, ooh HotKey
Still hooked on Windows, I refactored the hook into a number of interfaces, and I wanted to support 2-step hotkeys, so I started with defining an IHook that can be ...
17
votes
2answers
3k views
Hooked on Windows
The code that was just added to Rubberduck will allow us to set up hotkeys for our features, so that next release, Ctrl+Shift+R brings up the refactor/rename dialog, for example.
The requirements ...
18
votes
2answers
227 views
RubberduckParser 2.0 - Asynchronous Parsing
The IRubberduckParser interface has seen breaking changes, and now looks like this:
...
11
votes
2answers
95 views
IdentifierReferenceResolver: resolving at project level
One of the most important parts at the core of rubberduck is the IdentifierReferenceResolver class, which is responsible for resolving each declaration as the parse ...
8
votes
2answers
397 views
Declaration of bloatedness: the class that knew too much?
I've already expressed concerns about this type's constructor, and I've sort-of* implemented the changes suggested in the answers I got there.
Recently I added even more parameters to that ...
14
votes
2answers
199 views
Learning by translating - Follow the Rubberduck - Part 2: Beta
This project is my learning place for a few things:
MVP (model view presenter)
XML (parsing, editing and leveraging)
deeper swing functionality
Concerning the XML part I have already recieved a ...
8
votes
1answer
49 views
CommandBars, Buttons and Commands: Take 3
Following up on CommandBars, Buttons and Commands: Take 2, I've refactored quite a lot of the Rubberduck code base (like, a whole third of the entire code base has been affected), and successfully ...
8
votes
1answer
129 views
TestExplorer 2.0 - From Grid to TreeView
Rubberduck's unit testing feature (heck, the whole project) started with a VBA unit testing framework that was ported from vba to c#; the VBA logic was pretty much simply rewritten in another ...
6
votes
2answers
128 views
CommandBars, Buttons and Commands: Take 2
Following-up on CommandBars, Buttons and Commands: Cleanup is on the menu, I decided to try a more ambitious approach, as suggested in Nikita's answer. It works, but there are a number of "gotchas" ...
14
votes
2answers
131 views
CommandBars, Buttons and Commands: Cleanup is on the menu
One of the biggest pain point in the entire rubberduck code base, is the way commandbar menus and menu items are created and wired up - something needs to be done to straighten that up, and while I ...
5
votes
2answers
70 views
Regex Search/Replace
Rubberduck's latest (and greatest?) feature is a regex search/replace:
This is the defining interface:
...
11
votes
1answer
203 views
IoC Registration: Convention over Configuration
The rubberduck project has reached a turning point. The core features are implemented (except the SmartIndenter embedding - we're keeping that for 2.0), the next few releases will probably just build ...
7
votes
2answers
164 views
Building an IDE, block by — er, mock by mock
The opening sentence of an answer I received in my previous post snowballed, and led to completely ditching the previous approach. Mocking my IDE with a MockFactory ...
16
votes
2answers
4k views
Go on, mock my IDE
Because of the coupling with the VBIDE API (the extensibility library for the VBA IDE), unit testing the rubberduck refactorings, inspections and quick-fixes has been pretty much impossible, at least ...
17
votes
3answers
214 views
Translating the Rubberduck - Übersetzen der Gummiente - Part 1: Modelling
So I have committed to making a German translation for the guys over at Rubberduck, which is localized via .resx files.
Now these files are basically XML-Files with a certain, rather simple document ...
5
votes
2answers
370 views
Binding Lists of Commits to a DataGridView in Winforms with an MVP architecture
I'm using Winforms and I find this pattern showing up in my code a lot. It works, but I'm unsure if it's best. The goal is to pass an IList of items through a view ...
11
votes
2answers
117 views
The multilingual duck
So, we have this "Rubberduck Settings" window, with a number of "tabs" dedicated to each configurable feature. The "root" tab contains the application's "general settings" and, in the next release, ...
5
votes
1answer
122 views
Removing parameters refactoring
After the Reorder Parameters refactoring, I implemented a Remove Parameters refactoring (no, it didn't take this long, just been busy). Also, we completely refactored all the refactorings and ...
8
votes
2answers
82 views
GoTo Implementation: First-class navigation for the VBE
ReSharper has a very handy feature that's particularly useful when coding against abstractions. Since coding against abstractions is something that can also be done in VBA, the next release of ...
11
votes
1answer
117 views
Rubberduck “GoTo Anything” Navigation
The next version of rubberduck is going to include a pretty nifty "goto anything" / find symbol navigation tool that lets the user enter an identifier name in a combobox:
UI
To achieve the ...
12
votes
3answers
141 views
Reordering method parameters
Next release of Rubberduck (should be 1.4) introduces a reorder parameters refactoring, which lets user reorder the parameters of a module (or class) member, and automatically adjust all usages.
...
8
votes
3answers
116 views
Asynchronous Code Inspections
Rubberduck code inspections can take quite a while to complete, so I decided to run them on a background thread instead of locking up the IDE. The only drawback is... the IDE isn't locked-up while ...
10
votes
1answer
88 views
Extract Method: A refactored refactoring
This post is somewhat of a follow-up to Rubberduck's "Extract Method" refactoring implementation.
A tremendous amount of things have changed since version 1.2, when this feature was ...
11
votes
2answers
195 views
Exploring the code of the Code Explorer
The Code Explorer is a dockable toolwindow that displays a TreeView that shows all opened VBA projects and their respective modules, but unlike the "native" Project Explorer, Rubberduck's explorer ...
6
votes
2answers
204 views
Building in the built-in declarations
In order for Rubberduck to be able to "recognize" the built-in VBA functions, procedures and objects, I added yet another constructor parameter to my Declaration ...
6
votes
1answer
141 views
Code Inspection: Procedure not used
Here is yet another piece of Rubberduck code, this time the nasty ProcedureNotUsedInspection class, whose role is to identify all procedures that are never called ...
11
votes
1answer
108 views
Rubberduck's “Rename” refactoring implementation
Knowing who's using what, and where, I've implemented a "Rename" refactoring for Rubberduck.
It works great - it needs further extensive testing, but the preliminary tests are very, very exciting.
...
17
votes
3answers
941 views
Who's using what where - turning code into symbols
The Rubberduck project is coming along pretty nicely, and for the next version the parsing strategy is getting yet another revision, and this time around it really feels like it's done right.
Or is ...
8
votes
1answer
110 views
Growing my own Tree (Structure)
Summary
VB6 doesn't have a great selection of data structures to work with, so again I find myself creating my own. I have a need to dynamically generate a directory structure on the file system. The ...
7
votes
3answers
181 views
Notifying the UI that Issues Were Found
Our Rubberduck VBA IDE Add In does some static code analysis, and then reports all of the found issues back in a gridview. This analysis can take a long time for larger projects and the UI appeared to ...
10
votes
2answers
128 views
Inspector Rubberduck - Take Two
Release 1.1 of Rubberduck only had a handful of implemented code inspections, more as a proof of concept than anything else. For release 1.2, we now have 19 implementations of our ...
12
votes
2answers
791 views
Wait, is that variable ever assigned?
One of the inspections we wanted to implement in Rubberduck for the next release, is one that finds all unassigned variables in a VBA project.
Implementing this inspection has been ...complicated ...
18
votes
3answers
347 views
Rubberduck's “Extract Method” refactoring implementation
With the ANTLR-powered parser, I was able to reimplement all code inspections from the last release build, and the rest of the inspections on the road map are now implementable.
Code inspections ...
7
votes
2answers
464 views
Rubberduck VBA Parser, Episode VI: Return of the Abstraction
VBA comment syntax is fun... and VBA line continuation makes it even more fun.
Picture a VBA module like this:
...
6
votes
1answer
202 views
Rubberduck VBA Parser, Episode V: The ANTLR Strikes Back
I changed my mind. I don't want to implement 200-some Node classes. Instead, I'll be working directly with the ANTLR generated classes, to implement the Rubberduck ...
12
votes
1answer
302 views
Rubberduck VBA Parser, Episode IV: A New Hope
My home-made wannabe-a-parser was wet behind the ears, so I started seriously looking into more mature alternatives, and ended up adding a dependency to the ANTLR lexer/parser generator tool, and ...
12
votes
4answers
257 views
Rolling my own Configuration with UI
The Rubberduck Saga continues as I find a need to roll my own configuration. Since the program is really a *.dll and available to several host applications, using app.config is not an option. I ...
11
votes
3answers
168 views
Karate Chop Kata
I had some time to kill today, and I found the Karate Chop Kata.
Specification:
Write a binary chop method that takes an integer search target and a sorted array of integers. It should ...