« first day (1000 days earlier)      last day (2180 days later) » 

6:01 PM
for CR is it acceptable to list your own answer with updated code?
 
depends. do you want the updated code peer reviewed?
also, answers should look like reviews - self-reviews are perfectly fine
 
> Got a repro (hung test explorer) with an unsaved workbook:

````
2017-03-02 13:04:50.9325;ERROR-2.0.12.19847;Rubberduck.UI.Command.RunAllTestsCommand;System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , ComObject , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,
 
@Mat'sMug codereview.stackexchange.com/questions/156495/… has no problems according to CR if my answer is an update to my own original that's still seeking review?
 
> Got a repro (hung test explorer) with an unsaved workbook:

````
2017-03-02 13:04:50.9325;ERROR-2.0.12.19847;Rubberduck.UI.Command.RunAllTestsCommand;System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , ComObject , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,
 
@IvenBach if you want the revised code peer reviewed, it should be a new question (linking to the original), not an answer
or, you can make that one "community wiki"
 
6:13 PM
@Mat'sMug The original quest the community wiki or the updated answer?
 
the answer. I just made it CW
all the details are here
 
> Got a repro (hung test explorer) with an unsaved workbook:

````
2017-03-02 13:04:50.9325;ERROR-2.0.12.19847;Rubberduck.UI.Command.RunAllTestsCommand;System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , ComObject , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,
 
@Mat'sMug Thanks for that. I guess I'm willing to sacrifice future reputation points for helping someone else.
 
6:30 PM
> Code before:
```
Sub TestRDMoveCloserToBefore()

Dim someRange As Range

Dim someOtherRange As Range


Dim someRange As Range
Set someRange = Selection

Set someOtherRange = ActiveWorkbook.Sheets(2).Range("A1")

Set someRange = someRange.Resize(someRange.Count)

End Sub
```

