« first day (1328 days earlier)      last day (1852 days later) » 

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 1 opened issue. 2 issue comments.
 
 
6 hours later…
5:51 AM
@Mat'sMug so dead simple.
 
 
2 hours later…
7:58 AM
well ... that was kinda anticlimactic...
@this seems like a good moment to chew that person out on twitter
 
 
1 hour later…
9:00 AM
[rubberduck-vba/Rubberduck] build for commit 27559008 on unknown branch: AppVeyor build succeeded
 
 
1 hour later…
10:37 AM
I've now worked out how to grab the predeclared instance of a class from its ITypeInfo. It feels like I'm pretty close to being able to instantiate a class
4
 
 
3 hours later…
1:23 PM
Just read up pn the chat log of the last few days.
@IvenBach For setting the types in the resolver, you will probably want to look at the point in the declaration resolver where primitive types are set.
The alternative, would be to set the the types in the TypeAnnotationPass that is run by the reference resolver. However, then you will have to save the def directives on the, module declaration in order to be able to access them there.
 
 
2 hours later…
@Vogel612 I don't do twitter. Never understood the social media, TBH. Besides, I'm not the chewing-out type of person.
 
WRT my earlier comment about grabbing the predeclared instances, I am now thinking it's not all that useful. Sure, we can grab the predeclared instance once it has been created, but if that instance hasn't yet been created (i.e. the VBA runtime hasn't touched the predeclared variable) then the predeclared instance is null.
 
@WaynePhillipsEA given that we can ExecuteCode which can run a procedure that calls back with the objects we want, I think we are fine w/o it.
 
yeah, I was basically trying to find a way to create object instances directly, which would have been a nice-to-have
unfortunately, it looks like we're about 3 layers of API abstraction away from the ability to create-instances
which would take me about a week to work out.
 
3:26 PM
@WaynePhillipsEA do you mean "create an instance of a VBA class from the VBA project" or "create an instance of a VBA class on the fly"?
 
the latter
 
ok that's sick
 
I just can't find an easy route for us to get that feature... yet
 
With Fakes.UserDefinedClass.Mock(New Something)
    .Setup("DoSomething")
    .RaisesError(5)
    '...
End With
drool
 
one day I'm sure I'll stumble upon something and I'll come back to it
 
3:44 PM
hmm - can we at least get the interfaces from VBA class?
if we can then we can use .NET's mocking to provide that?
 
hmmm, can TypeOf Something can even be passed as parameter? Never tried that....
 
In VBA? result is a boolean, from the 'is' part of the expression. TypeOf on its own is not valid
 
was thnking of a way to strong-type the type of hte class
e.g. TestThis(TypeOf MyVBAClass)
 
the only way I can see this work would be stringly-typed
 
3:55 PM
so we can get the types without using strings and pass it to the .NET's mocking framework
 
Moq?
 
basically create a COM interface for Moq
dispatch the VBA class to it
 
that'd make a neat distinctive feature - "Use Moq mocking framework in your VBA unit tests!"
 
let Moq take care of the actual mocking of the vba class
the hard part is somehow passing the type of the class
without resorting to strings.
 
that would be Wayne's magic there
 
4:02 PM
via ITypeInfo?
 
we get a string that represents a VBA class name
create an instance of it and pass it to moq
the rest is just API-wrapping
 
FWIW, Moq can only mock interfaces and virtual classes.
 
...or we make our own mocking framework
#BecauseWhyNot
 
wait a minute- why do we need to create an instance?
doesn't Moq create a mock?
 
the key is just being able to get an object, know everything about its interface, and substitute it with an on-the-fly object that Implements that interface (return that object to the VBA caller)
 
4:04 PM
Yeah...
 
note with Wayne's API, we already can get interfaces
from the ITypeInfo
but the trick is how do we strong-type it in the VBA testing code that's driving the test?
 
I don't think we can
hmm
 
so gonna to be stringly typed?
 
With Fakes.UserDefinedClass.Mock(New Something)
 
With Mock("MyVBAClass") ....
 
4:07 PM
we could pass an instance of the type we need
 
if you new it, you get side effects.
 
shoot, that's right
 
the next best thing we can do is to inspect for strings that don't reference a vba class
or for missing tests for a given type
 
if you don't already have an instance to pass, you're kind of F'd
 
ok, I'm confused, @Mat'sMug
I thought Moq doesn't need an instance
just stick an interface in it, and it'll make something out of thin air
no need to new the class being mocked?
 
4:08 PM
not sure moq will be able to handle this
 
exactly what does it do wiht the interfaces provided?
 
it creates a type that implements it
 
does it handle all the COM side of things, like responding to the correct IIDs in QueryInterface()?
 
very probably not
 
then VBA wont accept it
 
4:15 PM
does that type need to pass the boundary?
 
it's hardly working with .net code lol
 
yeah it'd have to, since we need to run methods on it.
Wayne, how hard is it to make it auto-generate COM interfaces on fly? :p
 
For VBA to accept it, it needs to setup the equivalent vtable and respond correctly to QueryInterface
 
double checking because I am a bit unsure we need to do so
if we create a IMockCOM interface that exposes all the methods on Mock class
then pass in the interface from VBA class
 
4:18 PM
It's not that hard actually, but I did something similar in vbWatchdog, where I had C++ simulate the interfaces, and it worked fine in both 32-bit and 64-bit until they made some 'optimizations' in Office 2010 SP1 that broke 64-bit support.
In 64-bit VBA now, they don't use the vtable if the COM object comes from inside the VBA project
 
uh oh. Does that impact RD, too?
 
No, you're not simulating interfaces
 
alright - back to the original question - so if we have a IMockCom interface to expose Moq's Mock class, and it works with only VBA class' interfaces.... will we have problems?
(and how the heck do they not use vtables anyway?)
 
yes. the only way around it is to return it as an Object
They have optimized vtables that are not COM compatible
 
oh ok
 
4:21 PM
and they are not in the 'normal' place for a vtable
You basically can't forge it for internal types in 64-bit VBA
it's basically like the difference between stdcall and fastcall in C++
 
ah
gotcha
and object lets us circumvent that problem... why?
(that being the problem of passing forth/back the Moq's Mock class)
 
because it just works through IDispatch, which is an external type so there's no optimized vtables
 
hmm. This seems a concern only for the VBA class interfaces.
With Fakes.UserDefinedClass.Mock(New Something)
    .Setup("DoSomething")
    .RaisesError(5)
    '...
End With
the Mock can be a dual interface
it's the Something (the VBA class) that we need to marshal across the boundaries
 
gotcha
 
and whatever proxy on-the-fly magic type returned by this Mock method.
 
4:28 PM
What does the Mock() actually return then?
 
actually, .Object would be the on-the-fly magic type that Implements Something
 
in VBA terms
 
just a COM-visible class
 
that means it needs to aggregate the interfaces
 
Sure, I mean what type
 
4:29 PM
Something in this case.
 
no
that would be a Rubberduck.MockClass or something
 
confused Isn't tthat how Moq works? create an implementation of the interface being mocked?
 
right, i see.
 
@this moq gives you a Mock<T>
Mock<T>.Object is the magic type
 
Right. Oh, so Mock<T>.Object is the T
 
4:30 PM
yeah
 
but Mock<T> is Moq.Mock, got it
 
:+1:
 
which we implemetn as IMockCom dual interface
right?
 
the MockClass needs to expose methods to set it up
definitely
 
so problem solved then. We create a COM-compatible interface to expose the Moq's Mock class to VBA
with some methods to string-type the VBA class being mocked
grab the interface from ITypeInfo, and .... mock it, then return to VBA to do whatever
 
4:31 PM
again I doubt Moq can do the gruntwork for us here
 
why exactly?
 
var mock = new Mock<WhatsThisT>(notYourTypicalManagedInterface);
or even var mock = new Mock(TypeOf(someComObject));
Moq only handles interface and abstract classes
 
So?
public IMockCom Mock(string VBAClassName)
{
  Type IVBAClass = TypeLibAPI.GetInterfaceForClass(VBAClassName);
  return Mock = New MockCom<IVBAClass>(IVBAClass);
}
(oversimplified but that illustrates the point)
and besides all VBA classes are interfaces.
even for a VBA class with no Implements anything, it creates an interface behind the scene, which we get from TypeLib API.
 
they're COM interfaces, not sure the CLR will understand them as such
 
interfaces are interfaces.
 
4:38 PM
seems everything looks like a class to .net
 
hm. you're worried that there must be implemetnation behind each interface?
 
no, just that what COM says is an interface, the CLR doesn't see as such
i.e. I expect Moq to throw something like "can't mock this type"
 
hmm. that'd be news to me because CLR has to work with COM interfaces as such.
but meh. if we must reinvent the wheel, reinvent we shall.
HHICB....
 
[CrapTonOfAttributes]
public class SomeCOMInterface
{
    // ....
}
^ that's how I'd say .net sees it, AFAIK
i.e. sure it knows how to marshal it back & forth, but as far as managed code is concerned, it's a class - and that's all Moq is going to be seeing
 
the thing is that the class is made by VBA
if CLR can see it, so can Moq. and Moq shouldn't care how it's implemented because it creates a fake class that implements the same interface, no?
 
4:48 PM
but Moq doesn't mock anything you throw at it
if you give it a concrete type, is won't work
 
Correct
and your example above assumes it's a class
 
and SomeCOMInterface is a concrete type as far as .net is concerned
 
which I think is incorrect
 
you have RD/VS open?
 
VS, yes but not RD
 
4:49 PM
hmm
I'd say bring up the object browser and look at the VBIDE API
hmm actually you might be correct
we used to mock VBE directly
because it's an inteface
 
COM uses interfaces by defintiion
 
anyway, there's nothing like trying :)
 
the worst thing that happens is Moq says screw you
and we go on to invent our own mocking framework. :)
but i'd like to try and avoid reinventing if we can.
 
of course
 
BTW FWIW -- in object browser, you'll see types like Excel.ApplicationClass
 
4:52 PM
yup
 
but you can never use them directly; you'd have to always work with Excel.Application which is in fact an interface
(TBH I don't know why they bother exposing those coclasses in OB anyway....)
 
@M.Doerner Haven't looked at anything yet. I'll definitely request assistance if I get lost in the weeds.
 
[rubberduck-vba/Rubberduck] build for commit 93edd548 on unknown branch: AppVeyor build succeeded
 
5:54 PM
@Mat'sMug @this mentioned the other day about your references dialog. something about the IsBroken property being .. broken
in the TypeLibs API I can expose the raw reference strings (the hash delimited ones) if that is of any use
like this: *\G{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}#9.0#0#C:\Program Files (x86)\Microsoft Office 2003\OFFICE11\MSACC.OLB#Microsoft Access 11.0 Object Library
 
I need to get back to that dialog...
What would that string give me?
Oh wait, the path won't be there for a borked ref?
IMO best place to fix broken VBIDE API members would be in the wrappers
 
Yeah, Mat.
Not sure how wrapper helps?
you need to see what references a VBA project is trying to use
to help users fix it, no?
 
6:09 PM
Yeah, you will get the cached expected path
 
I've resorted to this hash string (which I got it another way) to avoid relying on the crappy References collection.
Yeah, but even having the expected path is very helpful in trobuleshooting
I'm thinking in particular about those stupid SysWOW64/System32 for those lousy active x controls which nobody should be using but they do anyway
 
there are also other oddities... ADO versioning being an example
 
6:30 PM
@this the dialog fetches project refs from the References collection; the presenter will be using the References collection to add & remove references too
 
Which is fine... until you have a project w/ broken references
At least in Access, you can't use it.
well, you sort of but not all of its members. and it's very hard
Using the raw hash string would allow you to recreate the information that you otherwise could not get from the References in such state.
 
I can parse the strings into a compatible references collection if that helps
 
6:45 PM
then @Mat'sMug can use that as a fallback when he loads his dialog.
 
 
2 hours later…
9:12 PM
We formally announced we are moving to Git.
Working on training, et al.
Also, we are updating our build to C# 7.2 from C 6.0.
 
Hope it's a smooth transition.
 
Everyone has been in VS 15 for several months, so Mat can't complain about anything.
@IvenBach Me too.
 
You can always complain.
 
@Hosch250 congrats!!
@Hosch250 ?
 
You are always complaining about VS 15 AKA VS 2017.
This is a list of notable autodidacts which includes people who have been partially or wholly self-taught. == Historical education levels == Because of the large increase in years of education since 1800, especially during the early 20th century, it is difficult to define autodidactism and to compare autodidacts during different time periods. == Artists and authors == Benjamin Kidd (1858–1916), British sociologist, was not given a formal education. As a working adult, he attended some evening classes and he read incessantly. Kidd gained worldwide fame by the publication of Social Evolution in...
Just goes to show the self-taught can be quite successful.
 
9:25 PM
it's not so much VS2017 that's the problem; it's more about upgrading early and then facing all kinds of stupid useless issues including but not limited to CI integration, Antlr integration, various VS bugs, etc.
 
IOW, being at the cutting edge tends to bleed.
Profusely.
 
@Hosch250 yup. some even get Microsoft MVP awards :)
 
Yup.
I've yet to meet a reasonably-smart person who didn't take learning into their own hands.
 
Well, it stands to reason, learning enables one to learn more.
Like how cranes can be used to build taller cranes
 
You can't teach someone the desire to learn more.
 
9:28 PM
yeah, that, too.
 
Yeah. That's why I hate this thing about "higher education" and "the college experience" (AKA drugs, booze, and sex).
 
it is one big lie, yeah
mind you there are times where you do need it ---- engineers and doctors come to mind, mainly because of licensing requirements.
but to go and take sociology.... to do what, exactly?
 
Oh, I have no problems with it if the person actually wants to do it.
 
@this To socioligize, of course....
 
Like, they live for their field.
 
9:31 PM
yeah - that.
if they are just like "oh, it looks interesting"
 
But most people take it because they think it will be easy.
 
they're in for a major disappointment.
 
And if they live for their field, then there are many programs to help them gain it if they can't afford it, from loans to need- and merit-based scholarships.
 
yep
and see, the more people go to college, the more crowded out this gets.
 
@this to sound like you know what you're talking about when you write a rant about millenials in the local newspaper
2
 
9:41 PM
@Mat'sMug LOL. But these are the millennials.
 
whatever follows them, then
 
LOL. People never change.
They'll be writing rants about the future generations forever.
 
Just connected from a couple of days of being too busy at work and I join in time for education ranting, love it :D
 
@NelsonVides It's Rubberduck. We talk about everything under the sun and remain civil.
Well, mostly.
 
Frankly - "the world's going to hell in a handbasket" is a tired and old cliche, uttered ever since the start.
 
9:44 PM
@this Why the handbasket? Why isn't it being ridden to hell on a rail, or something?
 
good question. it's a old saying.
 
@Hosch250 depends what generation is ranting
 
@this and we also learn new English sayings here
@IvenBach that has been a bit of a frustration sometimes for me
 
for me, I really like this one old saying which has since fallen out of use: I used to go to the market with money in my pocket and return with a basket of goods. Now, I go to the market with a basket of money and return with goods in my pocket.
 
@this lol
 
9:46 PM
@NelsonVides Those that want to stay ignorant will. Each is free to make their own choice, I don't want to hear about them complain about the consequences of said choice.
Anyone able to assist a bit with ConditionalFormatting?
I get it figured out only to forget by the next time I need to do it via VBA.
 
About what Iven said... I've had this problem recently... changing cities and looking for new dojos for Karate, I've seen quite a bit of shit around the world...
I remember me explaining that, even if I'll most likely never be the karate world champion, I am utterly unable to understand why wouldn't I train like the world champion
 
@NelsonVides That's just a limitation of your imagination :P
 
@this now I browse to the market, fill up my basket, proceed to checkout, don't even need my wallet, get free shipping before sunset, and UPS wrecks the goods upon my doorstep
 
I mean, I want my training to be the same or even harder than that of the world champion. I don't care if I'm not reaching him, but not training harder than him is being utterly lazy for me
 
@Mat'sMug Happened to your drives?
 
9:51 PM
nah
 
whew... got worried for a moment.
 
@Hosch250 I almost believed that for a second!
 
@Mat'sMug What about your credit card? Not in your wallet?
 
@Mat'sMug how are your drives on steroids?
 
'tis, but Amazon knows
@NelsonVides they look good, can't wait for the damned caddies to come in now
 
9:53 PM
In other words, Bezos has his hands in your wallet, figuratively?
 
Bezos has his hands in a lot of people's wallets, figuratively :)
 
hmm. I question whether it's figurative.
 
1
A: Formatting all empty rows using looping

Mat's MugIf the cells can later be edited and the formatting needs to be removed for no-longer-empty rows, then your one-time initial formatting isn't going to cut it. Best setup your generated worksheet (assuming you're generating that worksheet) with a conditional format. You do that by creating Format...

 
Including my mom. I don't store mine on-site, and I use gift cards from work when I can.
 
Guys, it's official, my manager wants me to show RD to the rest of the team, there's a small meeting scheduled for possibly next Friday.
5
 
9:55 PM
nice!
 
@NelsonVides That's as good news as mine about Git.
 
@NelsonVides let us know how it goes!
(hopefully doesn't crash too much!)
 
@this Me too, but I didn't want to be too inflammatory. I hate Amazon, but it's just too handy and too futile to fight it.
 
Dim foo As Range
Set foo = Sheet1.Range("G9:I11")
Dim bar As FormatCondition
Set bar = foo.FormatConditions.Item(1)
@Mat'sMug ^ Set a manual CF and am perusing through bar that way.
More'n one way to get'r'dun.
 
(He also wants me to talk to them about good coding practices and make some presentation about it :| )
 
9:57 PM
@NelsonVides :)
 
@NelsonVides Make RD more important to them than sliced bread.
 
@IvenBach if I make it more important than cabbage we're the kings :D
 
well, well, time has come to talk about cabbage and kings and why seas are boiling hot.
 
@NelsonVides if you want to make a good impression, don't open & close multiple projects - load up one in Excel, bring up the VBE, present the features, should be good
 
mostly Polish people in the team, here this sauerkraut is like a religion xD
 
10:00 PM
expect "oooh" and "aaaah!" with the Code Explorer :)
2
make sure you cover that nifty search bar!
 
I have my Invoice Classifier ready for them, only one project and has everything: Interfaces, patterns, unit testing, excellent indentation...
 
Don't forget to go to SO and copy-pasta code so you get plenty of inspection hits.
 
IIRC "goto implementation" doesn't work very well from the CE
 
@IvenBach right, I'll also need some example of bad code to inspect it
 
@NelsonVides Look at anything I write then. :wink:
 
10:03 PM
mostly I need to study Patterns, I'm loving them and I think they're very useful for organising stuff
UI patterns, somebody slap my face and wake me up
 
I need to internalize patterns also.
 
but others are quite easier to get
 
@IvenBach I found this guy giving quite intuitive explanations: youtube.com/playlist?list=PLrhzvIcii6GNjpARdnO4ueTUAVR9eMBpc
 
The man-bun is going to be hard for me to get over. Besides that I'll give it watch.
 
10:08 PM
[rubberduck-vba/Rubberduck] build for commit d927937e on unknown branch: AppVeyor build failed
BUILD FAILURE!
> AppVeyor is claiming a build error here, involving ParseTreeInspectionBase and DefTypeInspection
 
10:25 PM
exploring through RD I've just discovered the term cyclomatic complexity... this topic is very interesting!
also, more tabs on my firefox.
 
> Yeah, I didn't take a closer look that an inspection was added. The default severity is now inside the .settings file, so there is no constructor in ParseTreeInspectionBase taking a severity.
 
@nateAtwork the link merely points to a screenshot of the Rubberduck command bar showing details about the current selection; see rubberduckvba.com and/or the links in my profile. I don't know of any other tool that has as deep an understanding of the code in the VBIDE, but I'm possibly biased ;-) — Mat's Mug 7 mins ago
we have a new fan
 
