« first day (1011 days earlier)      last day (2169 days later) » 
00:00 - 19:0019:00 - 00:00

12:01 AM
RELOAD!
[Hosch250/Rubberduck] 32 commits. 5105 additions. 3431 deletions.
[retailcoder/Rubberduck] 5 commits. 1391 additions. 420 deletions.
[rubberduck-vba/Rubberduck] 48 commits. 7 opened issues. 3 closed issues. 30 issue comments. 16645 additions. 27088 deletions.
[rubberduck-vba/RubberduckWeb] 1 commit. 4 additions. 4 deletions.
 
hmm, I think it's VBE throwing that error. If I have a project that opened with those errors, then attempting to add a module throws the same error (and the module is not added)
 
@Comintern well we do need to know when a module is added or removed no?
 
@Mat'sMug I meant the project events. We're currently listening for both ComponentAdded\Removed and ProjectAdded\Removed in the RubberduckParserState.
 
But I can add a new workbook, and add modules to that. i.e. the state of the project that opens with errors is permanently impaired in the VBE.
given my hit-rate on recent enhancement issues, I'm going to float this one here first ;-)... What if RD supported some annotations like @PredeclaredClass, @DefaultMember, @EnumMember, @ShortcuttedMember, @MemberHasDescription, and/or @MemberHasAttribute.
That would help identify when attributes are inadvertently lost, but also help with inspections? RD could have inspections like "Expected ClassX to be pre-declared, but attribute is missing or removed", or "Class X default member attribute is missing or removed", and the quickfix could apply or reinstate the attribute.
 
12:22 AM
'@TestMethod
Public Sub TestMethod1() 'TODO Rename test
    On Error GoTo TestFail

    Dim first() As Variant
    Dim second() As Variant

    first = Sheet1.Range("A1:D3").Value
    second = Sheet1.Range("A1:D3").Value

    Assert.SequenceEquals first, second

TestExit:
    Exit Sub
TestFail:
    Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
End Sub
Works with arbitrary number of dimensions and also tests equity of the LBounds and UBounds.
 
Does it work if you remove the assignments?
 
You mean like Assert.SequenceEquals Sheet1.Range("A1:D3").Value, Sheet1.Range("A1:D3").Value? I don't see why not.
Yep. No problem.
 
empty/uninitialized array = empty uninitialized array
 
Dim first() As Variant
Dim second() As Variant

Assert.SequenceEquals first, second
	VBAProject.TestModule1	TestMethod1	[expected] and [actual] are Nothing. Consider using Assert.AreSame.	5
Hmm...
I don't think there's a way to tell an uninitialized array from Nothing. Apparently they marshal as null.
 
In VBA I'd use Not first
how about these?
    Dim first As Variant
    Dim second As Variant

    first = Array()
    second = Array()

    'or...

    first = Split(vbNullString)
    second = Split(vbNullString)
 
12:34 AM
First one: Green checkmark
Second one: Green checkmark
first = Split(vbNullString)
second = Split("1,2,3", ",")
SequenceEquals assertion failed. Dimension 1: expected has a UBound of -1; actual has a UBound of 2.
 
