« first day (586 days earlier)      last day (2594 days later) » 

12:01 AM
RELOAD!
[Hosch250/Rubberduck] 49 commits. 41162 additions. 23455 deletions.
[Hosch250/VSDiagnostics] 11 commits. 1453 additions. 169 deletions.
[retailcoder/Rubberduck] 40 commits. 9559 additions. 7765 deletions.
[rubberduck-vba/Rubberduck] 48 commits. 6 opened issues. 1 closed issue. 23 issue comments. 41397 additions. 23463 deletions.
[skiwi2/OGNext] 2 commits. 3 opened issues. 2 closed issues. 2 issue comments. 572 additions. 14 deletions.
[skiwi2/OGNext-Userscript] 2 commits. 1 opened issue. 1 closed issue. 200 additions. 50 deletions.
[Vannevelj/VSDiagnostics] 6 commits. 1 opened issue. 5 closed issues. 5 issue comments. 392 additions. 52 deletions.
 
1:01 AM
5
A: What would be a good approach to generate a tree of folders?

5gon12ederThe following algorithm should do almost what you've asked for. paths : List<String> ;; your list of paths tree : Folder = NEW Folder("") FOREACH path IN paths DO node : Folder = tree FOREACH component IN split(path, "/") DO next : Folder = node.getChild(component) IF...

Code Explorer 2.0 will have nested folders support! :-)
 
@Mat'sMug I expect Folders with support for Symbolic links ;)
 
Support for what?
Folders you can refactor/rename?
 
Symbolic links are similar to junction points and reparse points under NTFS.
 
swoosh
 
you could define for example:
'@folder foo\bar
@folder bar\foo
and then the module would show up under both hierarchies.
 
1:16 AM
lol, I made an inspection specifically to warn about modules with more than 1 @Folder annotation
It would be easily done I guess
 
I was originally kidding about the symbolic links, but thinking about it, the explorer becomes more useful with that kind of functionality.
similar to applying tags
 
Wouldn't it be confusing?
Like, the kind of feature that gets filed in a bug report
 
symlinks are not really the point of this feature
 
I really wish to find a way to treat @Folder annotations as declarations, so they can be safely refactored; you rename Foo and all modules under it follow along
 
you could try to do that through a rename feature in the tree view that would find all declarations with that folder in them
but then you're basically implementing a whole Filesystem
well apart from the messy things like symlinks and IO, but it's getting there :)
 
1:24 AM
Sort of like a virtual one, yeah. This is the very last thing that's preventing full-blown OOP in VBA: the ability to cleanly organize a gazillion class modules
 
symlinks would only be counterproductive
then again it's not like you can give the same name to different modules, because VBA doesn't work that way
 
Exactly. That's exactly why I renamed the annotation from @Namespace to @Folder
 
anyways I'm off to bed, niters
 
Night!
 
1:42 AM
> The only other way, that I can think of, is to read the PROJECTCONSTANTS Record (see MS OVBA document) inside the VBProject binary from the hosting file, but that would only give you the constants as they stood at last save.
 
@Duga that's a tough one. How would inspections use the compiler constants?
 
So this really slows down excel, but maybe this perfmon idea can be used in RubberduckVBA to add profiling functionality

http://www.nullskull.com/a/1479/identifying-which-formulas-in-excel-are-slowing-down-workbook-recalaculation.aspx
 
@Mat'sMug Compiler constants declared at the project level are global, whereas compiler constants declared at the module level (using #Const) are local to the module. Inspections could recommend declaring the compiler constant at the local level.
Oddly, VBIDE only seems to allow integer values for Global compiler constants, but allows any basic type as module-level compiler constants... Which is odd...
 
2:16 AM
Good to know
@JustinDearing hey that's pretty cool!
 
