« first day (1690 days earlier)      last day (1490 days later) » 
00:00 - 19:0019:00 - 00:00

12:29 AM
[rubberduck-vba/Rubberduck] build for commit 18b1505f on unknown branch: AppVeyor build succeeded
 
 
4 hours later…
4:39 AM
So, my WPF CRUD app is pretty much done, which means I'll get to breathe a bit... and resume with RD. Sorry this took longer than I anticipated...
 
5:09 AM
@MathieuGuindon No worries - I'm the last person to cast judgements on a hiatus taking longer than anticipated...
 
lol
'night
 
'night
 
 
2 hours later…
6:44 AM
Max, I ran into another problem with the IProjectReferencesProvider -- since I need it on the declaration finder, the logical thing to do was to ctor-inject it. However, when I work out the injection, I realize that this causes a cycle because it is RPS that uses the DeclarationFinderFactory, but the implementations of the IProjectReferencesProvider both requires the RPS, so if I try to add the provider to RPS's ctor, that becomes a cycle. The factory is not abstract so CW is no help.
 
 
1 hour later…
8:45 AM
@this I know a very involved and a hack is way to get the IProjectReferencesProvider into the DeclarationFinder . However, I would like to avoid both.
Why exactly do you need the priority information on the DeclarationFinder?
Resolving the evaluate member sounds like something the resolver should do.
That already has access to the IProjectReferencesProvider.
 
 
3 hours later…
12:01 PM
> I'm no longer getting this issue in build .4445 on the originally reported code.
> Version 2.3.1.4445
OS: Microsoft Windows NT 10.0.17763.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.11231.20080
Host Executable: WINWORD.EXE


**Description**
Refactor rename does not use the selected identifier.

In the code below I tried to rename Logger.report to Logger.log. I refreshed rubberduck then selected the identifier 'report' followed by rubberduck.refactor.rename. The identifier in the rename dialog box was the name of the procedure 'DoLogging' and no
 
12:43 PM
> `logger` is a Variant, thus Rubberduck has no idea what `logger.Report` is - there's likely a warning log entry specifically about this.

While I agree this could *probably* be improved, it isn't a bug: Rubberduck can't know what the members of a `Variant` are.