Very good video now that I'm able to understand polymorphism better.
 
@IvenBach you use polymorphism every time you run an inspection
the Inspector only ever cares about IInspection :)
and we have 60-some wildly different implementations of that interface
 
I really better understand the theory and am comfortable with it.
 
10:29 PM
:+1:
 
Now I need to code against that and become code-aware and familiar doing that.
Once the calculations are done, next week, I may be able to get back to VS/studying.
 
interesting how some people balk at the idea of typing more
less is sometimes more, but more of less is less than less of less, and in some cases, more is more than less. One has to know when to less and when to mess.
And if you had to read that sentence more than once, the point is made. :)
 
> Any specific reason why this was merged, given that the PR has a WIP label?
 
@NelsonVides A very worthwhile video. I'll make the time to watch more.
 
> I just noticed that I also moved the InspectionType into the .settings file, so at the moment it's specified there and in a property. Maybe the property could be defaulted to some value in the base class and be read from only if the inspection isn't present in the .settings file...
 
10:44 PM
> How easy something is to maintain has nothing to do with how many places you need to go to make a change. It's about how easy it is to find what needs to change.
@this ^
 
[rubberduck-vba/Rubberduck] build for commit 3963c7a8 on unknown branch: AppVeyor build succeeded
 

« first day (1328 days earlier)      last day (1852 days later) »