2:44 AM
@JustinDearing interesting - and refreshing to see profiling using QueryPerformanceFrequency instead of GetTicks, Timer or Now(). I have a VBA Stopwatch class that I'll post to CR for review (it matches the members of the .NET Stopwatch class, so it's easy to use, and easy to port.)
 
ooh shiny!
 
3:00 AM
man, this is becoming impressive
almost all @Hosch250's work!
 
claps
 
okay, smoke break, and then time to nest these folders
 
> Often you'll want to insert a multi-line Lorem Ipsum, SQL-snippet, HTML/XML string, treatise or ASCII Art into VBA, and VBIDE will assume you're pasting multiple lines of code.

It would be nice if you could paste as a multiline string-literal, and RubberDuck handles the double-quotes, ampersands and line continuations.
Maybe does inspection and recommends inserting as, or refactoring to a constant
Maybe even handles the indentation on insert/paste.
 
0
Q: Please help me speed/clean up my code

Dan WI have a subroutine which re-formats cells after a heading is inserted into the document. Most cells are 12.75 points high, whereas the headings are 15 points high. When a Heading (single line) is inserted, it pushes all of the other cells down, however the formatting does not move with them, so ...

 
3:26 AM
> Given RD adds a number of explorers and windows, the potential for window clutter is growing.
It would be great if we could save various window layouts. I'd suggest use-case driven layouts such as:
- Debug
- Refactor
- Inspection
- Coding

I found this project which does something similar for VS layouts.
Eclipse allows saved Perspectives, Photoshop and Illustrator allow "Saved Workspaces"
 
3:53 AM
haha I just stumbled on @RubberDuck's older answer to one of my questions
 
@Mat'sMug - Is there a Comment Syntax that tells RD that the procedure is a callback, and hence might not be called by code inside the project?
 
'@Ignore ProcedureNotUsed
it doesn't say the procedure is a callback, but it's enough to make the ProcedureNotUsedInspection skip that method's Declaration.
 
4:09 AM
hmmm... Does that mean that the entire procedure is not inspected?
the body might have code that needs inspecting
 
> Wizard for inserting Ribbon callback signatures.

Should probably be PtrSafe and CustomUI version aware.

Linking this to Win32 Helper
> Access has a built-in Macro to VBA converter, but it is really, really bad.

Converting Macros to VBA is relatively easy. It's finding and updating *all* of the event properties so that they call the code, rather than the macro, that's more difficult.
> :+1: Great idea!

The *window clutter* concern is real.
 
4:40 AM
@Mat'sMug Could you check whether this condition is enough to refine this? github.com/rubberduck-vba/Rubberduck/blob/next/RetailCoder.VBE/…
Should I be comparing the projects too, or something?
 
> Why not just remember which windows were open the last time RD was closed and their positions?
 
@Hosch250 what are you trying to do here? finding the declaration from an identifier usage?
 
Yes.
 
IdentifierReference.Declaration points to it already...
 
No. The containing declaration.
Like, which method the reference is called from. Declaration shows the declaration of the referenced item.
 
4:44 AM
ah
 
I am checking the scope, so once we get past module level, I'm safe because VBA doesn't allow overloads and modules with the same name.
 
so the code inside the condition inside the loop really only runs once
 
I'm not real sure whether I can guarantee the item is from the same project.
@Mat'sMug Yeah, I can probably really use Single() there.
 
s/can/should
 
> sure, remembering the last layout is useful, but being able to quickly change between preconfigured layouts is more useful.
 
4:46 AM
it would be much clearer about the intent there
 
OK, I'll change that to Single and check the project, just in case.
 
use SingleOrDefault to handle the exceptional case instead of blowing up ;-)
 
OK, but it should never be null because the parent declaration has to exist for the reference to exist...
BTW, that really should be an extension method for IdentifierReference, or even built into the class, I think.
 
probably
@Hosch250 you can never know that you'll find the declaration you're looking for.
 
