Giter Site home page Giter Site logo

shairad / rubberduck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rubberduck-vba/rubberduck

0.0 0.0 0.0 35.52 MB

Every programmer needs a rubberduck. COM add-in for the VBA IDE (VBE).

License: GNU General Public License v3.0

Inno Setup 0.14% C# 96.69% ANTLR 0.71% Visual Basic 2.46%

rubberduck's Introduction

Branch Description Build Status
master The last released build master branch build status
next The current build (dev) next branch build status

Average time to resolve an issue Percentage of issues still open

rubberduckvba.com Wiki Rubberduck News [email protected]
Follow @rubberduckvba on Twitter


What is Rubberduck?

It's an add-in for the VBA IDE, the glorious Visual Basic Editor (VBE) - which hasn't seen an update in this century, but that's still in use everywhere around the world. Rubberduck wants to give its users access to features you would find in the VBE if it had kept up with the features of Visual Studio and other IDE's in the past, oh, decade or so.

Rubberduck wants to help its users write better, cleaner, maintainable code. The many code inspections and refactoring tools help harmlessly making changes to the code, and unit testing helps writing a safety net that makes it easy to know exactly what broke when you made that small little harmless modification.

Rubberduck wants to bring VBA into the 21st century, and wants to see more open-source VBA repositories on GitHub - VBA code and source control don't traditionally exactly work hand in hand; unless you've automated it, exporting each module one by one to your local repository, fetching the remote changes, re-importing every module one by one back into the project, ...is a little bit tedious. Rubberduck integrates Git into the IDE, and handles all the file handling behind the scenes - a bit like Visual Studio's Team Explorer.


If you're learning VBA, Rubberduck can help you avoid a few common beginner mistakes, and can probably show you a trick or two - even if you're only ever writing macros. If you're a more advanced programmer, you will appreciate the richness of Rubberduck's feature set. See the Installing wiki page.

If you're a C# developer looking for a fun project to contribute to, see the Contributing wiki page.


License

Rubberduck is a COM add-in for the VBA IDE (VBE).

Copyright (C) 2014-2016 Mathieu Guindon & Christopher McClellan

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


Attributions

Software & Libraries

As of v1.2, Rubberduck is empowered by the awesomeness of ANTLR.

What is ANTLR?

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees.

We're not doing half of what we could be doing with this amazing tool. Try it, see for yourself!

What is LibGit2Sharp?

LibGit2Sharp is the library that has allowed us to integrate Git right into the VBA IDE (and as a nice bonus, expose a nice API that handles the nitty gritty of importing source files to and from the IDE to a repo for you).

LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .Net and Mono.

Okay, so what is libgit2?

libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.

Which basically means it's a reimplementation of Git in C. It also happens to be the technology Microsoft uses for their own Git integration with Visual Studio.

Source code looks a lot better with syntax highlighting, and AvalonEdit excels at it.

AvalonEdit is a WPF-based text editor component. It was written by Daniel Grunwald for the SharpDevelop IDE. Starting with version 5.0, AvalonEdit is released under the MIT license.

We're currently only using a tiny bit of this code editor's functionality (more to come!).

Without the EasyHook library, many of our more advanced Unit Testing features would simply not be possible. This library really lives up to its name, and allows us to intercept and inspect traffic through VBE7.dll and other unmanged libraries.

EasyHook makes it possible to extend (via hooking) unmanaged code APIs with pure managed functions, from within a fully managed environment on 32- or 64-bit Windows XP SP2, Windows Vista x64, Windows Server 2008 x64, Windows 7, Windows 8.1, and Windows 10.

EasyHook is released under the MIT license.

This library makes localizing WPF applications at runtime using resx files a breeze. Thank you Grant Frisken!

Licensed under The Code Project Open License with the author's permission to re-release under the GPLv3.

Icons

We didn't come up with these icons ourselves! Here's who did what:

This beautiful suite of professional-grade icons packs over 3,570 icons (16x16). You name it, there's an icon for that.

(C) 2012 Yusuke Kamiyamane. All rights reserved. These icons are licensed under a Creative Commons Attribution 3.0 License. If you can't or don't want to provide attribution, please purchase a royalty-free license.

Icons in the ./Resources/Custom/ directory were created by (or modified using elements from) the SharpDevelop icon set licensed under the MIT license.


JetBrains ReSharper logo

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.

Note: Rubberduck is not a JetBrains product. JetBrains does not contribute and is not affiliated to the Rubberduck project in any way.


Overview

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":

A 'Refresh' button, and 'Pending' state label in the Rubberduck commandbar

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.

The status label will display various steps:

  • Loading declarations: Rubberduck noticed new project references and is retrieving information from the COM type libraries.
  • Parsing: Rubberduck is creating a parse tree for each new module, and/or updating the parse trees for the modified ones.
  • Resolving declarations: The parse trees are being traversed to identify all declarations (variables, procedures, parameters, locals, ...line labels, everything).
  • Resolving references: The parse trees are being traversed again, this time to locate all identifier references and resolve them all to a specific declaration.
  • Inspecting: At this point most features are enabled already; Rubberduck is running its inspections and displaying the results in the inspection results toolwindow.

That's if everything goes well. Rubberduck assumes the code it's parsing is valid, compilable code that VBA itself can understand.

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:

button tooltip is "1 module(s) failed to parse; click for details."

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:

Parser errors are all displayed in a "Parser Errors" search results tab

The Code Explorer will also be displaying the corresponding module node with a red cross icon:

Module "ThisWorkbook" didn't parse correctly

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:

Code Explorer toolwindow

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.

inspection results

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:

Sub DoSomething()
With ActiveCell
With .Offset(1, 2)
If .value > 100 Then
MsgBox "something"
Else
MsgBox "something else"
End If
End With
End With
End Sub

Into this:

Sub DoSomething()
    With ActiveCell
        With .Offset(1, 2)
            If .value > 100 Then
                MsgBox "something"
            Else
                MsgBox "something else"
            End If
        End With
    End With
End Sub

...with a single click.


There's quite a lot to Rubberduck, the above is barely even a "quick tour"; the project's website lists all the features, and the wiki will eventually document everything there is to document. Feel free to poke around and break things and request features / create new issues too!

0

rubberduck's People

Contributors

retailcoder avatar hosch250 avatar rubberduck203 avatar comintern avatar mdoerner avatar bzngr avatar thunderframe avatar vogel612 avatar inopiae avatar grleachman avatar ivenbach avatar zomis avatar glacorsoul avatar dimitropoulos avatar zippy1981 avatar malachi26 avatar mhredmond21 avatar yuominae avatar yadimon avatar petlahev avatar ryankey avatar kerzhaw avatar morrme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.