« first day (1602 days earlier)      last day (1578 days later) » 

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 2 closed issues. 5 issue comments.
[rubberduck-vba/RubberduckWeb] 1 opened issue. 13 issue comments.
 
12:23 AM
[rubberduck-vba/Rubberduck] build for commit bcc8bed5 on unknown branch: AppVeyor was unable to build non-mergeable pull request
BUILD FAILURE!
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4427?src=pr&el=h1) Report
> Merging [#4427](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4427?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f44d56561b2784dea3303afbe0a3862a9cb1eeb9?src=pr&el=desc) will **decrease** coverage by `0.12%`.
> The diff coverage is `76.92%`.


```diff
@@ Coverage Diff @@
## next #4427 +/- ##
=======================
 
just as a sanity check - why are we taking the VBComponent.Properties("Name") when we could be just doing VBComponent.Name ? IINM, they are always the same.
 
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4427?src=pr&el=h1) Report
> Merging [#4427](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4427?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f44d56561b2784dea3303afbe0a3862a9cb1eeb9?src=pr&el=desc) will **decrease** coverage by `0.12%`.
> The diff coverage is `76.92%`.


```diff
@@ Coverage Diff @@
## next #4427 +/- ##
=======================
 
12:46 AM
Got that up-to-date.
VS seems to be working OK.
 
[rubberduck-vba/Rubberduck] build for commit 4eb05431 on unknown branch: AppVeyor build succeeded
 
1:20 AM
> Shouldn't any code that triggers inspection when there's an assignment also trigger an AssignmentNotUsedInspection result? Given the new inspection, I'd propose not even reporting the result for the VariableNotUsedInspection. Technically it is "used', just in a way that would cause another inspection result.
 
2:18 AM
huh, I did nothing... and now it builds
 
Elves came during the night.
 
must be it
 
Question re #4329.
 
Is there any other situation you can think of that would create a transient reference in a Set statement other than in an argument list?
 
2:21 AM
got a repro?
 
I got a fix, pending figuring out if there are any other cases.
The problem is that it handles Set explicitly:
Sub Test()
    Dim ws As Worksheet
    Set ws = Worksheets.Add(Worksheets("Sheet1"))
    Debug.Print ws.Name
End Sub
So... it finds the transient reference in the .Add call and just assumes that it's all the ws reference.
I was trying to think of any situation where it could be on the RHS of a set without being transient.
Or an argument, for that matter.
 
it's not so much being RHS, it's more.. being an argument in some expression on the RHS
 
Right. I phrased that wrong.
I also found an uglier bug there BTW...
Sub Test()
    Set ws = Worksheets(""Sheet1"")
    Debug.Print ws.Name
End Sub
Implicit variable assignment throws an InvalidCastException.
 
in some expression period, actually.. no? what of If Not Worksheets.Add(Worksheets("Sheet1")) Is Nothing Then?
 
That might work. I'll add a test for that too.
 
2:30 AM
wait no, that would flag legit uses
 
Oh yeah. There's the return value not assigned case too.
Sub Test()
    Worksheets(""Sheet1"")
End Sub
 
Worksheets (""Sheet1"")
#prettified ;-)
 
Does the indexer get prettified?
Yes, yes it does.
That one doesn't compile though - invalid use of property.
Sub foo()
    If Not Worksheets.Add(Worksheets("Sheet1")) Is Nothing Then
        Debug.Print "Added"
    End If
End Sub
^ Works.
Sub foo()
    If Not Worksheets.Add(Sheet1) Is Nothing Then
        Debug.Print "Added"
    End If
End Sub
 
2:46 AM
we could have a language opportunity inspection/quickfix that flags string-parameterized default member calls and offers a quickfix to convert to bang! notation. then we could pretend to be unbiased when we balance it with one that flags bang notation uses and offers a quickfix to reveal implicit member calls.
 
I follow the second inspection but not first inspection.
TBH, were I a naive user mindlessly following recommendation to change stringifed access to a bang notation only to get a new inspection result, I might feel a bit annoyed.
 
we already have a number of mutually exclusive inspections though
 
Bang notation is demonstratively worse than the string-parameterized default member calls.
Oh wait. I meant "subjectively worse"...
 
Sub Foo()
    Dim bar As New Scripting.Dictionary
    bar.Add "Foo", "Bar"
    Debug.Print bar!Foo
End Sub
^ Pure evil.
 
2:54 AM
aren't the Access folks the most fervent bang notationers though?
 
IDK if they are but I dislike them and would rather cure them of the ills.
I know for fact that several Access books/blogs/help/whatever propagate the old myth that "dot is for member access, bang is for collection access"
 
Pure unadulterated evil:
Sub Foo()
    Debug.Print Sheets!Sheet1.CodeName
End Sub
 
WTF
 
^ That should be in the SheetAccessedUsingStringInspection, BTW...
 
just be making my case -- bang must die.
3
 
2:57 AM
You can use it on anything with a default property with a single argument indexer.
Multi-bang:
Sub Foo()
    Dim bar As New Scripting.Dictionary
    bar.Add "Foo", New Scripting.Dictionary
    Debug.Print bar!Foo!Baz
End Sub
 
you're doing it wrong. The ducky should be doing this instead with bang-bang sound effect:
 
Sub Foo()
    Dim bar As New Scripting.Dictionary
    bar.Add "Foo", New Scripting.Dictionary
    Set bar!Foo!Baz = New Scripting.Dictionary
    bar!Foo!Baz!Absurd = "STOP IT!"
    Debug.Print bar!Foo!Baz!Absurd
End Sub
Well, crap. Just found another issue.
I closed the VBE during the initial parse, then tried to close Excel. It's stuck in a non-responsive state now.
 
> Bond Manager. James Task Bond Manager.
2
 
lol
 
3:12 AM
Not much of James Bond, is it?
 
well, it's licensed to kill
 
It logged absolutely nothing of value what-so-ever.
 
I might need to try to get a debugger on that.
...and I can't repro it.
 
3:16 AM
typically when that happens, it's an exception from non-.NET stuff
 
WER says...
Faulting application name: EXCEL.EXE, version: 15.0.5075.1000, time stamp: 0x5b9ab6b9
Faulting module name: combase.dll, version: 10.0.17134.112, time stamp: 0xfad18dc5
Exception code: 0xc0000005
Fault offset: 0x00000000000ba510
Faulting process id: 0x1d28
Faulting application start time: 0x01d46c10f60c230a
Faulting application path: C:\Program Files\Microsoft Office\Office15\EXCEL.EXE
Faulting module path: C:\WINDOWS\System32\combase.dll
Report Id: 6e776181-2e22-4924-96eb-5b010014e429
Faulting package full name:
...not my problem.
 
we might have caused it though
 
Yeah, I've tried about 5 more times, still no repro though.
 
what problem?
(Terminator's voice) no repro, no problemo
I'm finding bugs that I thought were covered by the tests in SCP
 
3:35 AM
[rubberduck-vba/Rubberduck] build for commit 0f2351ef on unknown branch: AppVeyor build succeeded
 
@Duga nice diff!
 
Hmmm... so on the RemoveUnassignedVariableUsageQuickFix, if the result is held by a With block, should we remove the whole mess?
Sub test()
    Dim wb As Workbook
    With wb
      Debug.Print .Name
      '... N lines later...
      Debug.Print .Sheets.Count
    End With
End Sub
... fixes to this?
Sub test()
    Dim wb As Workbook
End Sub
 
hmm seems radical... comment-out? ...with a comment?
 
That's not a bad idea.
 
could use a "todo" marker
 
3:44 AM
Block commenting with the re-writer might be a bit challenging.
 
we need a "built-in" / "default" todo marker that can't be deleted
 
^ that.
I think TODO would be a good candidate.
 
QUACK too :)
 
Easter egg!
 
3:46 AM
'QUACK! this code was using an unassigned object reference. Fix & uncomment, or delete.
'{...code...}
so we use TODO
...and hide QUACK!
and display them with the ducky icon in the todo explorer
 
Localized? KVAK!
 
could even use hidden settings to "unlock" the feature
@Comintern why not!
 
I think to unlock features, you should need to pass some challenge, like a 10 module project with no inspection results.
 
"Congratulations - you're a Rubberduck master! Unlocked new refactoring...Extract Method."
 
3:52 AM
and the hidden marker would be discoverable by attempting to create a new QUACK! marker
@Comintern LOL
or by being accidentally captured in live comments, that could be "interesting" to log
' what the quack!
 
LOL
Unit testing would be a great gamification target.
 
"Achievement earned: 100% coverage."
 
4:14 AM
[rubberduck-vba/Rubberduck] build for commit 80dadd4c on unknown branch: AppVeyor build succeeded
 
I want a c# feature combining string interpolation and verbatim strings.
var foo = @$"
{{something}}
text";
 
uh you can
 
it is already possible. I'm sure some of my PR does that in fact.
(but order matters. If not @$ then $@)
(can't remember which is legal)
 
VS should be able to just autocorrect that
 
4:17 AM
Huh. VS doesn't seem to like either of them.
 
hm.
 
Does it handle carriage returns?
Oh, duh. I'm an idiot - you can't use string interpolation on a const.
 
be a wee bit difficult to compile runtime results into the DLL...
need a time-traveling compiler for that.
 
Yeah... $@"{facepalm}";
 
achieved a clean exit.... but I'm not 100% happy with the changes. May need some more thunking.
2
100+ unit tests are borked. :\
 
4:29 AM
Sometimes the cure is worse than the disease...
 
IKR?
 
Application.Exit();
 
the CE stuff is being directly newed up in the unit tests, so my adding new stuff to the ctor => ZOMG
 
@this nice!!
 
one small solace - I got rid of all obsolete Run off the IHostApplication implementations
 
4:32 AM
@this That sounds more like a unit test issue than an issue with the fix.
 
yes but still annoying
 
Are those UI tests?
IIR there were some questionable tests of the VMs.
 
seems to be mainly for code explorer
CodeExplorerTests
e.g. this is now broken:
var vm = new CodeExplorerViewModel(new FolderHelper(state), state, removeCommand, _generalSettingsProvider.Object, _windowSettingsProvider.Object, uiDispatcher.Object, vbe.Object);
(holy construction, batman!!!)
 
Wow, R# does not like CodeExplorerTests.cs one bit.
 
Hey @Comintern, congrats on the vba mjölnir! Didn't realize you'd hit that goal. — Jeeped 4 mins ago
 
4:50 AM
@Jeeped Thanks! It would have been quicker, but I had a bit of a hiatus last year due to work stuff. — Comintern 40 secs ago
^ OP is now fuming.
 
lol
@Duga if this builds, I'm ok with merging as-is
runs tests locally
 
Grrrr.... Close Excel then run all tests.
 
MsgBox "|       "
{backspace}
MsgBox|
hmm but if the string isn't empty... I still delete the matching quotes...
meh
 
Removing the enclosed whitespace?
 
4:54 AM
removes the matching pair of quotes
oh
maybe
 
So... MsgBox "|Foo" -> MsgBox |Foo`?
 
think so
 
Meh. I'm good with that.
I mean, WTH are you backspacing there anyway?
 
^
useful if you have a variable named Foo I guess
 
4:56 AM
oh, a SCP test will fail
and I know why
 
Q: Why does my MsgBox show me Foo instead of what's in my Foo variable?
A: Hit {backspace}.
 
> Closes #3905 This introduces IHostDocument interface and GetDocument/GetDocuments to provide additional metadata about document modules from host application directly rather than via VBIDE API. This resolves a problem with using the VBComponent.Properties which has been shown to be fragile when the document is not in design time. Accessing those cause runtime error and though there is a try and appropriate usings to swallow the exceptions and dispose of the wrappers object, it...
will cause a ghost process with Access and possibly other hosts where document modules may have a runtime and design-time state. However, what I'm not happy with is the promiscuous COM slinging because there are no SCW wrappers defined for host-specific interfaces. Even if we did want to define one, it does not make much sense as that needs to be generic for all host documents as possible. Therefore, I welcome any ideas or feedback on making it less..... toxic. Oh, BTW, unit tests are borked...
because of new parameter in the constructors. That will need to be fixed.
 
> Expected: <foo = MsgBox((|))>
But was: <foo = MsgBox()|>
forgot to check for pair.IsSymetric somewhere :)
(that's meant to the behavior given the closing char for input)
 
we're approaching 4.1K tests
 
5:03 AM
More inbound.
 
[rubberduck-vba/Rubberduck] build for commit b6981ebd on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
@Duga that one should pass
 
[rubberduck-vba/Rubberduck] build for commit 32597d07 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
Ugh. Note to self: make sure the QMN is actually being used before trying to fix it's resolution...
:probably broke a bunch of stuff not under test...:
 
5:14 AM
@Duga @this that one's yours :)
on an old deleted question about the bang operator
 
@MathieuGuindon Yeah. I did note in the comments that the tests are broken.
 
thought it was mine when it popped
..it's 14 minutes in, and I have another one queued :(
cancelled
 
[rubberduck-vba/Rubberduck] build for commit a1a347f2 on unknown branch: AppVeyor build cancelled
BUILD FAILURE!
 
Would be nice if it had the PR # referenced in the build message. #LifeIsABowlOfCherries
 
ah crap
forgot a resource key
 
posted on October 25, 2018 by Rubberduck VBA

Clean code adheres to a number of principles. Does adhering to these principles make good code? Maybe, maybe not. But it definitely helps. One thing I find myself repeating quite a lot in my more recent Stack Overflow answers, is that code should “say what it does, and do what it says” – to me… Continue reading Clean VBA Code pt.2: Avoiding implicit code →

 
 
2 hours later…
8:36 AM
-1
Q: Read excel cell, search in txt file, write in excel cell

DariusSo, for the beginning, I have an excel file with 1 row and multiple columns. I need to read one column where is a text. Then I have to search for that text in a .txt file. On the line where I found the text I need to keep searching for "MIN/MAX:". The line looks like these: "UInt32 StEaAktivK...

 
 
2 hours later…
10:09 AM
[rubberduck-vba/Rubberduck] bclothier project card. Enough said.
> Reminder to myself to see if #4273 is in-scope for the PR as it likely needs the document state.
 
10:41 AM
> Closing this issue since this still cannot be reproduced and nobody else has reported any problems since.
[rubberduck-vba/Rubberduck] bclothier is playing around with a project card
[rubberduck-vba/Rubberduck] bclothier did something with some project card
> Closing this because this has been long ago fixed in build 2.2 where we changed the way we run tests so this is no longer an issue.
[rubberduck-vba/Rubberduck] bclothier did something with some project card
[rubberduck-vba/Rubberduck] bclothier is playing around with a project card
> The PR #4458 would make them needful again due to the need to know about document state via the host's OM. Thus, closing this.
[rubberduck-vba/Rubberduck] bclothier is checking what fun stuff @Duga can say about project cards
 
11:35 AM
totally not iffy at all:
public void Navigate(IVBE vbe)
{
    var selection = new Selection(Exception.LineNumber, Exception.Position, Exception.LineNumber, Exception.Position + Exception.OffendingSymbol.Text.Length - 1);
    using (var projects = vbe.VBProjects)
    using (var project = projects[_moduleName.ProjectName])
    using (var components = project.VBComponents)
    using (var component = components[_moduleName.ComponentName])
    using (var module = component.CodeModule)
    using (var pane = module.CodePane)
    {
 
> @comintern I'll try with the latest build on Win7 x64 / 32-bit Office.
 
11:50 AM
@Duga eager to get the latest build onto my work laptop anyway =)
@this shouldn't the callers have access to a QMN? If so, we can get the ICodeModule from the wrapper provider, right?
 
this is from the parser event args which is originally marhsaling a VBComponent across events
I'm converting it to a QMN to avoid just that.
Unfortunately the presenter does not have the repository but it does have VBE.
After seeing how awful that code was, I'm thinking the QMN should have TryGetProject and TryGetComponent methods, passing in the VBE so that we can get out the VBProject or VBComponent from the caller's side and thus be able to deterministically release the SCWs.
the curent version:
        public void Navigate(IVBE vbe)
        {
            var selection = new Selection(Exception.LineNumber, Exception.Position, Exception.LineNumber, Exception.Position + Exception.OffendingSymbol.Text.Length - 1);
            if (!_moduleName.TryGetComponent(vbe, out var component))
            {
                return;
            }

            using (component)
            using (var module = component.CodeModule)
            using (var pane = module.CodePane)
            {
                pane.Selection = selection;
 
#FunFacts 1.6K PRs in 4 years is 400 PRs/year, which is more than 1/day on average
7
 
:+1:
 
This is fun!
trying to install VS updates:
Step 1: attempt to install MS Reporting Services Projects yields:
Step 2: attempt to install MS Analysis Services Projects yields:
Makes you wonder where the Snowdens of yesteryear are...
any tips?
I have tried installing them both in one go and both fail there, too.
 
12:27 PM
@Comintern Regarding your question about the remove unassigned variable quick fix, I think it should not even be executable if there are uses of the variable.
 
@Hosch250 I think that you would have to move Rubberduck to .NET Core 3.0 at that point, because Standard never gets the GUI bits. (Standard still doesn't even have file opening, you have the binary/stream/string readers, but there's no way to open a file in Standard.) They really mucked the whole thing up with Standard, and we've fought a lot of it.
 
@this :+100:
 
@202_accepted Probably.
It's OK either way. I'll just have to configure Castle Windsor
 
Uh, exactly what does Core buys Rubberduck?
 
if you wanna do that, the retargeting of the projects should be a one-line diff
 
12:38 PM
thanks his corporate IT folks for applying patches unannounced including a reboot of his machine and causing unclean shut downs of all running applications.
 
@this It makes the website easier to write.
 
oh nice
 
@FreeMan sudo apt-get clean. Oh, wait...
 
But, we aren't planning on it; I just asked whether I could do the website in Core, but I can't and still reference RD DLLs.
Which means none of the feature previews would work.
 
@Comintern if only...
 
12:43 PM
@M.Doerner Are you referring to the With block example, or the overlap with the AssignmentNotUsedInspection?
 
1:04 PM
I just finished cleaning up the other *EventArgs that were throwing around toxic waste SCWs except for one.... AutoCompleteEventArgs.
 
Is it leaking? Aren't those events insulated from an unanticipated shutdown because they're blocking in the message pump?
 
not sure yet. I don't I have been running w/ AC on. Tongiht I will do another test going all features
but as a rule, we really don't want to marshal the SCW across event boundary.
let the caller get it themselves
 
My only concerns with that are that in this case we want to limit the potential for re-entry into the message pump if possible - it's also probably RD's hottest code path ATM.
 
yeah i know
it would be less of a problem were it synchronous but I don't think C# events are guaranteed to be synchronous (nor is it guaranteed to be async... it's sometimes, sometimes not, AIUI)
 
1:32 PM
Thanks for crashing, Excel. I only had 4 worksheets open. None of them were huge. Blowing up wasn't really necessary at this point in time.
 
@FreeMan It detected you were about to take over the world. It has a built-in anti-dictator clause :P
 
1:57 PM
wow... I didn't know that, Pinky
 

« first day (1602 days earlier)      last day (1578 days later) »