5:01 AM
[Hosch250/Rubberduck] Hosch250 pushed commit 3dcc0329 to EncapsulatePublicFieldsInspection: Clean up ParentDeclaration(IdentifierReference)
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 3dcc0329 to next: Clean up ParentDeclaration(IdentifierReference)
Merge pull request #933 from Hosch250/EncapsulatePublicFieldsInspection

Clean up ParentDeclaration(IdentifierReference)
 
I wish we had unit tests.
 
well the parser API is synchronous now ;-)
 
Is it?
 
only ParseAll runs a task
 
Last I tried to do it, I kept getting that peculiar error.
 
5:07 AM
I cleaned that up a bit
 
The error?
I mean the one when I couldn't find the file.
 
the parser
 
Oh.
 
oh
lol
 
There isn't anything funny about it :(
 
5:44 AM
I have a test case for scope that is hurting my brain
Is there an issue I should post it in?
 
what is it?
 
declares types, routines and variables that are the same as the project, module and sub names.
it's really ugly
 
does it resolve correctly?
 
VBIDE compiles it and runs
 
I mean RD :)
 
5:47 AM
Not sure - I'm on a work PC - I don't have rights to install at work.
 
ah
 
this should give you a flavor...
Dim MyProject As MyProject
Dim MyModule As MyProject.MyModule.MyProject
Dim MySub As MySub
Dim MyVar As MyVar
 
this was my resolver stress-test:
Jul 5 '15 at 5:33, by Mat's Mug
Sub Foo()
    Dim Foo As New Foo
    With Foo
        With .Foo
            .Foo = 42
        End With
        Bar .Foo.Foo
    End With
End Sub
everything resolved as it should
 
Private Type MyVar
MyProject As MyModule
End Type
 
VBA compiles nasty, nasty evil code
 
5:49 AM
I had to stop writing the test case before the universe imploded
2
 
feel free to make a new issue, I'll put it under
 