Code after: `.Resize` is gone as is `.Count`
```
Sub TestRDMoveCloserToAfter()

'Moved someRange
Dim someOtherRange As Range


Dim some
 
Yeah... That's the kind of stuff that scares me.
 
> Turns out I had an EXCEL.EXE process lingering in Task Manager (and Rubberduck was loaded in that other process) - killing that ghost process and restarting fixed everything, the tests run, life is beautiful... and I don't know how to repro anymore :disappointed:
> :fearful:
> No, no precompiler directives.

I really have a feeling that I ran into this last summer and reported it then, but haven't been able to find an issue (open or closed) on it. It could just be weak gitfu on my part.
 
gosh we need that rewriter API
and I need to have lunch
 
So is that issue MCVE good?
 
@IvenBach yeah
 
> `someRange` is declared twice in the top example. Is it possible that the refactor is running _twice_ without updating the selection cache? Note that even though the "Before" code doesn't compile due to "Duplicate declaration in current scope", the RD parser has absolutely no issue with it. That means that every usage of `someRange` has too many references pointed at it:

![untitled](https://cloud.githubusercontent.com/assets/8944005/23521835/40bc7a78-ff46-11e6-8e82-cadcff87d20c.png)
 
If that's not fixed by Saturday I'll disable it for .12
@Duga hmm
 
> @comintern shouldn't that throw a resolver error?
> I stand corrected. The top declaration has zero references:

![screenshot from 2017-03-02 12 49 45](https://cloud.githubusercontent.com/assets/8944005/23521927/be3c43de-ff46-11e6-8ee5-3710466141b9.png)
 
@IvenBach does it repro with compilable code?
One assumption RD has been making from the start is that we're working with compilable code
 
6:52 PM
I think that additional Dim is from me not Undoing enough
 
> Looks like the extra Dim someRange as Range was from me not Undoing enough from a first move. I can't get it to reproduce the error now. When I do run it without the extra Dim it works fine.
 
chat.stackexchange.com/transcript/message/35778358#35778358 I'll plan on being there if at all possible. I'd mostly like to "listen in", though I might have something to say
 
> Looks like the extra `Dim someRange as Range` was from me not `Undo`ing enough from a first move. I can't get it to reproduce the error now. When I do run it without the extra `Dim` it works fine.

Can't figure out how I got that to occur in the first place.
 
@Duga @Mat'sMug - It should, but apparently it isn't. I suspect there's a FirstOrDefault somewhere that should be SingleOrDefault.
 
7:03 PM
@Comintern or it's the caching mechanism happily replacing the first declaration with the second it comes across in the declaration resolution pass.. in which case I'm not sure there's a possible fix for that.
 
@FreeMan Nice. It's really helpful to get feedback from people who aren't looking at the project from the inside out.
 
Wouldn't they have to be 2 declarations? I'm not sure how else one could have 4 references and the other zero.
 
IIRC the selection isn't part of the hash code computation, specifically so we can tell a declaration has moved 3 lines down
wait, something's fishy
if it were replacing one with the other, the first one wouldn't even exist
 
Doesn't the resolver check for declarations in scope though? It should be able to figure out that there are too many identical identifiers with the same scope.
 
7:07 PM
not sure it does
 
Declarations wouldn't generate references to other declarations.
There's a ton of calls like var match = accessibleModules.FirstOrDefault(); in the declaration finder. Not clear why it's picking second instance the when it adds references though.
 
they warned us about IEnumerable<T> not guaranteeing order ;-)
 
lol
 
Regex Assistant: Could that show whitespace characters <space> <-- like that?
 
TBH, I'm not sure how much I care about resolving non-compilable code.
 
7:11 PM
^
@IvenBach probably ...how does it display them?
regex assistant needs a regex builder enhancement
 
a "<space>" is shows as " " and it's kind of hard to see
[0-9]{3}[ -][0-9]{3}[ -][0-9]{4}
 
It should probably be \s.
 
^
I never use whitespace in a regex.. didn't even realize a regex matched whitespaces
 
That shows up with [ -] as Matches ... : , - exactly once.
 
I don't either - for that exact reason, but it does match them.
 
7:14 PM
Can't really see the whitespace and some visual notation of it would be nice.
 
@IvenBach that could be fixed to show e.g. [WS]
but I wouldn't alter the actual regex pattern
should be a pretty easy fix
 
The pattern I agree with but the result, for those like me that rarely use it, would be nice to have a toggle that allows you to see \s or whatever the resultant would be.
 
definitely
 
When I saw that it took me a bit to realize that there is a space comma space dash
 
make it an issue :)
 
7:17 PM
I think actual regex would be better. Does VBScript Regex support \x20?
 
I think so
 
Not that \x20 is any more readable...
 
> Have a toggle that could convert whitespace to \s in the description. Helps for those like myself that rarely use them and don't have everything memorized. [0-9]{3}[ -][0-9]{3}[ -][0-9]{4} as an example where whitespace may be used.
 
7:31 PM
> Another option for this would be to display a warning - something along the lines of "Warning - regular expression contains embedded whitespace".
 
@Mat'sMug way back in the COBOL days, the old farts used to represent a space by a lowercase b with a slash / through it. That's when a lot of code was written before being typed... According to wiki such a beast doesn't exist, though...
@Comintern may not be all that readable, but it lets you know that something is there!
of course, these were the same old farts who read IBM documentation that had [Page intentionally left blank] printed on a page that was no longer blank.
 
[This text does not exist]
 
^^ exactly!
 
Has there been an issue with Code Inspections changing the case of module names?
I have one that says PurlinSubs but in Code Inspections it's listed as PurlinsUBS
 
Huh, that's a new one... I don't see how it could happen either, we take identifier names verbatim AFAIK
 
7:44 PM
â“¢ circled latin small letter s 022342 9442 0x24E2 &#9442;
That might work as a space marker
from here for the column headers if you don't instantly recognize them.
 
I wonder if I missed a corner case in the string.Captialize() extension.
 
might need a footnote explaining it...
 
I can't upload the image it seems.
 
imgur has been flaky these past few days
 
7:50 PM
You don't work for Union Bank of Switzerland do you?
^joke
 
Um... No?
Code Inspection doesn't have any identifier for group by location where it tells you if it's a Module, Workbook, Worksheet etc...?
 
^That would be nice. We'd probably want to sort out the result load-time first though. I'm not exactly sure how the grouping relates to when the inspection results are materialized. I need to work on my WPF-fu.
 
Want me to add the issue?
 
Yep. I'd go for that.
 
@IvenBach for a while, imgur had been blocked by our IT overlords. photobucket still is. Is OK, if I really wanna see your picture, I just fire it up on the phone not on corporate guest wifi... :)
 
8:04 PM
> Code Inspection doesn't have any identifier for group by location where it tells you if it's a Module, Workbook, Worksheet, etc...
 
@FreeMan I want to supply as much info to bugs as I can.
Off to lunch for a while.
 
@IvenBach oh, indeed, please do! I was just commenting on our stupid IT policy. :)
 
I thought we supplied the bugs and you consumed them.
2
 
LOL
 
Hakuna Matata
 
8:14 PM
Any idea how a TSQL UNPIVOT compares to UNION SELECT for efficiency in the execution plan?
Pivot is on an indexed field.
 
You have two horses...
race them?
 
Problem is that I have one horse standing here and I've have to foal the other one.
The real answer might be that I just don't care until somebody complains about it...
 
^
when in doubt, go with the more readable/maintainable solution
 
Unfortunately neither is readable or maintainable - the DB in question is like -5NF.
OK, it's official. I don't care.
 
8:23 PM
> makes no sense from my perspective ... Both alternatives are equally valid. We can unfortunately not assume anything about what the user actually wants ... If you deem this necessary ... well do what you please. You're looking for LiteralExpressions where the Specifier equals " "
> @Vogel612 the use case is that in the *what the regex does* part it's hard to tell when a whitespace is being matched.

> Matches ... : , - exactly once.
 
hi
 
hi!
 
sup mat
commant ça va? @Mat'sMug
 
8:42 PM
busy as hell :)
 
8:55 PM
@Comintern I used to work there. We always used to put U before the BS.
 
@ThunderFrame They're a big F1 sponsor. Now I'll see that at the side of every track this coming season. Thanks for adding a good laugh! :)
 
UBS?
is that a bank?
 
they once owned all of the sub-prime debt ;-)
Union Bank of Switzerland
 
Don't they prefer Über Bank of Switzerland?
 
lol
I gather references are parsed in parallel to projects. I need to know the member names of an Access Form/Report class, before I parse the controls (because naming conflicts). I guess I could just hard-code the names in a list.
 
9:02 PM
They're not to blame. It's those people that sold them the debt in the first place (and they committed fraud).
 
@Jelly UBS were selling it too, but I suspect, fell for their own pitch.
 
hahaha
You don't shit where you eat.
 
>
High quality global journalism requires investment. Please share this article with others using the link below, do not cut & paste the article. See our T&Cs and Copyright Policy for more detail. Email ftsales.support@ft.com to buy additional rights.
https://www.ft.com/content/d4e0b92a-0f69-11dd-8871-0000779fd2ac

UBS admitted on Monday half of the $18.7bn writedowns it suffered last year on US subprime securities had stemmed from the decision by traders in its investment banking division to hold, rather than repackage and sell, one particular category of security linked to US residential
 
Bad Bad Bad debt.
An Chinese investor buying the mortgage of a 15 year-old home owner.
 
9:21 PM
looks like Corel 64-bit is running into the same problem as Excel 2002, when trying to set the enabled state of a CommandBarButton.
 
@Comintern There's a limit to how many bugs a day you should eat.
 
(My Corel is X6, which was released around 2012, but like SolidWorks, it may use an older version of CommandBars)
 
Are the Code Inspections resolved according to Grouping Type? IE if you have several Dim Module level variables will it only replace those Dims with Private in that module exclusively or will it do the entire project?
 
2017-03-03 08:26:24.2907;ERROR-2.0.12.14876;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run. (thread 14).;System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.CommandBarControl'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000C0308-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
^^ log shows errors on properties Enabled, Visible and Tag
was that a @Gareth drive-by I saw earlier?
@Mat'sMug he must have heard you were disabling ExtractMethod in .12
 
9:40 PM
Well, I would definitely prefer not to, but it was never adjusted to work with the COM wrappers, and there are some serious bugs we seemingly can't address without slashing through the code, ...and I can't see how the UI/preview can fit in
 
10:00 PM
> I cannot repro the COMException.

At the point of the exception, the `components` collection contains the components found on the projects saved on the `RubberduckParserState`. These gets refreshed right before querying them.

The only thing I can imagine causing an error there would be the component not getting removed fast enough from the `IVBE` object. In that case the handler of the component removed event would be the problem.
 
IKR - just saying it's funny timing that he chimed in
 
10:14 PM
> Then the request makes even less sense ... `\s != " "` ...

whitespace (`\s`) depending on the exact specs includes tab, horizontal tab, non-breaking whitespace and other peculiarities. ...
Pretending one is the other in *what the regex does* is simply wrong. The correct fix for that use-case is a different formatting or a special enclosing. RD does generally use `'{0}'` and similar constructs. This seems adequate here ...
 
10:26 PM
> @Vogel612 fine by me, it addresses the concern!
> @MDoerner - The IVBE events aren't tracking individual `VBComponents` anymore, so this one is a bit puzzling. The 0x80070006 error is an invalid handle, which points toward the `VBComponent` having been released. The `ComponentEventArgs` do include a reference to the `VBComponent` that was removed, so I could envision a scenario where the underlying component is destroyed before the wrapped one gets to the sink. I _suspect_ that the Logger is to blame:

`Logger.Debug("Component '{0}' was
 
@Duga oh wow, that'd be dumb
 
> @comintern It is not the logger. `RemovedModuleDeclarations` in the call stack above explicitly queries the names and helpfiles of the parent (projectID) of the components to get something to match them to the module declarations.

However, if a component got removed, it should not be in the `components` collection at that point.
 
@comintern If the events are not tracking the components, how and where do they get removed?
The ParseCoordinator assumes that all components exist which it can find on the projects after refreshing the projects collection on the RubberduckParserState.
What threw the COMException was the code cleaning up the state cache for the removed components.
 
10:54 PM
@M.Doerner The VBE actually only has a single VBComponents event sink that's common to all projects. It basically just starts listening when we start up and stops listening when we shut down.
It's basically like a broadcast event.
 
11:19 PM
StackOverflow Excel questions are basically "Here's my barf, make it work for me" while those on CodeReview are "I've tried this. How can I improve / What am I Missing?"
I'm not alone in feeling that way, right?
 
right
Is VS2013 still the recommended version or is 2015 OK?
Also, I seem to recall something a while back about not applying patches/fixes/updates to VS2013. Do I recall that correctly and does it still hold true?
 
@IvenBach you get "here's my barf" if you're lucky - often it's just "I need XYZ didn't try anything don't want to pay for a dev PLZ HALP THX"
@FreeMan 2015 is ok, 2017 is just releasing
 
should I update/reinstall, or just keep on with 2013?
 
@FreeMan no idea, 2013 works fine here =)
Go with 2015
 