12:49 AM
^ Could we perhaps change the location text to either include the name of the procedure (if it's a proc-level variable), or omit the procedure name if it's a module-level variable?
 
@ThunderFrame That's not a bad idea.
 
[rubberduck-vba/Rubberduck] build for commit 32411b58 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
Do yourself a favor and use an ISO-8601 date format "YYYYMMDD" in your file names. That way your file names will sort in alphabetical and chronological order. — ThunderFrame 1 min ago
♫ Imagine there's no date ambiguity, it's easy if you try ♫
2
 
@ThunderFrame definitely. this has been annoying me forever!
 
12:57 AM
[rubberduck-vba/Rubberduck] build for commit e753fd82 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
@Mat'sMug How about the annotation suggestion earlier?
 
might have missed it. what is it?
44 mins ago, by ThunderFrame
given my hit-rate on recent enhancement issues, I'm going to float this one here first ;-)... What if RD supported some annotations like @PredeclaredClass, @DefaultMember, @EnumMember, @ShortcuttedMember, @MemberHasDescription, and/or @MemberHasAttribute.
oh
 
wait a minute...
I think you've just found the very best way for Rubberduck to handle module/procedure attributes!
 
1:01 AM
'@VB_Attribute_PredeclaredId(True)
^ self-documenting
hmm
no, you got it right - best is that we have an abstraction layer on top of 'em
 
@Duga That was intentional. The tests are testing for the old Assert behavior.
 
so we do @EnumMember instead of @VB_Attribute_UserMemId(-4)
 
I'd do either.
@EnumMember as an alias for @UserMemId(-4)
 
If we had a UI - we could Sync attributes.
 
Maybe just a refactoring, like "Annotate attributes"?
 
1:10 AM
@ThunderFrame that was the original plan - to do it à la VS6
 
sure, but I think a Sync would be good too. Moved the @EnumMember ? Sync will confirm/change the attribute for you.
 
but @Description("Foobarnates the bazz") is just too awesome
 
And if we're think ahead to RD 3.0 - we could have intellisense for annotations, so just typing '@VB_A would be enough to get intellisense for the attribute annotations.
 
Oooooo...
 
^
damn this project is awesome
2
@ThunderFrame heck, you type @ and it lists the available annotations
gosh, SO
Sounds great. Except it's not a question. Stack Overflow is a Q&A site, not a "I need XYZ please do everything for me so I can paste it into my code and walk away happy without even trying" site. Please read How to Ask. — Mat's Mug 21 secs ago
 
1:18 AM
yep, but maybe annotations need "classes"... Eg. Type @, get a list of "Folder", "Inspection", "VB_Atrribute", then choose one, get the "members" for that "class"? Final annotation would look like '@Inspection.IgnoreVariableNotUsed True
 
If so, I should probably hold off on the annotation island grammar.
 
we currently have the infrastructure to make this happen.
every annotation is a class
we already export all modules specifically to pick up their attributes
we just need to add a listener override that picks up RD annotations, and inject the attributes before we reimport the module
 
I would love to have an annotation resolver.
@ThunderFrame If we deprecate the old annotation format, I'd recommend that we still support it with an added DeprecatedAnnotationInspection that has a quickfix to reformat them.
 
agreed
probably needs separate issues: VB_Attribute annotations, deprecated annotation inspection, annotation classes/intellisense?
 
1:42 AM
yep
well intellisense can wait
 
I could probably hook intellisense now, but it will be monumentally easier with replaced code panes.
 
not worth the effort if it's going to be scrapped anyway :)
 
yep, but still need to create an issue for annotation classes in prep for intellisense
 
sure
 
2:50 AM
[rubberduck-vba/Rubberduck] build for commit 9de2d1de on unknown branch: AppVeyor build failed
BUILD FAILURE!
[rubberduck-vba/Rubberduck] build for commit 7e5231a4 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
 
1 hour later…
@Duga I'll take that soon.
 
4:49 AM
Neither the C code or the VBA code is allocating any memory. You're passing a pointer to a null string from VBA and then immediately passing that to sprintf. Your "program halt" is most likely a segfault. Either the C function needs to provide a buffer (an a way for the caller to release it) or it needs to be able to communicate how large of a buffer the caller needs to create. If you're attached to the interface, consider using snprintf and have the VBA code pass the buffer length instead. — Comintern 35 secs ago
Pro tip. Don't try to call a C dll that you wrote with VBA code that you wrote if you don't understand either language.
2
 
lol
#refuctoring in progress
 
TBH, the C function is fairly trivial to convert to VBA. I'd do that. — Comintern 10 secs ago
 
Well that was quick.
 
lol
was missing a .Parent call in 3 places
oh and I just deleted CodeModuleExtensions.cs
 
5:02 AM
Nice!
 
damn I suck at small commits
 
[retailcoder/Rubberduck] retailcoder pushed commit c9c630c8 to rd-next: factored functionality out of extension methods and into Rubberduck.Parsing.PostProcessing.
 
now running the failing 65 tests
I don't expect much at this point, but it's possible one or two end up passing :)
(I wired the functionality to the new IModuleRewriter stuff)
I'm going to cry when I merge this
 