> This isn't even as nasty as it could be. My own brain started to have lexing issues...
```
'Project Name = MyProject
'Module Name = MyModule
Option Explicit

Private MyVar As MyProject
Private MyVar1 As MyModule

Private Type MyProject
MyModule As String
MySub As String
End Type

Private Type MyModule
MyVar As String
String As MyProject
End Type

Private Type MySub
MyVar As MyModule
MyVar1 As MyProject
End Type

Private Type MyVar
MyProject As MyModule
E
> uh-oh :fearful:
 
6:15 AM
ugh. great, I get folders, but my XAML won't take them. I need to simplify the viewmodels, something's badly wrong with this code.
note to self: this is what I want. I need a common type between the folder nodes and the leaf nodes
TTGTB though
'night!
@Duga it parses, but doesn't resolve everything correctly if I paste it into [ThisWorkbook]. It breaks if I paste it in MyModule and name the project MyProject.
i.e. good test case
(and i.e. crap I have resolver bugs)
 
6:39 AM
> I love assumptions! `FindLocalScopeDeclaration` did this

// if we're not returning a function/getter value, then there can be only one:
return results.Single();

Fix:

// if we're not returning a function/getter value, then there can be only one that isn't the localScope declaration:
return results.Single(item => !item.Equals(localScope));
> Another bug: MyProject.MySub isn't picked up as a reference to MyProject.MyModule.MySub.
 
@Duga nevermind, wrong MySub
uh
yeah
yeah there's a bug
I think
no
wow, Shift+F2 Mat, Shift+F2
 
> Refactor/rename broke the code at step 4:

Option Explicit

Private MyVar As MyProject
Private MyVar1 As MyModule

Private Type MyProject
MyModule As String
MySub As String
End Type

Private Type MyModule
MyVar As String
String As MyProject
End Type

Private Type MySub
MyVar As MyModule
MyVar1 As MyProject
End Type

Private Type MyVar
MyProject As MyModule
End Type
 
 
3 hours later…
9:50 AM
> Both we should do, yes. Brave this developer must be. Many COM Exceptions will block the path to feature.

Too. Much. Star Wars...
> Seriously though, I like this feature. I'm just banking on some cryptic COM Exceptions when we try to set a bunch of windows positions and some window we hadn't captured has moved. Totally doable and worth while feature. I just think it's gonna be a PITA to implement.
 
10:34 AM
> Fearless he is, heading off into the IUnknown
 
@Duga just for reference, I'm calling scope creep!
 
> Thanks for introducing me to Rubberduck to see if it helps me.
I installed from Github as suggested and ran as it is in Excel with ALT-F11 keypress.
I got errors such as this.
![2016-01-12](https://cloud.githubusercontent.com/assets/2254567/12291944/486056da-ba3e-11e5-8f61-6514e295beaa.png)
and
here is the file I exported from the dialogbox.
[Rubberduck run first time error.txt](https://github.com/rubberduck-vba/Rubberduck/files/88714/Rubberduck.run.first.time.error.txt)

Is this norm
 
10:51 AM
0
Q: Calculate Maximum Time Difference Within 30 Minutes

Jean-Pierre OosthuizenFor ease of Reference, Sample Data Set which needs to be pasted into Column C from row 20: 2015/08/01 12:53:02.700 2015/08/01 12:56:31.101 2015/08/01 12:56:37.499 2015/08/01 13:00:05.901 2015/08/01 13:00:12.300 2015/08/01 13:03:38.700 2015/08/01 13:03:45.101 2015/08/01 13:05:51.702 2015/...

 
It's only scope creep if the issue is brought in scope... I don't know the codebase well enough to know if I'm suggesting too much. Just thought I'd document them. If you want to tag them 4.0, that's fine by me, but hopefully I can hit on some defects/bugs.
 
11:12 AM
> Hello and thanks for the report.

From what I can see (not a developer on the project) Rubberduck doesn't seem to be involved in this case. The relevant modules are apparently loaded correctly, so Rubberduck should be ready to use for you :+1:

Dropping the attached stacktrace information for easy overview:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
 
11:24 AM
> I'm not sure what's happening here. Does the VBE open at all (after the exception)?
> Yes it does suprisingly.
![2016-01-13 2](https://cloud.githubusercontent.com/assets/2254567/12293036/f96aa06a-ba44-11e5-8a4d-6b8f0fc14aa7.png)
I thought to make sure it is documented when I run this.
> Sorry I pressed the wrong button (Close and comment) by mistake. On reflection i think this all is needed a place to document an such as this. I will raise a new issue after I have a few tries of writing software. Thanks for your help.
 
I have no idea what's happening there @Duga. No clue.
 
Stacktrace doesn't mention Rubberduck, so it might be unrelated
 
11:52 AM
> G'Day,
I found another tricky error from my end.
I decided to test Rubberduck with a VBA code that I had obtained from a Bruce McPherson's website http://ramblings.mcpher.com/ cDataSetSkeleton.xlm Excel file to see how it reacts.
The trouble is the parser completed reading the project which is fine however found a error message that is WAY WAY long for me to read and could not work out what the complaint is?
Shame I could not scroll it side ways/hoping a multi-line breakdown/even stretchin
 
12:04 PM
yeeha parser bug!
 
> Oh Cool a parser bug. It seems that the code isn't correctly parsed by the current Grammar. These bugs aren't really commonplace.

Would you mind grabbing and pasting the function or sub that's around line 218? It seems that the parens aren't correctly handled there.
 
12:18 PM
Question: do the line-numbers from the parser correspond to the VBE line numbers after the changes to LINE_CONTINUATION?
 
> Sure. To respect the source cDataSetSkeleton.xlm (UserfulStuff) where the info comes from, Bruce McPherson (http://ramblings.mcpher.com) below is his function which Rubberduck spat the parse dummy! :relaxed:
```VBA
Public Function URLEncode( _
StringVal As String, _
Optional SpaceAsPlus As Boolean = False, _
Optional UTF8Encode As Boolean = True _
) As String