If you have a logger interface, `logger` should probably ve declared as such - that would turn your late-binding duck-typed polymorphism (works? great! doesn't? boom, error 438) into actual interface-based polymorphism (compile-tim
 
@Duga or should RD start maintaining lists of pseudo-members depending on how a given variant is used?
Kind of like R#
 
> Basically there is nothing in `DoLogging` that even remotely hints at what the interface should be; everything being `Variant`, you get no IntelliSense for any of this, and `Option Explicit` can't spare you from a typo, since the compiler has no way of knowing what the members of a variant are. This is 100% late-bound code where none of the types are known until run-time; compile-time types are all `Variant`.

As a *static* code analysis tool, Rubberduck can't know what the runtime types are
> Hi, thanks for the super quick response. Yes, the code compiles.

> The Fakes API objects are meant to be very short-lived, i.e. the duration of a single test. Here they're alive from before the first test runs, until after the last test finished.

> These are hooks into the VBA runtime, intercepting internal function calls: them being alive for longer than they're needed is definitely not helping.

Would destroying the fakes objects right after the AdjustCell call possibly help?

Goin
 
1:11 PM
> Hi, thanks for the super quick response. Yes, the code compiles.

> The Fakes API objects are meant to be very short-lived, i.e. the duration of a single test. Here they're alive from before the first test runs, until after the last test finished.

> These are hooks into the VBA runtime, intercepting internal function calls: them being alive for longer than they're needed is definitely not helping.

I tried destroying the fakes object right after the AdjustCell call (`Set Fakes = Nothing
> Hi, thanks for the super quick response. Yes, the code compiles.

> The Fakes API objects are meant to be very short-lived, i.e. the duration of a single test. Here they're alive from before the first test runs, until after the last test finished.

> These are hooks into the VBA runtime, intercepting internal function calls: them being alive for longer than they're needed is definitely not helping.

I tried destroying the fakes object right after the AdjustCell call (`Set Fakes = Nothing
 
1:30 PM
> Thanks for the pointers. logger is a scripting.dictionary of LoggerMemberInterface objects. In this specific instance if I change

Dim logger as variant
to
Dim logger as LoggerMemberInterface

VBA throws a wobbly and insists that logger should be a variant even though it should be possible to use an object as a control variable.

Thinking about your advice I revised the DoLogging code to

```
Private Sub DoLogging(ByVal this_formatter As String, ByVal this_concern As String, ByR
 
1:40 PM
> OK. A bit of testing shows that it is an unreasonable expectation of mine that the Sub report renaming should occur.
 
What I want to do is to resolve the expression [A1] from a given line Set foo = [A1] to something like Excel._Global.Evaluate(), rather than runtime expression. Note there is also a separate case where Me.[A1] cannot be resolved until we know about the document type.
But how it will resolve will ultimately depend on the reference priority. In Access VBA project, by default, Set foo = [A1] will throw an error about unrecognized external name. But if we then reference the Excel library in the Access VBA project, that expression becomes valid because we now have Excel's _Global added to the global namespace.
And obviously, if an Excel VBA project references another Office library that provides a evaluate expression off a global class, that will not get accessed because Excel's will always take priority.
That would open up new opportunities for inspections surrounding implicit access to those global members.
 
So, what you really want is the host application and not all reference priorities, right?
 
I already have the host application. But I still need reference priorities.
Because as I said above, even an Access VBA project can be referencing Excel which would make the expression Set foo = [A1] valid.
 
When I started to write your comment about Access was not there yet.
 
ah ok
 
1:59 PM
You could somehow get the provider into the SimpleNameDefaultBinding and method inject it from there.
However, I would prefer to have a separate binding for this very special case if possible.
 
I see.
Then I'll need to understand a bit more about how the resolver is composed.
It looks like it's only used by DefaultBindingContext which eventually gets new'd up from ReferenceResolveRunner through 3 different ways. It looks like the runner is CW-provided. So even if I were going to make a new binding, I'd end up needing to ctor-inject the runner, pass it down through the DefaultBindingContext to ultimately provide to it. Same thing even if I elect to use a factory.
I think I see the problem - it is used in the DeclarationResolveRunner
In other words, it's trying to treat the expression [A1] as a reference, rather than a declaration.
 
2:18 PM
> I spent some time trying to replicate this locally with the provided code (and with a couple other scenarios inspired by the log file) and haven't been able to cause a crash in Excel 2013 x64. When Excel crashes, it should be generating a application crash event via Windows Error Reporting. Can you track down a sample WER log and post the contents here? You should find it in the Event Viewer under Windows Logs -> Application. There can be a lot of traffic through there, so you may want to f
 
3:05 PM
wew i went house shoppin this weekend
 
@Duga @Comintern very nicely explained
 
I need to motivate myself to write user documentation for that.
That said, I'd still like to track down why it crashes - if for no other reason than to harden it against user abuse.
 
It might not be related but I think it might be good idea to wrap the unit test in a suspension action -- I don't think they are currently.
(though, the inspector itself needs to respect that, too since it kind of marches to its own drummer)
 
I'm fairly sure that didn't exist when they were implemented.
 
nope. it was added sometime during your hiatus
Sanity check --- when is an expression a declaration vs. a reference? I'm thinking that for the expression [A1], which the full form should be Excel._Global.Evaluate("A1")... That's a reference, not a declaration, right? I suppose A1 could be considered a literal declaration, though.
 
3:25 PM
depends on context
 
That would be for a given code Set foo = [A1]
but if we're doing [A1].Value = "foo", does that change anything?
 
FYI that's quite a rabbit hole you're stepping in
 
Falling into.
 
heh. yeah I'm seeing that. :)
 
3:26 PM
^
 
Head first.
 
Originally: this is easy! We know all evaluate. Just filter by reference priority
Later: this is a nightmare! Why did I do that to myself
But that gives me a excuse to learn a bit more about the resolver which has been a black hole to me for a while.
 
[A1] is neither a Declaration nor an IdentifierReference, it's an implicit argument to an implicit member call on an implicit object
but [Something] can be a Declaration too, if it's a bracketed identifier
like, some Enum member
 
@MathieuGuindon which IMO, should be resolvable.
 
and then foo = [Something] is an IdentifierReference to that declaration
@this to what though?
 
3:29 PM
The plan is that if we can't resolve to any existing declaration (e.g. an enum member), we can assume that it will address the evaluate member.
 
In theory, if it resolves to an evaluate call then Something would be a string literal, and the [ ] pair would be an identifier reference on the evaluate method.
 
need to check how it prioritizes the resolution
I think if there's an enum of same name, that may go first.
but if there's nothing matching, then we can reasonably conclude that it has to be using the evaluate member of the class.
 
Good thing they have about 2 sentences about this in the spec, right?
 
IKR?
They don't even discuss "external name" in the specs at all.
 
It doesn't?
 
3:33 PM
You sound surprised.
 
3.3.5.3 Special Identifier Forms
 
guts say it tries to resolve the identifier in the same order as anything else: local scope > module scope > project scope > refs in priority order > eval
 
The spec calls it a "foreign-identifier".
 
[_Global]
 
@Comintern oh ffs
#protip: don't rely on them to use terms consistently.
 
3:34 PM
IKR?
 
@MathieuGuindon correct. That also means that for a expression on a say, a Worksheet (which I think has its own evaluate member), that evaluate will be the one used, not Global's.
For that case, we need the typelib api.
I thought I'd start with the simpler case of a standard module referencing a evaluate member of a global class.
because I suspect that the finder may need to cache the evaluate members from all classes for easy lookups/inspections
 
so, local scope > module scope > project scope > refs in priority order > module eval > global eval
hmm, that looks weird
needs proof
 
As I mentioned earlier to Max - in an Access VBA project, Set foo = [A1] on a standard module would be an error.
saying something about external name not found.
Add Excel reference and it start working.
Add Word? Outlook? reference and try to use their evaluate - fail because Excel doesn't know what to do with it.
 
IMO the value in this is mostly with the TON of bracketed identifiers in Access VBA code. Are you trying to resolve them to, say, field/table names?
 
that'd be one.
 
3:41 PM
The declaration finder already has the evaluate member declarations.
It just does not resolve bracketed expressions accordingly if they do not refer to the host.
@this Why would you inject the ReferenceResolveRunner?
 
@M.Doerner where? I don't see it defined on the finder unless it's not using evaluate in its name?
 
It has the declaration since it is in the referenced library.
 
@this Evaluate members exist the same way Range members do
 
@M.Doerner Because that is where the OnBracketedExpression is called from. The declaration runner has the IProjectReferencesProvider but reference runner does not.
 
they're data
 
3:45 PM
There is no method to find them specificly.
 
@M.Doerner ah yes - it does, I meant a pre-filtered method on the finder to help with resolving them depending on the context.
 
Then pass the provider to the newed up resolver that then can pass it on until you reach the bindings.
 
so basically what we're looking at is 1) stop creating Declaration for bracketed identifiers as a fallback; 2) resolve bracketed identifiers as implicit (?) IdentifierReference (?) to whatever Evaluate method is appropriate for the context. Right?
 
Then you can method inject it from there.
 
Yes, that'd be one way. But I'm not sure yet if this still needs to be within the reference runner, which why I was asking if it should be considered a declaration rather than a reference.
@MathieuGuindon Correct.
the original method we have will still be the fallback.
 
3:48 PM
For enum members, we still need declarations.
 
we'll just try to bind it to the evaluate member if we can.
 
Speaking of enum members (and completely unrelated), can you set up EF to create tables for public enums?
 
and treat the bracketed name as a String literal?
 
EF = entity framework?
 
3:49 PM
@Comintern IIRC that was introduced in EF6, but I haven't used it
 
OK, cool. I'll need to check our versioning.
 
oh you did say "unrleated". :)
 
@MathieuGuindon I'm pretty sure that's how they're handled internally if they resolve to an evaluate call.
 
@MathieuGuindon I didn't think that far ahead. I think the status ought to show the fact that it's a Excel._Global.Evaluate("A1") when you are on [A1]
 
The bracketed "code" is converted to a string and passed as the argument.
 
3:51 PM
so I don't see a purpose in creating a string literal declaration.
 
We use them elsewhere.
 
?
 
Worksheets([A1])
^ accessed by string literal.
 
that's nasty
 
Maybe... it could be a numeric index, but still.
 
3:52 PM
isn't that actually Worksheets(Excel._Global.Evaluate("A1"))
 
^^
 
[A1] returns a Range
 
But that is just composition of function calls, right?
 
I think that would result in a default member call.
 
the point being, it'd be wrong to report [A1] as just string literal.
 
3:53 PM
We do not create declarations for literals anyway.
 
I suppose that answers my question - I should be creating references.
which makes more sense the more I think about it.
 
We do get a context for string literals though. Although I'm not entirely sure how often we use .GetText() to determine the content of a string literal.
 
@Comintern yes
IMO resolving the correct square-bracket expressions to the correct Evaluate call is one thing; resolving say [A1] to a Range (or [Field1] to a table fied) is a wild other.
 
that's a case of binding to the evaluate member of the class.
 
Agree. That was probably a bad example (and I'm not really sure we care about the text).
 
4:02 PM
@Comintern We have an inspection for "" for empty string literals.
 
[]?
Now I'm curious if that's legal.
Sub Foo()
    Debug.Print []
End Sub
^Compiles and runs.
 
that ain't right, man.
 
Now I'm curious if I can abuse that.
 
like building your string interpolation class? ;-)
 
Yeah, right.
Maybe for VBAORM...
 
4:23 PM
Or maybe I should call it Visual Basic Editor Entity Framework. "VBEEF"
 
who's got the beef?
 
V?
 
the guy w/ Guy Fawkes mask?
didn't figure him as a VBA coder.
 
No, it's a bunch of reptilian aliens.
 
oh, that TV series. Yeah. you'd think they'd be more partial to leafy greens...
 
4:28 PM
I'm trying to envision a snake swallowing a whole cow now. It's a bit disturbing.
 
what about Dynamic Expression And Dynamic Batching Empirical Entity Framework?
 
lol
 
4:47 PM
@Comintern I saw a video of a snake swallowing a whole deer once.
It then spat it back out. Apparently the deer recovered.
 
A deer? We're talking about anacodas, (speeling) right?
 
I think it was a python.
One of those imported plague ones or something.
 
Honestly I don't see how it can even do that.
 
It was in the US.
 
it's too small.
 
I recall reading an article where crocodile and a python tried to eat each other. The python ate it but then it guts busted. Both died.
 
I was right. One of those Bumese Pythons.
 
a deer is a tad bit bigger than a crocodile...
and its antlers probably won't help.
 
@CindyMeister OP is asking about an "Else without If" compile error, so there had to be an Else somewhere. I'm trying to be helpful and welcoming and empathetic, since apparently Twitter thinks SO is such a toxic place to ask programming questions and explaining to people how to correctly ask questions on SO is "everything that's wrong with tech today". That said I agree I did infer stuff. If that's wrong, OP can roll back or edit to clarify further. — Mathieu Guindon 2 mins ago
 
@this Not once the legs are folded back against the body.
And it was a doe.
 
4:50 PM
damned if you do, damned if you don't
looks like the response to that Twitter thread last week still hasn't healed completely
 
Twitter is hardly a forum for healing and moderation.
2
Want to get angry? Distressed? Sad? Twitter's there for you.
 
All I can say is that I try to not contribute to SO unless it's an ancient zombie that I found the answer to after a day or so of searching.
 
@MathieuGuindon that tire fires going to be there a looooong time.
 
^
 
They want to cause a scene. Give them one by dropping your drawers and moon them.
Not the most mature response but what can you do with illogical or easily provoked pineapples...
 
5:00 PM
@IvenBach It'll kill his chance to be PM of Canada.
 
I'd say - "Happiness is a choice. I'm sorry you didn't choose to be happy."
 
that's pretty much what my thread concluded: "your SO experience is ultimately what *you* make it"
 
in Coding Projects and Factorio Heaven, Jan 18 at 3:12, by Hosch250
@IvenBach LOL, I'm almost tempted to bait them. Using their own #CauseAScene hashtag.
 
I haven't had any more notifications, what did the thing keep going?
 
> @ATolokolnikov - Thanks, that worked for me. Had to make the modifications for 32-bit, but still worked perfectly. :+1:
 
5:12 PM
@MathieuGuindon There was another one?
I thought this was still from last (september?)
 
nah, I posted a 20-tweet thread about asking questions on SO as a quote-tweet response to some thread that was SO-bashing... got pretty ugly, pretty fast.
 
Ouw
I'm almost morbidly curious, but I'll refrain, for my own sanity
 
getting quote-RT'd with "This thread is a perfect example of everything that's wrong in tech" was particularly pleasant
 
whole situation since the first tweet last year is sort of like the "Springfield Tire Fire" just perpetually burning, sometimes ignored
Ahh yeah the good ol "I have no energy or ability to react constructively to this so I'll just mock it and be condescending about it"
 
now for something completely different --- I'm looking at using API that's metered. and it occurs to me that if I make unit tests around the API, that could cost a bit too much, even if we use a small test dataset. Would it be more correct to consider such tests an integration test or treat it as basically untestable?
 
5:22 PM
Depending on the API testing plans might be available with fixed data sets
I remember google doing something like that
 
ooo. I might look into that. Maybe maintain a separate account for testing purposes
they do have a free plan for development purpose.
 
I'd wager that testing on a different data set is a lot better then no testing at all
 
Yep, agree. Even though it's an external API, we do have to verify our implementation is behaving correct.
 
especially in a metered APi
you could run into a very expensive bug
 
Fun stuff gents, i might be going and getting a marriage licence tomorrow
 
5:25 PM
I guess I might consider it integration testing, though - no point in running it as part of build process.
Congrats, @KySoto!
2
 
I mean, yeah
 
> Thanks so much for spending time on this! Learning a lot about VBA and Rubberduck
The crash event log is attached.

> If you use them in the initialize code, Rubberduck will call it a single time during the test run, but the 2 faked calls become eligible for garbage collection as soon as ModuleInitialize exits. GC is non-deterministic, so it's impossible to predict what the state of the hook will be after ModuleInitialize exits.

OK, good to know. The event here is triggered within module
 
thats what integration testing is basically
 
We have been putting it off for a while, but to apply for our VA loan to buy a home, we have to be married
also, thanks.
 
5:26 PM
on a VBA note, I have a monstrous entity of a ERP and lab system that will just not develop for me
 
Yeah, now I think about it, I can see doing this as a part of the release CI
 
oh erps...
 
I can't edit code, it won't compile, debugging run time errors crashes the debugger. Access 2003
 
That should keep the usage on the metered API (even for a free plan) under control.
 
thats ugly
 
5:27 PM
@Magisch have you DCCR'd?
 
@Duga :facepalm: What's the most tactful way to yell "YOU'RE DOING IT WRONG".
 
DCCR?
 
Decompile, compile, compact & repair
 
yeah ive had that fix issues before
 
it wont decompile
 
5:27 PM
what?
 
access stops running when I try
 
serious?
 
yea
 
OP's computer is a Sagittarius apparently. IIR mine would be a Gemini.
 
That thing is undebuggable
 
5:28 PM
something new....
 
so you opened access with the /decompile flag and it fails?
 
from command line yeah
 
what about making a new blank file and importing everything from the borked file?
 
have you tried importing everything?
 
we usually do this with releases for our other ERP software
 
5:28 PM
dang you typing faster than me
 
I might try that next, but it's over 400 forms and 200k LOC
 
select all is your best friend?
 
I have a hunch you have a corrupted object somewhere in that codebasde
 
unfortunately the original developer uses On Error GoTo as substitute for conditionals
 
man..
is that access file your ERP?
 
5:29 PM
of a subset of the company yeah
 
Interestin...
 
because it kinda seems like it should be split apart
 
we're on track to replace it soon
 
> Exception code: 0xc0000005
Isn't that access denied?
 
We have a new homebrew web based system that's a lot more granular and malleable, using the mvc principle works really well in doing most of what access does
we're just not done with porting yet
 
5:31 PM
still, even if porting is going to take a while, I think importing ito a new file should not take more than 1 or 2 hours
 
in particular the legacy system has a giant memory leak that somehow happens whenever you use the file upload utility in it, it accesses network shares and does a bunch of strung together and improperly escaped command line calls, so things like putting spaces in file names make it die
 
probably do it one by category (form first, then queries, etc.)
hmm, also you said 200K LoC.... have you more than 1000 modules in total? (counting modules from forms & reports as well standard/classes)?
 
Not at work to count right now, but sounds about right
 
you broke the specifications
 
the file upload thing is basically a badly implement laboratory management system based on network shares and some internal tables
 
5:33 PM
it's documented in the Access specifications that there can only be a 1000 module limit
but the thing is that it's a soft limit
e.g. 1001 module won't result in an error
 
I dont blame the original developer
he wasn't a coder but someone from the lab that got told "you make this erp system now"
 
but what happened (at least for me) was that the 1001th module woudln't "load"
lol
we get that all the time.
 
The thing also has multi-overloads in it
e.g reusing function names and variables in overlapping scopes
sometimes the runtime errors resulting from accessing them are used to detect which form a function is called from
 
i'm sure that helps, too.
 
this thing sounds like an out of control dumpster fire
 
5:36 PM
That 1000 module thing is news to me though
our other system should be getting close to that too
 
yes it's documented in the access specifications
 
< never had a formal education in vba dev
 
IDK if that's a VBA thing or Access thing - I have not seen that documented in other VBA applications but I don't have any other host application project that has >1000 modules.
and as I said, it seems to be a soft limit, which makes it especially insidious.
 
The management got really spooked by the "access 97 doesn't work anymore" bug in the latest win10 update
 
uh, the EOL didn't faze them?!?
O_o
 
5:38 PM
That being said, I can see how modules not loading could lead to the issues we're having it
I mean, we're still primarily using access 2003
and the lab computers are mostly xp
 
lol... obviously.
it's just that I think it's criminal for a business to blithely ignore EOL like that.
 
pure business calculation
new versions of office are expensive
 
Or at least if they instead on ignoring it, to not upgrade at all (and pay for it dearly)
 
if the old system still runs and does what it needs, why upgrade?
 
Hence my other point - don't upgrade anything else, including the OS
 
5:40 PM
for most of the pc's we don't
the lab machines can't actually go higher then win xp even
 
are they on VM?
 
they're connected to and have proprietary software of other industrial equipment that doesn't run on anything higher
 
they should be at least on VM (assuming the networking does not become an issue for those funky hardware)
 
they're not connected to the outside world
 
that way, you can upgrade hardware without having to upgrade the software
 
5:41 PM
even got their own network
 
no, I wsa talking more about the networking between the VM and the equipment
 
I'm pretty sure we tried that and it didn't work. A lot of the PCs are custom built to fit with the machines
some of these machines are extremely high precision measuring equipment
 
ooooo harsh
that's bad news because if the PC hardware futzes out, you might not be even be able to replace the hardware. That's why I mentioned the VM idea.
 
we have a large stock of replacement parts off of ebay
been buying them up
 
LOL
Ok, sounds like your company did their due diligence, then. :)
 
6:16 PM
man i feel lucky, we dont have to support access on any of our ancient computers we use for part testing
or other production activities
 
> Depends on to where it gets moved.

Remember the objective is to test your behaviors in an *unit*, so you want to eliminate all the event handling and dancing with the documents. For a good example of this, see [this blog](https://rubberduckvba.wordpress.com/2017/12/08/there-is-no-worksheet/).

For your unit test to be independent, you will want to be able to invoke the sub directly without using events. Thus, moving your sub to a private sub on Excel worksheet won't do anything for you.
 
6:58 PM
I'm curious how many SO questions on the VBA tag would disappear if there was a requirement to read the "How to avoid using Select in Excel VBA" question before it let you post.
 
half
give or take
and half the other half would vanish if running RD inspections was mandatory
 
:-D
 
that would leave only "I need XYZ, please gimmeh teh codez"
 
I bet you could get something to analyze the VBA code and get a good accuracy on whether it's made from a macro recorder vs. written by a human.
 
00:00 - 19:0019:00 - 00:00

« first day (1690 days earlier)      last day (1490 days later) »