I'm trying to figure out HTH to test the changes I made to the AssertClass. It isn't exactly easy to mock either a System.Type or a __ComObject.
 
5:31 AM
duh, the ICodeModule mocks didn't have Clear() set up
 
[retailcoder/Rubberduck] retailcoder pushed commit f6ca0777 to rd-next: setup ICodeModule.Clear mock
 
most failling tests are throwing a NotImplementedException, so #progress
and time to get some sleep
Conflicting files
RetailCoder.VBE/Inspections/QuickFixes/AssignedByValParameterMakeLocalCopyQuickFix.cs
RetailCoder.VBE/Inspections/Resources/InspectionsUI.Designer.cs
RetailCoder.VBE/Inspections/Resources/InspectionsUI.resx
Rubberduck.Parsing/VBA/RubberduckParserState.cs
RubberduckTests/Inspections/AssignedByValParameterInspectionTests.cs
RubberduckTests/Inspections/AssignedByValParameterMakeLocalCopyQuickFixTests.cs
RubberduckTests/Inspections/ConstantNotUsedInspectionTests.cs
RubberduckTests/Inspections/DefaultProjectNameInspectionTests.cs
lol, I have 65 outgoing commits
merge from hell
wow, 37 conflicts
bwahaha most are just using statements
 
5:58 AM
[retailcoder/Rubberduck] retailcoder pushed 126 commits to rd-next (only showing some of them below)
[retailcoder/Rubberduck] Hosch250 pushed commit d3755d65 to rd-next: Merge with conflicts
 
closes VS2013 for the last time
so, that's it - I can't RD at work
@Hosch250 please hold off on new inspections until I merge my stuff; I've moved them over to Rubberduck.Parsing and there are new interfaces involved.
 
[retailcoder/Rubberduck] retailcoder pushed commit 6e57adaa to rd-next: fixed merge artifacts; builds in VS2015
> @Hosch250 please hold off on this one (and any other inspection too); there is a lot going on in my fork with inspections.
 
6:16 AM
TTGTB
 
 
2 hours later…
8:28 AM
@Comintern Do I recall correctly from way back in this chat that the VBE loads projects with an internal name and then renames them? If that is the case, our handler for the project load event might be interfering with the project load.
I guess that never happened before because, without the delay, we have been fast enough to not get in the way.
 
8:43 AM
@M.Doerner Could be, but even after the parse fails, I can't add any more modules using the VBE.
 
8:54 AM
Maybe our request for the components utterly confuses the VBE.
 
yep - seemingly just for that project
 
 
2 hours later…
10:53 AM
1
Q: Calculating the density of humid air at a given temperature and relative humidity

MLucasI've written a script to calculate the density of humid air at a given temperature and relative humidity, as these inputs are typically known for specific geographic locations. At the moment, the inputs are added into the code and the result is just printed to the immediate window. The equation...

 
I killed @Duga?
 
12:00 PM
> Some inspections are module level, but others are specific to members of a module. Inspection Results' Location column should be more specific about the location by including the location's member name where appropriate.

That would avoid ambiguities like this:

![ambiguity](https://cloud.githubusercontent.com/assets/16574009/23853427/a095f5d4-0840-11e7-81fb-4519b2ab772a.png)
 
> With new annotations for VB_Attributes, the number of annotations is growing. It can be hard to remember their names. In RD 3.0 we could have Intellisense for annotations, so it makes sense to think about categorizing annotations and also preparing for Intellisense.
@Duga You can thank me later
 
12:29 PM
gah - typo in the URL - whatever
 
12:39 PM
 
1:39 PM
> Absolutely! This has been annoying me for a while...
> Per linked issue, this will be implemented as an annotation:

'@ModuleAttribute.VB_PredeclaredId(True)

Or

'@VB_PredeclaredId(True)
> Per linked issue, this will be implemented as an annotation:

'@MemberAttribute.VB_UserMemId(0)

Or:

'@DefaultMember

---

This specific attribute will also need an inspection, to ensure only one module member has it.
 
2:01 PM
monking, all.
I just installed .13 and noticed that there were 4 'Rubberduck install' (don't recall the exact name) processes in task manager. They did all end when the install finished - is this to be expected?
Can't say there never was before, this is the first time I've noticed.
 
> Per linked issue, this will be implemented as annotations:

'@ModuleAttribute.VB_Description("This module is responsible for XYZ")
'@MemberAttribute.VB_Description("This procedure is responsible for XYZ")

Or:

'@Description("This module is responsible for XYZ")

The `@Description` annotation would be context-sensitive and become a module attribute when found in the declarations section, or a member attribute when found in a procedure.

This annotation will require an in
> Per linked issue, this will be implemented as an annotation:

'@MemberAttribute.VB_UserMemId(-4)

Or simply:

'@Enumerator

This annotation will require an inspection to ensure it's only found once in a given module.
> Per linked issue, this will be implemented as an annotation:

'@ModuleAttribute.VB_PredeclaredId(True)

Or

'@VB_PredeclaredId(True)
> About the mentioned inspections:

> *RD could have inspections like "Expected ClassX to be pre-declared, but attribute is missing or removed", or "Class X default member attribute is missing or removed", and the quickfix could apply or reinstate the attribute*

I think it would be the other way around:

> **Missing Annotation** Procedure 'DoSomething' has member attribute '`VB_Description`', but no corresponding `@Description` annotation. Consider making module and member attributes expl
> BTW this is my new favorite RD feature :+1:
> @SystemsModelling hopefully the changes made in 2.0.13 fix this issue.
> @SystemsModelling hopefully the changes made in 2.0.13 fix this issue.
 
 
1 hour later…
3:50 PM
Can you please add some punctuation and capitalization? I started an edit but can't really tell where one thought starts and another ends in that 93 word run-on sentence at the start. — Comintern 11 secs ago
WTH? You have 2 shift keys and a full spectrum of punctuation keys. They're there for a reason.
 
4:07 PM
^ @Comintern Haha. That comment has got to be the best way to start a Monday. #Harsh&Honest
 
4:32 PM
> Doesn't look like adding a method is working as intended. Below is what I've experienced.

Before
```
Option Explicit

Option Private Module

'@TestModule
'@Folder("Tests")
Private someTable As ListObject

Private Assert As Object

'@ModuleInitialize
Public Sub ModuleInitialize()
'this method runs once per module.
Set Assert = CreateObject("Rubberduck.AssertClass")
End Sub

'@TestInitialize
Public Sub TestInitialize()
'this method runs before every test in th
 
4:48 PM
> Can't repro. How does that even happen? The current selection has (supposedly) no bearing whatsoever on the actual insertion point, which is [module.CountOfLines](github.com/rubberduck-vba/Rubberduck/blob/next/RetailCoder‌​.VBE/UI/Command/AddTestMethodCommand.cs).
 
@Duga that was reported before, closed without a repro.
module.InsertLines(module.CountOfLines, body);
@IvenBach ^ if you reliably repro that, try breaking on that line
It doesn't make any sense that it inserts in the middle of the module
Compare module.CountOfLines to what's in the VBE
 
I can't test it out until I'm home tonight. Not a big deal since I'm doing simple tests right now.
I'll check it after work at home.
@Mat'sMug The hotfix resolved the parser error. :+1: Thanks for that.
 
Looks like the version check is doing its job:
> Rubberduck.Setup.2.0.13.0.exe (5.83 MiB) - Downloaded 50 times.
Last updated on 2017-03-12
That's 25% of .12 downloads in less than 12 hours
 
@Duga WTH? I can't repro that either.
That shouldn't ever be cached either.
 
5:14 PM
@Comintern looking at the code, I don't even see how it's possible
^ that. CreateObject takes a progId string literal. But if you're trying to figure out how a dictionary works, why not start with early binding so you get IntelliSense? Tools > References > Microsoft Scripting Runtime - that said I don't think anyone has a different version of that library unless they're running Windows < 98, so there's no need to use late-binding for it - the same version is on every single Windows box ever manufactured in this century. — Mat's Mug 7 secs ago
 
Is there a current issue already with Test Explorer having a perpetual waiting icon (dots circling)?
 
yes
 
Only workaround for it is to close and reopen Excel?
 
@IvenBach look that the logs before you restart though
if there's an EXCEL.EXE ghost process running/lingering, tests can't run
2017-03-02 13:09:25.7366;ERROR-2.0.12.19847;Rubberduck.UI.Command.RunAllTestsCommand;System.Runtime.InteropServices.COMException (0x800A03EC): Cannot run the macro ''test.xlsm'!VBAProject.TestModule1.ModuleInitialize'. The macro may not be available in this workbook or all macros may be disabled.
 
I'm now getting a Sorry, we couldn't find '<file location>\<file name>.xlsm - [<Module name> (. Is it possible it was moved, renamed or deleted?' messagebox. What makes it odd is that the module name has a space at the end with a left parenthesis.
 
5:26 PM
how many EXCEL.EXE processes are there in task manager?
 
Just the single instance.
 
@IvenBach that's pretty much saying exactly what the COMException above says
 
@Mat'sMug This one?
 
yeah
 
Ok.
Is there a limit to the length of module names?
 
5:28 PM
yes
does the test procedure run if you call it manually?
e.g. Ctrl+G, TestMethodName<ENTER>
 
For now it seems to be fixed. I deleted the test method entirely, closed excel, and then recreated it.
 
odd
 
I was pretty sure it was resulting from my too long of a method name.
 
that's entirely possible. we need an inspection for that.
3
A: VBA what is the longest allowed name for a function or procedure

Peter AlbertI just tested it - it's 255 characters...

really?
@IvenBach you had a method name >255 characters?
 
The module name was >31 characters.
 
5:37 PM
huh, the VBE should have prevented that
 
^
Should have. I caught it myself when the strange behavior started.
I remembered it being 31 characters since prior to this I tried to use more than than to name another method.
 
in other words, you hit Debug > Compile and it doesn't compile
 
> VBA has a hard limit on legal identifier lengths:

- Module name must be <= 31 characters
- Other names (procedure, variable, constant, parameter, etc.) must be <= 255 characters

Failure to validate these can cause the test explorer to hang (similar to #2641).

Refactor/rename should enforce these limits and prevent renaming an identifier to an illegal name.

Any code that creates new VBA code (e.g. extract method, introduce local variable, etc.) should validate these limits as wel
 
we could make RD run the compile command - but we have no way to tell whether the compile is successful or not
our VBA grammar doesn't enforce maximum identifier lengths either, so there's no parser error when an identifier breaks the limit
 
5:56 PM
> The grammar doesn't enforce maximum identifier lengths (see #2855), yet we assume that no parser error means the code is compilable.

We need an error-level inspection result to pop for every identifier name that's longer than 255 characters - longer than 31 if it's a module name.

> **Identifier name is too long.** VBA will not compile code that contains identifiers longer than 255 characters, or module names longer than 31 characters.

Quickfix is obviously to run a *rename* refactorin
 
This answer is wrong/misleading. CreateObject creates a late-bound object, i.e. you don't need a reference to "Microsoft Scripting Runtime" - if you do reference the library, then using CreateObject is plain silly (for lack of a more expressive word); you can just do New Scripting.Dictionary and get IntelliSense and the runtime performance benefits of early binding. CreateObject takes a ProgId string literal, so that's CreateObject("Scripting.Dictionary"). — Mat's Mug 1 min ago
^ needed to lose 1 rep :)
 
@Mat'sMug That is a very helpful and instructing answer for those that are learning.
 
It's a comment on an answer that will probably end up deleted =)
 
It helps me reinforce that I'm understanding everything I'm reading.
Is there a NameOf() equivalent for VBA?
 
Nope
 
6:12 PM
:sadface: VBA bites me again... She used to be so kind to me, till I realized OOP had more to offer me.
 
Heck, the nameof operator appeared in C#6
 
A-hacking-we-will-go it is then.
@Mat'sMug That surprised me when I learned about that. Kind of a 'why didn't we get this sooner'
 
You got TypeName though
 
So it's an operator even though it's treated like a method?
 
It's a complete utter compiler hack
 
6:17 PM
When running unit tests there should be no need to check for unhandled exceptions, only the testing itself?
 
@IvenBach TypeName is a function.
 
@Mat'sMug so NameOf and TypeName are functions?
 
NameOf is VB.NET/C#, TypeName is VBA...
 
VBA's TypeName has to basically do what we do in RD's COM collector to determine the type of a Variant or Object reference.
 
In .net you do foo.GetType().Name
 
6:21 PM
VB.NET's NameOf is used like a keyword, but almost certainly uses reflection internally.
 
@Mat'sMug as well as foo.GetName()?
 
...that doesn't exist AFAIK
 
I don't presently understand reflection, other than it's looking at itself.
 
There isn't an equivalent to NameOf in VBA - you'd have to, well, do reflection by reading the CodeModule, parsing it, etc.
 
I'm probably using Apples to Oranges vocabulary and confusing myself.
 
6:22 PM
^^
 
I end up doing that too often...
 
Reflection is basically the Type API. You do foo.GetType() and what you get is a System.Type object that describes the type of foo
From there you can find its methods, properties, private fields, anything
The closest thing in VBA is Rubberduck's COM API
and it's not context-sensitive, which makes it quite cumbersome to use for reflection
RD uses reflection to know what inspections are implemented, so there's nothing to wire up when you make a new inspection - it just works
 
I think reflection will take me a little more time to understand. Working towards it though.
 
"Give me all types that implement the IInspection interface"
 
@Comintern Like C#'s nameof?
6
A: How does nameof work?

D StanleyIt's not "accessing" the property - that operator is purely a compiler mechanism to inject the "name" of the argument into the code. In this case it will replace nameof(TestClass.Name) with "Name". The fact that it's non-static is irrelevant.

> That operator is purely a compiler mechanism to inject the "name" of the argument into the code.
 
6:30 PM
@Hosch250 Yeah.
 
That isn't using reflection.
It gets compiled into a string literal.
 
with RD's COM API you can iterate, say, all enum members of a given enum in your code, and generate a dictionary keyed with enum values and returning the corresponding name - and then you can call that dictionary NameOf and do Debug.Print(NameOf(MyEnumValue)) to print "MyEnumValue"
 
So nameof is dealing with the compiler whereas typeof deals with an object?
 
Something.
 
nameof is instructing the compiler to substitute something with its name
 
6:33 PM
@Hosch250 Huh. Apparently that's where speculation gets me. I've never found a use case for it, so I never really looked into it.
 
typeof returns a Type.
 
typeof is instructing the compiler to get the type of something
@Comintern throwing an ArgumentException
 
Without a call stack attached to it?
 
typeof & nameof deal with the compiler. Whereas foo.GetType() does the same thing as typeof but does so by dealing with an object?
 
@Comintern no, without a string literal for the parameter name
 
6:36 PM
OnPropertyChanged(nameof(SomeProp))
 
^OK, that is a use case.
 
throw new ArgumentException($"{foo} shouldn't be null", nameof(foo))
Did someone throw a flag here?
 
A mod just came tumbling in.
Somewhat like that knight in Alice in Wonderland tumbling into his helmet.
 
6:47 PM
879
Q: Type Checking: typeof, GetType, or is?

jasonhI've seen many people use the following code: Type t = typeof(obj1); if (t == typeof(int)) // Some code here But I know you could also do this: if (obj1.GetType() == typeof(int)) // Some code here Or this: if (obj1 is int) // Some code here Personally, I feel the last one is ...

 
@Mat'sMug My lunch hour will be spent on this one.
Thanks for pointing me to it.
 
00:00 - 19:0019:00 - 00:00

« first day (1011 days earlier)      last day (2169 days later) »