Dim StringValCopy As String: StringValCopy = _
IIf(UTF8Encode, UTF16To8(StringVal), StringVal)
' Here is where t
> Possible duplicate: #861 "Instructions separator breaks parser in specific circumstances"
 
1:26 PM
@Duga seems like it
 
 
1 hour later…
2:45 PM
@Vogel612 I rolled that back, but yeah
 
why did you roll it back? Didn't it work?
 
0
Q: Refactor of vba function

VinnyGuitaraI would like to have the code for one of my VBA functions reviewed. It takes in an array of data built from a source workbook, builds a set of "flags" based on the data in each row of the array. Then it creates a new finalRng array that will, based on a set of logic from the business, create ne...

 
3:39 PM
@Vogel612 it [sort-of] worked, but it also made the underscore no longer be ignored by the parser, which is highly problematic - much more than having the parser blow up when there's a non-indented continued line.
 
 
3 hours later…
6:31 PM
Fun fact: your fiddle code parses as-is in Rubberduck v1.4.3; code inspections highlight 40-some issues (including some dead code), and the extract method refactoring could be helpful - I'll see what Rubberduck 2.0 has to say tonight (I maintain the Rubberduck project), and post an answer. — Mat's Mug ♦ 13 secs ago
 
7:05 PM
Does RD make a distinction between, and expose, physical lines and logical lines?
 
7:21 PM
Today's XKCD, xkcd.com/1629
 
0
Q: ExcelVBA loop exports data from spreadsheet to table within Excel

MisterGTI want to nest a for loop to cycle through the Range.Value but ("B4") throws me off and this can't be avoided. I was considering using an array to do this but can't seem to get the format correct. "Q3" is a spreadsheet and "Bac Form" is the attached table imported from a PDF that must be kept. ...

 
7:43 PM
@ThunderFrame not really. everything is built on the ANTLR token stream basically - tokens retain their physical location in the token stream (line & column); this is why we can't just parse a snippet, we have to pass the parser the entire module so that our Declaration and IdentifierReference objects point to the correct locations
 
8:21 PM
> This might have something to do with a bug in one of the docked grid toolwindows. Can't repro here though (build 1.4.3.2343), but I think I recall this being an issue at one point prior to the release.

I'm re-closing this issue though, since 2.0 (/current build) will no longer use grids in docked toolwindows.
 
 
1 hour later…
9:40 PM
@ThunderFrame I wish it did. It would simplify things.
 
In honor of critical errors I leave you this: github.com/skiwi2/OGNext/issues/19
 
@RubberDuck if only people stopped doing weird things that break the parser...
4
 
@skiwi sounds a lot like the issue I just spent two days fixing.
And oh yeah, that involved restoring a database to production.
 
> @ThunderFrame can you flush out what exactly you'd like this to do? It could be months (or more) before someone gets to it. It'll be nice to have a good user story to help with that.

> As a user, I want X, so that Y.
> It should behave like Z.
 
s/flush/flesh?
 
10:41 PM
> As a VBA Developer that uses the Ribbon in Office solutions, I regularly need to write callback functions that allow the Ribbon to behave dynamically, read data from VBA and persist states.
The callback functions must adhere to various signatures, depending upon the Ribbon control type and event. The signatures define the argument types and return type, but not necessarily the callback function names or argument names.

Much like inserting Win32 API declarations (#894), the insertion of Rib
 
 
1 hour later…
11:58 PM
0
Q: VBA - Is it safe to remove items from a dictionary within a for each?

BitiousPosting this here as someone suggested it was better suited for code review :) So, I'm completely inexperienced with VBA (Visual Basic For Applications). Basically, I have code that runs through dictionaries and removes certain elements from them. Here's a quick examples (that is NOT in the pro...

 

« first day (586 days earlier)      last day (2594 days later) »