« first day (1268 days earlier)      last day (1912 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 1 opened issue. 16 issue comments.
[rubberduck-vba/Rubberduck] build for commit 022c3774 on unknown branch: AppVeyor build succeeded
> Should be fixed as of 68a3d500
> Should be fixed as of 68a3d500
> On the module level, we could think about adding two instability metrics:

1. Let `No` be the number of module-to-module references from the module to other modules and `Ni` be the number of those from other modules to the module. The metric would be `No/(Ni+No)`.

2. Let `Fo` be the number of members of the module depending on members of another module and `Fi` the number of members of other modules depending on members of the module. The metric would be `Fo/(Fo+Fi)`.
 
 
1 hour later…
1:58 AM
hm ... interesting ...
Trusting a document when the parser already ran nukes the host app
enabling features "for only this session" before the parser ran makes rubberduck reparse
and subsequently fail to clean-exit
enabling features "for only this session" after parser ran also makes RD reparse and susequently crashes with an AccessViolation
alternatively it bricks the parser into always blowing up when trying to read the protection of the document and exits cleanly ...
 
2:21 AM
@Vogel612 wtf
 
2:45 AM
it's not necessarily related to protection itself. I'll try to get a more detailed repro tomorrow
@Mat'sMug could you look at the libgit2sharp PR? Also drop me a note if you want to go for a green release this weekend.
I'd strongly recommend for it, just to get into releasing more regularly again
master is 145 commits behind :)
aaand it's 4 AM again ... Toodles!
 
Night!
 
 
1 hour later…
 
7 hours later…
10:58 AM
> Code like this:

```vb
Sub ComboBox1_Change()
Application.ScreenUpdating = False
Select Case Me.Range("code_plant")
Case 1
Me.Range("price_zero").Copy _
Destination:=Me.Range("price_on_view")
End Select
Application.ScreenUpdating = True
End Sub
```

Can have the Select Case simplified to an If Then statement:

```vb
Sub ComboBox1_Change()
Application.ScreenUpdating = False
If Me.Range("code_plant") = 1 Then
 
 
1 hour later…
 
2 hours later…
2:51 PM
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit d7fc5efe to next
Updated LibGit2Sharp to version v0.24.0
API changed:
-> repository.commit() now mandates 'author' and 'commiter' as two distinct parameters. I pass into both the same value by default.
-> repository.Stage() passes to the static class 'Commands' taking the repo as a first parameters.
-> repository.Pull() undergoes the same change
-> repository.Checkout() also
-> repository.Remove() also

-> repository.Fetch() takes the biggest changes.
-It now requires by default a refSpec. As we will usual
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit f651a9ed to next: Removed comments, clarify changes. Working out libgit2sharp v0.24
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit 11d2e7e8 to next: libgit2shar v0.24 integrated
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit 4e5cd9dc to next: Merge branch 'next' into libgit2sharp24
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit 4b9f3fcb to next: Parameter names given on the .Commit() commands
Merge pull request #3559 from NelsonVides/libgit2sharp24

Updated LibGit2Sharp to version v0.24.0 fixes #2497
> Thank you very much 👍
 
Thanks a lot @Vogel612! :D
 
lolwat Duga?
 
@Duga CC @SimonForsberg is this [status-by-design]?
 
2:54 PM
[rubberduck-vba/Rubberduck] build for commit f3982409 on next: AppVeyor build succeeded
 
Hey, I'm continuing my journey through VS code analysis
there's an extension of IEnumerable called GroupByMissing that seems a bit redundant to me
` public static IEnumerable<U> GroupByMissing<T, U>(this IEnumerable<T> inputs, Func<T, T> getIncr, Func<T, T, U> selector, Func<T, T, int> comparisonFunc)
{

var initialized = false;
T first = default(T);
T last = default(T);
T next = default(T);
Tuple<T, T> tuple = null;

foreach (var input in inputs)
{
if (!initialized)
{
first = input;
last = input;
initialized = true;
continue;
}
if (comparisonFunc(last, input) < 0)
{
throw new ArgumentException(string.Format("Values are not monotonically increasing. {0} should be less than {1}", last, input));
damn, I forgot how to inline multi-line code on this chat, sorry xD
 
you can't...
chat doesn't support inline multiline code.
 
this is: initialized gets assigned false by default, and then when we enter the loop, the first thing we do is initialise first and last and change initialized to true
and we never change this value again
isn't it a bit redundant? Could we just assign first and last from the beginning and skip this if?
also, VS hint was a different thing, it's telling us next and tuple where never used in this method :/
 
which file is this in, I think I'll need more context...
 
Rubberduck/Refactorings/ExtractMethod/ExtractMethodModel.cs
 
It doesn't seem like a big deal anyway, but it took me a while on SO to discover that you can extend classes this way on C#, so I'm a bit unsure
 
hmm ... the code seems a bit hard to follow.
but generally speaking the initialization is intended to create a consistent state
also since the enumerator always compares two elements, you need the first iteration to assign the elements to compare to.
 
hmmm... I think I'm getting it...
ok, now I get it! More C# syntactic sugar for me :)
 
I think I now understand what the code does...
it's pretty well-named, but the selector makes things a little bit confusing ....
because that's already a "downstream" operation
Usually a GroupBy should return an IGrouping<T> instead of a U
 
3:40 PM
@NelsonVides FWIW, I'm still in middle of refactoring. There are many things about Extract Method which sums up to being overcomplicated. I don't know how much I will keep after the refactoring.
 
@this I touched that Extension method in my latest PR. Drop me a note if you want the commit removed
 
[rubberduck-vba/Rubberduck] build for commit 002efc86 on unknown branch: AppVeyor build succeeded
 
Do agree it should have been its own file but I don't know yet whether I will still want that or not..... This is the only use of the extension method....
        public IEnumerable<Selection> splitSelection(Selection selection, IEnumerable<Declaration> declarations)
        {
            var tupleList = new List<Tuple<int, int>>();
            var declarationRows = declarations
                .Where(decl =>
                    selection.StartLine <= decl.Selection.StartLine &&
                    decl.Selection.StartLine <= selection.EndLine)
                .Select(decl => decl.Selection.StartLine)
                .OrderBy(x => x)
                .ToList();
and judging from that method, it's very liable to get chucked out
because it's not using rewriter API
 
true. I don't care either way, I'd just rewrite history and drop the commit from my PR
 
I think that'll be best, yes. I will definitely refactor the extension if I do end up needing it after all. I did not like it being in the same file
 
4:03 PM
@Vogel612 @NelsonVides No connected Github account with the e-mail of that commit, so yes.
I'd recommend @NelsonVides to change his git config --global user.email to match his github e-mail address
 
@SimonForsberg could it be updated to report there was no email? (e.g. retailcoder (unknown email), perhaps?
 
@this @Duga is on github, make a PR. Otherwise it won't happen.
 
@SimonForsberg, what do you mean with the commit?
 
@NelsonVides What commit?
 
The email you just mentioned
Where did it popped up?
 
4:08 PM
1 hour ago, by Duga
[rubberduck-vba/Rubberduck] Unrecognized author pushed commit f651a9ed to next: Removed comments, clarify changes. Working out libgit2sharp v0.24
 
Oh, that thing
Let me change that
 
your ibm email is not registered to your github account
 
@NelsonVides You made a commit to the Rubberduck repository, github.com/rubberduck-vba/Rubberduck/commit/… , but when you did that commit the git config for your user.email does not match your Github account email, so github doesn't know what github user did this commit
 
yeah, this laptop is my job's laptop
turns out it's better than mine so I'm basically using it for my own stuff as well
Also, I don't have excel on my private laptop so I'd need this one anyway
 
4:33 PM
> Currently the abstract class only requires IVBE, but from what I see, almost all, if not all, derived classes require the use of RubberParserState class, leading to duplicated code in all derived classes. That should be refactored into their abstract base class to cut down on the construction noise.
 
5:03 PM
hmm not sure what's up with that....
2017-11-25 11:03:28.9009;ERROR-2.1.6538.19865;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run. (thread 7).;System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
   at Microsoft.Vbe.Interop.VBE.get_Version()
   at Rubberduck.VBEditor.SafeComWrappers.VBA.VBE.get_Version() in C:\GitHub\Rubberduck\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBE.cs:line 26
This error is transient - next time I try, the parse will succeed. We should not be giving up on a RPC_E_SERVERFAULT, AFAIK.
@M.Doerner I had to update the installers to handle new objects. Do you see any concerns with how I set it up below?
        private static void RegisterRefactoringDialogs(IWindsorContainer container)
        {
            container.Register(Component.For<IRefactoringDialog<RenameViewModel>>()
                .ImplementedBy<RenameDialog>()
                .LifestyleTransient());

            container.Register(Component.For<ExtractMethodRefactoring>()
                .ImplementedBy<ExtractMethodRefactoring>()
                .LifestyleTransient());

            container.Register(Component.For<IRefactoringFactory<ExtractMethodRefactoring>>()
 
5:33 PM
I now feel the pain of making too many changes without running unit tests after each change...
 
5:47 PM
be happy you get to do unit tests. I can't even now i'm playing with a dialog. :(
 
I made changes for the C#6/7 and somewhere in the Rubberduck folder something broke. I don't know what it was #LessonLearned.
Playing around with creating a new repo and seeing if Merge or Rebase will help me identify it.
 
nope. neither will help there
get the failing test and examine which codepaths it passes
you can also try to bisect stuff...
 
They are RemoveParametersRefactoring_LastInterfaceParamRemoved and 3 others. It's the expectedCode2 that's breaking.
Did anyone get good stuff on FistFightFriday?
 
6:02 PM
@Vogel612 PR looked good, thanks for merging - I hadn't, because IIUC there was one little requested change I agreed with (@this' comment)
 
ya, that one was fixed :)
 
That said shouldn't the prerelease have gone under your name?
 
opinions on MDoerners suggestions for the Code Metrics?
no, those will always go under your name, because AV logs in as you
 
Ah, makes sense
 
question: are we resolving standalone member invocations?
I'm trying to put a dent into this issue, but it seems a prerequisite is missing
I got a failing test, but the fix seems to involve the resolver being a bit "nasty" by just not resolving the invocation that's supposed to be marked
Then again I may just not know where the resolution should take place. ...
Related: Is it just me or is Rubberduck.Parsing/VBA really too large?
 
6:08 PM
@Vogel612 / @Mat'sMug reading that issue, I'm a bit surprised it's reported to fail. Using generic class should not by itself cause runtime error. It's legal to use generic Access.Form and be able to reference members that only exists on Form_xxx using the dot operator. Is that not so with Userforms?
 
IIUC the invocation should be foo.UserForm1_FooBar()
 
(though it should definitely probably bring up an inspection to warn that the member doesn't exist on the interface being used)
.... really?
not how it is done in Access. :(
 
then again I got no clue, so there's that
 
and there's also the case of the ADODB.Command
 
don't listen to me, the last time I seriously touched VBA was four (or maybe five) years ago
 
6:10 PM
@Vogel612 it's C#7 sugar nothing more... I think I agree with Max though; guard clauses do remove a number of ?'s and make things overall easier to follow.. No?
 
e.g. MyCommand.uspMyStoredProcedure "foo", 123 is legal, too but can't be validated, either.
 
@Mat'sMug not the suggestion I wanted to talk about :)
But sure, I'll revert that one
 
going to put in comments, just so it's clear what inspection should be scoped for.
 
> Closing as stale no-repro
> Personally, I'm a bit surprised that the sample syntax for UserForm would cause runtime errors. That is not the same behavior with the Access form.

Dim MyForm As Access.Form
Set MyForm = New Form_MyForm
MyForm.FooBar = "foo"

The `FooBar` member won't show on intellisense because variable is typed as a `Access.Form`, not `Form_MyForm` but it is still legal, as long the `FooBar` in fact exists.

We have similar situation with `ADODB.Command` where syntax such as `MyCommand.My
 
6:36 PM
> Also a bit like the Application.Sum function in Excel.

IIRC, COM marks the interface as `extensible` , and RD picks that attribute up, so we should already know that the member is potentially valid.
 
umm ... @ThunderFrame the code you gave in the example does not resolve UserForm to a Declaration...
which is why my fix currently doesn't work ...
additionally the property access doesn't add a reference to the declaration
 
7:22 PM
hmm.... why are contexts with the samy SourceInterval considered different?
 
@Vogel612 Where does it not resolve UserForm to a declaration, in a unit test or in the VBE with the correct references loaded?
 
UnitTest.
also maybe I didn't correctly interpret the tree of Contexts and AsTypeContexts and AsTypeDeclarations...
 
If I understand it correctly, the UserForm class should be in the corresponding type library.
So, you would have to load that to make it be recognized as a declaration.
 
hmm ... that shouldn't even be necessary for the unit-test to correctly diagnose the issue.
I currently have a problem with Equality of ParserRule Contexts...
ANTLR seems to not generate Equals (or operator ==) anywhere
nor are they overwritten two steps up in the hierarchy ....
 
The reference resolver contains the type name resolver, which tries to resolve the type based on the AsTypeName, IIRC. Whenever it does not succeed, the AsTypeDeclaration should remain null.
 
7:29 PM
it is...
 
Well, the inspection should not complain about members not being on an interface of which it does not even know what it is.
 
and it doesn't... that's quite possibly the issue. ..
now I only need to resolve UserForm by adding the typelib to the test ....
 
Hm, we need a way to inject custom declaration loaders into the mock parser.
Then we could use them to fake library classes.
Actually, that should not be too hard to achieve.
 
where is UserForm in the Library? Or do I need a specific HostApp?
hrngh ... apparently I'm just unable to write a simple failing test...
 
7:52 PM
FM20.dll IIRC
 
if it's MS Forms, yes.
interestingly I can't find the DLL in the place that Reference-Explorer points me to (namely `C:\Windows\SYSWOW64`)
good.... now to verify the changes and only commit what's really necessary...
 
8:11 PM
@Vogel612 keep in mind that if the unit tester can run as a 64-bit process, you need it in C:\Systems\Windows32\FM20.dll.
seem to recall it's currently Any CPU - if that's the case, it might be necessary to support switching between loading the 32-bit and 64-bit FM20.DLL
 
it's probably there, then ...
 
8:25 PM
[rubberduck-vba/Rubberduck] build for commit f9f0c2a7 on unknown branch: AppVeyor build succeeded
> The following code generates *Object variable reference is auto-instantiated* inspections for `fizz` and `buzz` but not for `foo` and `bar`

```vb
Option Explicit

Private foo(10) As New Class2
Private bar As New Class2

Sub test()

Dim fizz(10) As New Class2
Dim buzz As New Class2

Debug.Print foo(1) Is Nothing, bar Is Nothing, fizz(1) Is Nothing, buzz Is Nothing

Set foo(1) = Nothing
Set bar = Nothing
Set fizz(1) = Nothing
Set buzz = Nothing

Debug.Pri
 
hmm, the Move module-level variable to smaller scope inspection might not be appropriate in situations where the variable is assigned a WithEvents reference (and thereby only referenced in a single procedure, where you'd want the reference to survive the procedure terminating.
I * think* RD should be able to determine that kind of assignment? The inspection could be made more robust?
 
9:00 PM
the inspection may exclude arrays explicitly
 
[rubberduck-vba/Rubberduck] build for commit ef11a057 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit de596b4f on unknown branch: AppVeyor build succeeded
 
9:17 PM
@this - I found a nice VB6 form that's proving challenging - github.com/VBGAMER45/Semi-VB-Decompiler/blob/…
 
[rubberduck-vba/Rubberduck] build for commit 44dfb16a on unknown branch: AppVeyor build succeeded
 
@Vogel612 in #3568? No, it picks up object and array at procedure level, but neither object nor array at module level.
 
well either way, I'm finished for today
 
[rubberduck-vba/Rubberduck] build for commit fcf9d424 on unknown branch: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 7aac0868 on unknown branch: AppVeyor build succeeded
> That's by design actually; the inspection explicitly only looks at procedure-scope variables. Arguably the issue is the same at module-scope, but it was thought that a module-level variable declared `As New` pretty much implied that it means to live as long as the class it's declared in.

I guess it wouldn't hurt to enhance the inspection to also look at module scope... The meta/descriptions need to be updated too.
 
10:07 PM
@Mat'sMug Is it a known issue that there isn't a quickfix for member Implicitly references activesheet?
 
Uh.. IIRC it would put an explicit one.. No?
 
> In a worksheet module, the use of `Range` is not implicitly referencing the ActiveSheet, it is referring to the sheet module within which it is used.

This is valid code, but the inspection fires nonetheless (although there doesn't seem to be a quickfix available, so I haven't tested what happens if a fix is applied):

```vb
Sub ComboBox1_Change()
Range("price_zero").Copy Destination:=Range("price_on_view")
End Sub
```

Even so, my preference would be to be more explicit, by usin
 
@Mat'sMug The Fix dropdown only shows "Ignore Once"
see #3569 - mybe it's because it's used in a worksheet module? I'll check if the fix is available in a standard module
nope, no fix in a standard module either
 
> Quickfix unavailable:

![quick](https://user-images.githubusercontent.com/16574009/33235322-23fb2eb2-d28a-11e7-8602-6143e2553a04.png)
> Maybe split it into 2 inspections? The descriptions could vary by module/procedure scope, with differing levels of severity and caution/advice to the user? Likewise, the inspections could then be disabled per scope.
 
10:26 PM
@Duga @ThunderFrame Currently, we cannot really determine whether a document module is a worksheet.
 
gosh, I forgot we hadn't cracked that nut
 
11:02 PM
Hours of searching. Inadvertantly changed _ to a <space>... I so ducking smart of me...
 
ahh, Control Arrays in VB6, why do you taunt me so? Multiple controls with the same freakin' name
 
Hi folks
Any thoughts why my settings is like this?
Can't change Error Trapping. :-/
Just reinstalled Office and still this problem.
 
have you tried deleting the registry key ( with extreme caution)?
@M.Doerner When parsing/resolving ThisWorkbook, does RD know what Workbook is, in the context of an event procedure like Private Sub Workbook_Open()?
 
11:18 PM
@SonGokussj4 wah... that's... borked.. you'll have to set the settings through the backdoor, directly in the registry
@ThunderFrame not if it doesn't know that the ThisWorkbook document is a Workbook class, I'd think
 
@Mat'sMug Kind of weird... Well, I'll be reinstalling Windows in a week so hope this won't be a case then.
Anyway, I found out that in: HKEY_CURRENT_USER\Software\Microsoft\VBA\7.1\Common\BreakOnAllErrors set as "2" and it works. So thanks!
 
11:44 PM
> Except we can't ignore document modules... Range in a Workbook module is still a reference to ActiveSheet.
 
@Mat'sMug reminds me of your use of Show in a UserForm - I prefer to use Me.Show to explicitly remind myself where Show is declared.
 
Hey @Mat'sMug what do you think of Merging Code Metrics, finishing up the translations and releasing tomorrow?
~keeps prodding mug about release
2
 

« first day (1268 days earlier)      last day (1912 days later) »