« first day (346 days earlier)      last day (2834 days later) » 

2:02 PM
@Mat'sMug because it's just weird to Dim private variables? And because Private isn't allowed inside a procedure scope?
 
precisely
</poke-at-@FreeMan>
 
@Mat'sMug Either that or some morning caffeine.
 
oh, a coffee! THAT's what's missing right now! runs to brewer
2
 
Sorry, drifted off to read some UF. It's been forever since I read that strip. Used to read it religiously. Even went back and re-read the first couple of years that I'd missed so I could catch up on the story lines.
You'd think a guy named Mug would remember to brew a pot...
2
 
I did brew one... but then I got caught with some weird GitHub issue...
 
2:10 PM
don't know who would post weird issues to GitHub...
 
I love how it turned out being an actual code review ;-)
 
Actually, it was OT for CR. Belonged on SO...
 
lol
 
@Mat'sMug Actually, think I'll join you. wanders downstairs to the cafe to get a cup
 
I hope @Hosch250 doesn't mind the changes I made
it felt weird that you moved a parameter down and the selected grid row remained the first one
 
2:20 PM
9 flights down. Elevator up. I was being healthy.
 
uh-huh
 
I ran 3.5 miles on Sat. I can skip the walk up 9 flights...
 
@FreeMan I think I'd die if I ran that much
 
the first time I ran and barely made it 0.5 miles, I thought so, too.
I hate running, I find it quite boring, and I've always found it painful.
I discovered that some good glucosamine, quality running shoes, and some work on technique makes it not painful.
it's still boring as all get out... :/
Other than the shoes, it's a lot cheaper than getting back on the bike, and I can easily pack the running shoes, t-shirt & shorts for travel. Taking the bike with me is a much more involved process.
 
2:37 PM
[retailcoder/Rubberduck] retailcoder pushed commit 1d91f96c to next: added resource strings for RenameDialog and ReorderParametersDialog
[retailcoder/Rubberduck] retailcoder pushed commit d4bd62a9 to next: resized dialog to fit localized instructions on 2 lines
 
dang, I need to switch branch
Monkey Coding: when you change branches at every commit.
2
woah
 
@FreeMan 5k? or just because?
 
@FreeMan you need a +3 somewhere on SE
 
just because
@Mat'sMug ???
 
2:43 PM
5552+3=5555
 
I miss running. My knees can't take the impact anymore.
So, I bike now.
 
@Mat'sMug ah!
@RubberDuck You are a sick, sick man!
@Mat'sMug I just posted a question, y'all could go upvote it... :)
 
@ticker this sooooo belongs on SU
where?
lol
 
the How do I resolve... @ticker is mine
 
18 secs ago, by Mat's Mug
lol
 
2:45 PM
is that what you were referring to, @Mat'sMug
 
you're locking yourself up here eh
 
seems so, but it doesn't matter how fast or slow the code executes...
so
I
darn... not 5555 yet...
can
 
lag
you got my +5, now you need a downvote
shouldn't be too long, this is SO afterall
 
lol
true dat
 
.xltm is a macro-enabled template workbook.. I doubt it's that, but would running it against a .xlsm change anything?
 
2:50 PM
no. had the same issue when it was an xlsm
changed it to a template to protect it from accidental changes buy unwitting users.
 
ah
 
There's only 2 of us who should ever be in there editing the thing, but sometimes bosses like to poke around.
wonder what would happen if I flag it as RO at the OS level... let's find out!
 
that might actually help
 
not so much...
 
I don't know what to tell you man
best of luck!
 
2:55 PM
Yeah, it can't be network lag making Excel think the file's still open... I updated one chart with it marked as RO, went to SO to update my question to note that fact, commented on it here, went through the loop skipping a couple of non-linked objects, then got the warning on the next linked item.
Have I ever mentioned that sometimes I really dislike Microsoft?
 
> No repro here:

![image](https://cloud.githubusercontent.com/assets/5751684/7683381/bba1d24a-fd4c-11e4-93f4-f8b53690c4be.png)
 
@Mat'sMug Hey, hold on.
You don't have all those other classes with Foo in them.
 
[retailcoder/Rubberduck] retailcoder pushed commit ccb2bbb9 to GrammarIsFun: fixed NullReferenceException in GetClosestScopeDeclaration; closes #484
 
I have like 9 classes, and multiple of them have Foo's.
Also, I like what you did to the UI.
Checking it out now.
 
> Good news, this turned out being an easy fix!

This LINQ query assumed the all matching `Declaration` objects had a `Context`:

var currentScopeMatches = matches.Where(declaration =>
(declaration.Scope == _currentScope && !PropertyContexts.Contains(declaration.Context.Parent.Parent.GetType()))
|| ((declaration.Context != null && declaration.Context.Parent.Parent is VBAParser.PropertyGetStmtContext
&& _currentScopeType == D
 
@Hosch250 feel free to RT:
#ComingSoon: #Refactor #VBA methods by changing parameter order! (yes, it knows optional parameters must be last) http://t.co/4WqCq1fQxb
(20 impressions, 8 engagements so far)
 
3:35 PM
That Foo is still crashing RD.
 
I need a better repro ;)
 
I posted my doc on OneDrive.
I have 9 class modules, and a lot of them have Foo.
 
I'll post the content of each module individually.
 
nah, I had forgotten about the onedrive doc
downloading now
project compiles. RD should indeed resolve everything.
and StackOverflowException
 
3:40 PM
The user can no longer resize rows in the popup, but they still can't drag to reorder.
 
one step at a time ;)
I created resource strings for the UI in RubberduckUI.resx
 
OK.
I wasn't sure how to do that - I'll have to look at what you did.
 
I'm trying to get the smallest code to reproduce the issue...
I have this so far:
Public Sub foo(ByVal bar As Integer)

End Sub

Public Sub bar(ByVal foo As Integer)
    Me.foo foo
End Sub
no SOE, but already problematic
no references found for Sub foo
 
That crashes the reorder too, but it is illegal anyway, I think.
Did you compile it?
 
3:46 PM
and me.foo is picked up as a reference to the foo parameter
it does compile
 
Oh, OK. I think it is illegal if you define a foo, then.
 
the Me disambiguates the foo procedure call
 
OK.
Oh, I see.
 
we're talking about extreme edge cases here though
but the identifier resolution code should handle them
I think if I can resolve this foo I might fix the SOE
 
So, you fixed the problem with the highlight not changing, I see.
 
3:48 PM
yeah.. was quite a headscratcher!
 
@Mat'sMug I can't begin to fathom why someone would write code like that, but we are talking about VBA programmers here cough
 
@FreeMan IKR
 
We should fix it, and add a code inspection.
 
it's more about achieving correctness in identifier resolution, than supporting weird edge-cases ;)
2
I think Me might be throwing it off...
 
4:01 PM
@Duga got an update?
Whoops, that was just "comment out dead code"
 
[retailcoder/Rubberduck] Hosch250 pushed commit 8fd95c33 to next: Removed commented code
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**Hosch250**](https://github.com/Hosch250) pushed commit [**9fc034b2**](https://github.com/retailcoder/Rubberduck/commit/9fc034b2d235ada398f24bb03abf4778224510b3) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #508 from Hosch250/next

Removed commented code
 
hmm I don't understand.
Public Sub foo(ByVal bar As Integer)

End Sub

Public Sub bar(ByVal foo As Integer)
    Me.foo foo
End Sub
 
Me either.
 
right-click foo in the signature, find all references.
 
And, I found a bug in the reorder parameters.
 
4:03 PM
I break in EnterCertainIdentifier
and I see it add the correct reference to the correct declaration
 
@Mat'sMug Should we allow them to reorder optional parameters?
If there is a single instance in which the optional parameter is not provided, we will be unable to do it anyway.
 
@Hosch250 yes. as long as they're specified after all non-optional ones
 
That is how I currently do it, but look at this:
Public Sub Foo(ByVal Var1 As Integer, ByVal Var2 As String, ByVal Var3 As Byte, _
               Optional ByVal Var4 As Object, Optional ByVal Var5 As Date, _
               Optional ByVal Var6 As Long)
And this:
Foo Var1, _
    Var2, _
    Var3, _
    Var4
Foo Var1, Var2, _
    Var3, Var4, _
    Var5
So, now I move Var6 to the top of the optional set, and both of those are broken.
 
right.
you need to add a , in the call as a placeholder for the unspecified optional parameter
 
OK.
And that will break and make them fix it, or the code inspector will catch it.
 
4:07 PM
also I didn't check if you handled ParamArray values - ParamArray must be the last parameter, always
@Hosch250 huh?
 
The extra comma will break the code too.
But, we can't do anything at that point.
 
we should be able to handle it
 
OK, that should be easy to fix, and no, I do not handle that.
 
if you have Foo v1, v2, v3, v4, v5 [, v6] where v6 is unspecified/implicit, and then reorder to put v6 before v4, then the call should become:
 
Monking ducks
 
4:10 PM
Foo v1, v2, v3, , v4, v5
hi @Phrancis
 
Yep.
Doing that now.
 
RD is becoming smarter by the minute!
4
 
@Mat'sMug at what point do we admit it's Skynet?
2
 
when it starts telling you that your code doesn't compile as is ;-)
 
4:27 PM
fine!
 
5:03 PM
[retailcoder/Rubberduck] Hosch250 pushed commit 64f9764d to next: Successfully reorder optional parameters - with a twist
 
@Mat'sMug So, I have a quick question.
 
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**Hosch250**](https://github.com/Hosch250) pushed commit [**95ecbdeb**](https://github.com/retailcoder/Rubberduck/commit/95ecbdebfd28d76476227c637d91ae0c69cb6062) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #509 from Hosch250/next

Successfully reorder optional parameters - with a twist
 
Now, RD enters the placeholder for the parameter, but there may be a related problem.
If I try to re-reorder the parameters back, RD doesn't know the original order, so we have to manually edit the placeholders all out.
I did make it remove all current placeholders in the reorder, but there are still a couple.
Anyway, it is better than before, for now.
I think I'll do the drag/drop now.
Please let me know if you find any reorder problems in any calls, I had to rework it a little bit.
 
5:24 PM
0
A: Iterate over Methods defined in a Module

RubberDuckFirst off, this doesn't iterate over your classes, it iterates over all modules in your file. Dim Part As VBComponent For Each Part In Application.VBE.ActiveVBProject.VBComponents Debug.Print Part.Name Next Part If you want to iterate over just the class modules, you'll need to check the...

Yeah.. your question seems to be shifting under my feet as I type.... — RubberDuck 9 mins ago
> Finally, in order to create an instance of a class, it's going to necessarily be a global instance... which kind of smells, but whatever. You've not really given us your end goal. I have a feeling that your problem is better solved via some good OOP programming, but that's not the question you asked.
 
@Mat'sMug You were telling me something about reordering and interfaces the other day?
 
I'm ready for that now.
When you are, that is.
And actually, lunch time now, but after lunch.
 
5:44 PM
Beware, writing and executing code on the fly is a great way to crash the VBE... just so you know ;-) — Mat's Mug 12 secs ago
2
 
Ya know, the more I think about it, the more I think you have an XY problem. Why not create a new question that explicitly states what you're trying to achieve instead of how you're trying to achieve it? — RubberDuck 10 secs ago
 
He's totally doing something like reflection. Let him crash and learn!
 
Yeah... but what he needs is an interface. I just know.
 
@RubberDuck wtf... talk about overkill
 
8 mins ago, by Mat's Mug
He's totally doing something like reflection. Let him crash and learn!
 
6:03 PM
@Hosch250 if you have a class module (say IClass1) with a method like this:
Public Sub DoSomething(ByVal a As Integer, ByVal b As String)
End Sub
and then you have another class module (say Class1) with this in the declarations section:
Implements IClass1
then Class1 will need to implement IClass1_DoSomething in order to compile
Private Sub IClass1_DoSomething(ByVal a As Integer, ByVal b As String)
    'implementation here
End Sub
when you reorder parameters in IClass1.DoSomething, you need to verify if IClass1 is implemented anywhere
...and then you have to locate the implementation for the interface method that's being refactored, and reorder there too
otherwise Class1 will no longer implement the interface, and will no longer compile
also, you'll want to apply the refactoring when user right-clicks on the IClass1_DoSomething implementation method
and propagate to the actual interface
...and every single implementation of it
the rename refactoring prompts for user confirmation before doing that though
> Method '{0}' implements '{1}.{2}'. Rename the interface member?
in PromptIfTargetImplementsInterface
you could have something similar to ask Method '{0}' implements '{1}.{2}'. Reorder interface member parameters?
 
OK, great.
OK, so it is already halfway done.
It already prompts (wrong prompt value), but only reorders interface parameters
 
6:19 PM
it's a start :)
 
Yup. It's the finish that counts :)
 
IT WORKS!
seems a bit frail though
        private bool EnterIdentifier(ParserRuleContext context, Selection selection, bool isAssignmentTarget = false, bool hasExplicitLetStatement = false, DeclarationType accessorType = DeclarationType.PropertyGet)
        {
            var name = context.GetText();

            var matches = (name == Tokens.Me)
                ? _declarations[_qualifiedName.ComponentName].Where(IsInScope)
                : _declarations[name].Where(IsInScope);

            var parentCallStmt = context.Parent as VBAParser.ICS_B_MemberProcedureCallContext;
basically if the parent is an implicit in-block call statement and the context is the "leaf", then I'm removing other possible matches
ugh
Call Me.foo(foo)
^^ fails to resolve, it's an explicit in-block call statement
 
This could give you a few ideas — Mat's Mug 30 mins ago
That's just mean Mug... lol
 
Hmm, I found an instance where the drag/drop crashes RD.
Working on a fix.
 
@RubberDuck is it? mwahahaha
ugh
and this is why Regex rename is bad:
2
Public Sub Renamed(ByVal bar As Integer)

End Sub

Public Sub bar(ByVal foo As Integer)
    Call Me.Renamed(Renamed)
End Sub
^^ references are correctly resolved
 
6:35 PM
Crash fixed.
 
ok #PushingIt
Class1
Public Function Foo() As Class2
    Set Foo = New Class2
End Function
Class2
Public Sub Foo(ByVal bar As Integer)

End Sub

Public Sub bar(ByVal Foo As Integer)
    Dim bar As New Class1
    bar.Foo.Foo Foo
End Sub
1st Foo (i.e. bar.Foo) should resolve to a reference to Class1.Foo() but resolves to a reference to the Foo parameter.
I don't want to see what Regex rename does here
 
@Mat'sMug shouldn't you be working or something? =)
 
huh?
replacing the regex rename by a TokenStreamRewriter call?
 
I meant your dayjob. lol
 
off today
 
6:44 PM
Ahhhhh.
 
Journée Nationale des Patriotes
 
Something National of the Patriots?
 
Rest Of Canada calls it "Victoria Day"
but here it's National Patriots' Day, and screw the Queen
3
 
Something to do with WWII?
 
1837-1838 rebellion
 
6:46 PM
Our memorial day is coming up.
Oh!
 
they all got hung by the English
there's a church in the city I live in, that still bears the canon ball holes from that rebellion
lots of patriots burried here, too
 
I'm with you. To hell with the crown.
Was just talking with my wife about Britain's silly obsession with the royal family.
They've had no real power in decades, yet they live fat on the comman man's tax dollars.
 
+1 for screw the Queen
2
 
lol
 
Of course, you're talking to an 'Merican...
 
6:50 PM
'Murca!
 
fought for their freedom... and earned it.
we fought for our freedom... and got hung.
 
Unfortunately,
 
Quebec's doomed
 
Same for the Scots, and look at them now.
 
We're not free by a long shot around here. We replaced colonial monarchy with an aristocracy...
 
6:51 PM
If only the US wasn't busy preparing for civil war itself, I bet we would have helped you.
 
Our forefathers would be ashamed of us.
@Hosch250 We would have lost if the French hadn't helped us.
 
I know.
And if we had helped them, they would have won.
 
no one knows
 
That ^
We were too busy preserving the Union instead of our Freedom anyway.
 
Our commanders were experienced in battle from the Mexican war, we could bring troops without having to cross the Atlantic...
Well, I'm merging a commit to fix the drag/drop bug.
 
6:54 PM
[retailcoder/Rubberduck] Hosch250 pushed commit 4c8350a3 to next: Fix drag/drop bug
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**Hosch250**](https://github.com/Hosch250) pushed commit [**c521e8db**](https://github.com/retailcoder/Rubberduck/commit/c521e8db319650d5f0cc0e01f1c32396cbd08e3b) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #511 from Hosch250/next

Fix drag/drop bug
 
@RubberDuck yeah, and your deserters (the loyalists) came north and made Upper Canada and they were like over-enthusiastic with the crown thing, and ended up taking over the whole north-of-the-border
 
I apologize for my country's cowards good sir.
 
lol
 

« first day (346 days earlier)      last day (2834 days later) »