I'll keep that in mind! :)
i.e., I'm not going to mess with updating right now.
time to mess around with der test explorer first
hrm, seems that adding a test module should at least include an '@folder Testing or similar...
 
11:39 PM
> @MDoerner - You're right - I wasn't reading the call stack, I was focusing on the execution path backward from RubberduckParserState.Sinks_ComponentRemoved. The VBComponents sink should be blocking on the main thread, so unless something screwy is going on in the RCW the source object that gets passed to VBComponents.OnDispatch shouldn't be destroyed by the VBE until after the event handler exits. Is it possible that removing the component is generating multiple reparse requests?
 
@Comintern Now, I am confused. Does this mean that the component stays visible on the wrapper for the VBE until the handler exits? That would explain the problem: the parsing run runs on a background thread.
 
It's supposed to.
In an STA thread, there's not really such thing as an asynch event handler.
 
The assumption in the ParseCorrdinator is that all components it can see when it starts, still exist when it finishes.
 
That's the assumption behind COM event sinks too. That's why I'm as confused as you are.
 
Then we have a race between the ParseCoordinator refreshing the projects collection and getting the components and the component actually beeing removed.
 
11:48 PM
The RCW shouldn't be decrementing the reference for the component that was removed until it goes out of scope in the handler.
Do you think it would help to pass a hard reference to the VB.VBComponent instead of the wrapped one?
 
Then the problem might be the refesh of the projects collection. In the precess, all old references to the components get wiped.
IDK, what the ParseCoordinator would expect is that the component is already gone when it starts the new parsing run.
 
I'm actually not entirely clear on the order the events are supposed to fire when a project is removed.
I'd think all of the component events would fire first, then the project event - any other order would implicitly assume that the VBE could pass null objects as sender parameters to the callbacks.
 
That order would make the most sense. However, this is the VBE.
 
Also keep in mind that the RCW deliberately sidesteps the STA model.
 
WHat is actually the use of the parser state None?
When I add modules to the reparse that are not in the ready state, should I also exclude that state?
 
11:55 PM
It's useful for the program state where the parser hasn't finished injecting on startup.
Some of the UI objects cache a parser state, so it's basically used as a "null" state.
 

« first day (1000 days earlier)      last day (2180 days later) »