« first day (1502 days earlier)      last day (1678 days later) » 

12:00 AM
RELOAD!
[FreezePhoenix/XtraUtils] 1 commit. 128483 additions. 1574 deletions.
[rubberduck-vba/Rubberduck] 29 commits. 8 opened issues. 4 closed issues. 39 issue comments. 64773 additions. 43022 deletions.
> Note that the fix in the upcoming PR is specific to the issue of RUBBERDUCK_TEMP_PATH not existing. I'm assuming there are other "unsafe" file writes elsewhere in the code that need Path.Exists tests.
 
12:30 AM
> For reference, from the VBA spec:

> If an <untyped-name-const-item> does not include a <const-as-clause>, the declared type of
> the constant is the same as the declared type of its <constant-expression> element. Otherwise,
> the constant’s declared type is the declared type of the <BUILTIN-TYPE> element of the <const-
> asclause>.

Note this this also needs to be aware of type hints:
```
Public Sub Temp()
Const foo = 12&
Const bar = 12
Const baz& = 12 '<--No inspe
> For reference, from the VBA spec:

> If an &lt;untyped-name-const-item&gt; does not include a &lt;const-as-clause&gt;, the declared type of
> the constant is the same as the declared type of its &lt;constant-expression&gt; element. Otherwise,
> the constant’s declared type is the declared type of the &lt;BUILTIN-TYPE&gt; element of the &lt;const-asclause&gt;.

Note this this also needs to be aware of type hints:
```
Public Sub Temp()
Const foo = 12&
Const bar = 12
Const
 
12:56 AM
> This appears to have already been fixed:

![screenshot from 2018-07-16 19-52-23](https://user-images.githubusercontent.com/8944005/42790678-015ca732-8932-11e8-8db8-9a08b255da18.png)
> Ref #4080
> Both identified issues appear to have been fixed:

![screenshot from 2018-07-16 20-04-59](https://user-images.githubusercontent.com/8944005/42791043-b7478228-8933-11e8-90d3-1260bee58a17.png)
> I can't replicate this in Word 2013. Is this still an issue for Word 2010 in the current build?
 
2:04 AM
> Unable to reproduce but capturing anyway.

Working with VBA IDE open on 1 monitor, MS Word 2010 open on another. I was editing and testing a userform in the IDE. Then I shifted focus to the open document selected some text and pressed delete.

INSTEAD of deleting the selected text a control from the userform was deleted. I used the arrow keys to try and move the cursor on my document, but doing so shifted focus to other controls on the userform. I selected some other text in the document
> This is related to the attaching and detaching of subclasses to MDI windows being broken. The work-around is to close and reopen the module.

Ref #4080
> @comintern I can confirm that I'm no longer able to reproduce this issue on the same PC that it was originally noticed on.
> Duplicate of #3907.
 
2:52 AM
> Closing the issue because it's mostly likely stale at this point.
 
3:05 AM
> Closing this because this no longer applies - the issue came about due to the limitations of `Application.Run` but we are no longer using it -- ref #3778

Tested with an excel workbook:

`C:\Users\USER~1\DOCUME~1\SQLSER~1\VULNER~1\MORELO~1\EVENLO~1\MOREBL~1\AExeeedingLongWorkbookabcdefghijklmnopqrstuvwyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ=$.xlsx`

aka:

`C:\Users\User\Documents\SQL Server Management Studio\Vulnerability Assessment Reports\More longer\even longer folder name because b
> Closing this issue as fixed because of PR #3778 -- verified that multiple methods with same names are no longer a problem for the ExecuteCode now and are executed in expected sequence.
> Closing this issue as the question has been answered.
> Closing the issue due to age and the fact that questions has been answered. Additionally, the installation changed since the issue reported (cf #3836 )
> Closing this since the question has been answered.
> Closes #3907, #3833, #3728
> Closing due to old age of the issue. Furthermore the changes to the installation (cf #3836 ) likely has resolved the issue.
> Closing this as inapplicable now that we deprecated source control.
> Closing the issue since we changed both how we were installing the add in and executing code (cf #3836 and #3778 ). In theory, Rubberduck should now work on any host. If this is a issue still even with current release, open a new issue with more recent repro.
> Closing this because source code control integration is now deprecated.
> Closing this since the question has been answered.
 
3:48 AM
@Duga Spammer.
 
4:00 AM
Did we break @Duga? Been awfully quite recently compared to my inbox.
 
4:11 AM
Hey
 
Hey
 
@Comintern Sounds like a bunch of issues being closed by a user after source control has been deprecated
 
Yeah, a bunch of other stuff too. I was looking to take a swing at long-standing trivial issues, and kept running into things that had already been resolved.
 
I just happened to drop by for another reason and saw your comment, as far as I know @Duga is working as expected
 
@bclothier must have noticed and picked up where I left off.
I think there were 10 or 12 github notifications in my inbox that haven't made their way here yet.
 
4:18 AM
Maybe their mail server is having difficulty (less likely) or you're not included in those notifications
 
It was more of a "huh, that's different" than anything else. IIR this has happened before when there was super heavy traffic.
They'll probably all come through in like 2 hours or so.
Probably doesn't help that I'm stoking the fire from the other side. :-D
 
They may also have to go through some filtration process, I've seen that at my work
We're filtering for patient information, but Github could be filtering for potentially malicious code
 
Gah! I hate broken mocks. Unit tests are for broken code, not the other way around...
 
Fully agreed
 
@Comintern I apologize profusely if I made Duga storm off in a huff for overworking. Cleaning up all those "support" issues was something I wanted to do for a while ago and you gave me the kick in the rear to get that done.
 
4:24 AM
Yeah, I had it filtered by the [bug] tag, so I didn't even see like 500 or so.
 
lot of those were basically non-actionable or were acted upon but not closed. it was a bit too much.
 
The comment earlier today about the issue count kicked me in the rear, in that I kept stumbling across things that looked fairly trivial.
 
@this They're just posts from a bot, they can easily be moved to the Trash room if need be (though I doubt it will bother anyone here)
 
Hmmmm. I wonder if the chat room's spam filter kicked in (now that you mention it).
 
I don't think there's such a thing, but I've been wrong before
 
4:26 AM
I don't think I (we?) have the privileges to move duga's stuff to trash?
 
@this No, only room owners and moderators do
 
there's definitely a rate limit. IDK if there's a higher rate limit (e.g. you type 1000 posts in 1 hour => no more posts for a day)
 
Meh. Let the regulars without git email notification turned on see what we've been up to.
 
yes, so they can yell at me when they find that I closed their precious issue. :p
 
Just ping Mathieu if you need to - @ MathieuGuindon (without the space)
 
4:29 AM
@this You want to take a quick scan through #4199? There really isn't that much there, but you caught me pulling a stupid on my last one...
 
I don't know how you all deal with VBA/VBE, honestly!
 
LOL
I have to sometimes at work. VBA is the language I used to teach myself how to code back in the day.
 
I would have (╯°□°)╯︵ ┻━┻ a long time ago if I had to do VBA regularly...
 
This is a nice nexus because it keeps me sharp in c# (unintentional pun), in that most of the coding I do at work is fairly boring.
 
@Comintern looks good to me.
 
4:33 AM
To be fair, most C# (and Java) looks very boring
 
Thanks. Like I said, low hanging fruit.
 
@Phrancis If you can get MSFT to come around and use C# for Office, I'd be thrilled.
Until then, we'll have to keep trudging along in old-skool programming language
 
@Phrancis Mine isn't boring enough for my supervisor's code reviews - I usually have to dull it down. :-P
 
@this Big ships move slow :(
 
@Phrancis Ironically, the crew abroad has been paddling backward and failing to slow the ship any.
 
4:36 AM
@this s/abroad/aboard/ ?
 
I speel gooder, you see.
 
Si, I kan reed gud speeling two
 
Let's see if I choke git - 61.3MB of "code" changes just started synching into my PR.
 
Interestingly, you can automate/script Excel with a number of other languages (nobody scripts for Word/Powerpoint, and hardly for Outlook)
 
It's super easy in c# - I've done some custom reports at work for our marketing team.
 
4:39 AM
That's true in two different ways, yes. They now have Javascript API and COM is language-agnostic.
 
Granted, 90% of that was knowing the Excel API inside and out.
 
The real problem with .NET automation, however, is the irreconcilable collision WRT memory management between the .NET and COM.
 
Also, most of the people scripting Excel need a database instead of Excel [citation needed]
 
Javascript makes a lot of sense now that you can have Office on more than just desktop computer but the use cases are totally different.
@Phrancis preach it, brother!
 
AFAIK you can use Python to do a lot of the VBA stuff too
 
4:42 AM
hmm. I think that's across some interop layer, isn't it?
after all, COM is language-agnostic.
 
@Phrancis You could probably find at least a hundred by searching this chat.
 
@this I wouldn't know, I don't know much about COM
Used it very sparingly with PowerShell
To me it just sounds like one of those Microsoft monoliths that's been around since Windows 95
 
Well, there are issues with COM but one thing Microsoft did pretty good with COM is making it work for different languages - as long you adhere to the conventions that COM expect you to follow, you can interoperate with any other components and not worry whether they were written in C++ or Java or gasp fancy-pant C#!
 
On a conceptual level, it's pretty slick given when it was implemented.
 
Looks like Python uses a module called win32com to interact with COM. No idea what's in the black box.
 
4:46 AM
I'm still a little pissed that the .NET RCW violates the COM contract.
 
yeah makes sense. i'm sure that module handles all the COM convention for you so that you get a pretty nice python object that can dispatch calls to the backing COM object.
 
Today's Logic Quiz Which is the correct answer ?
 
from win32com.client import Dispatch

xlApp = Dispatch("Excel.Application")
xlApp.Visible = 1
xlApp.Workbooks.Add()
xlApp.ActiveSheet.Cells(1,1).Value = 'Python Rules!'
xlApp.ActiveWorkbook.ActiveSheet.Cells(1,2).Value = 'Python Rules 2!'
xlApp.ActiveWorkbook.Close(SaveChanges=0)
xlApp.Quit()
xlApp.Visible = 0
del xlApp
ew
 
@Comintern don't forget that cute little bug Microsoft put in the usercontrol, too!
 
@this Can you think of a good Assert that would detect access to my %USER% directory? I need to track down #4182, and thought I'd run all tests in Debug and check the call stack.
 
4:49 AM
that might be hacky but why not use FileSystemWatcher?
 
> If you like your Python code to look a lot like VBA, you're gonna love this module!
 
@Phrancis That would be trivial to make into a polyglot with VBScript.
 
but then again, UTs aren't meant to depend on the environment....
 
@this I'm all good with hacky for debugging ease. I've never run it synchronously though. Can it do that?
 
Good question. I don't know. I only used it like once, years ago.
 
4:53 AM
Doesn't sound like it, from a quick search
 
I've used the Windows API for change notifications a few times, but something synchronous would be a better method.
 
OTOH, you could bite the bullet and wait on it.
I had to do that for the busy state PR
 
Sounds like a FIFO buffer that just runs independently, but I've been wrong before
 
Let me see how many places I'd need Asserts. :searches Path.Combine:
@this Yeah, I guess I know the set of tests that are leaky.
Well hot damn. All I need are 2 Debug.Assert(false) lines in COMReferenceSynchronizerBase and ReferencedDeclarationsCollector.
This new build process takes forever. Is it faster or slower with the C++ toolchain installed to compile the MIDL?
 
no the slowdown started when we start doing code coverage
 
5:01 AM
Ahhh.... That makes sense.
 
if you look here it's at 0:02:38 elapsed.
 
Manual Duga:
Is that guy for real, or am I completely missing something?
 
in contrast, we elapse 3 more minutes already at that point
 
@this I have no clue how Matt can get AV to turn around so fast. My builds take like 20 minutes.
 
hmm. build for me takes 3-5 minutes locally.
how is your VM set up?
 
5:05 AM
Yay, merged with next.
 
Duga still mad, I see.
 
Oh, my build locally is pretty snappy - it's the automated merge test on my PRs.
 
yeah that does takes much longer. More than 5, almost 10 minutes for me.
(assuming you meant unit tests)
 
Although my local runs infinitely faster if I close the VBE before I build. :facepalm:
My local is well under a minute.
 
nice!
@Comintern I can repo
 
5:11 AM
Caught you, you sneaky bastard!
I think it might have been logging to my Rubberduck.log file too, but I could have just forgot to let NP++ refresh. I'll need to test that too.
 
@Comintern and kids, that is why we don't futz with environment when running unit tests!
 
^^^
We can probably add a meta-unit test to make sure that the mock parser never invokes that function. Not familiar enough with NUnit to do that though.
 
5:46 AM
I'm wondering if the best solution would be to do some more decoupling of the ParserState and the ReferencedDeclarationsCollector. There's no reason the RDC shouldn't be trivial to mock.
 
6:13 AM
@this: I wonder what happens with:
If True Then
'_ _
_
End If
 
@Comintern Duga probably just got rate limited.
@Comintern The parsing process in the tests and in production only differs by running things synchronously, on purpose.
 
@this I once considered myself king of evil comment syntax, and yet I've missed both of those
 
Nothing in that process should use external state not provided by something injected via a constructor.
I have to test what happens with ' '_.
 
Yeah, the serialized declaration path just needs to be passed into the RDC. That would be the quick and easy solution.
TTGTB
 
Night
 
6:32 AM
Would it be correct to say that a line continuations requires to be preceded by a whitespace character unless it is at the start of a line?
 
6:44 AM
@M.Doerner yep, my understanding is that a line continuation is ` +_\n`, regardless of whether at the start of a line.
But VBE will usually remove the multiple spaces, so it's really ` _\n`
Stupid MD not letting me escape a leading space
 
Hm, but the VBE obviously does not treat it as a line continuation unless it is at the start of the line or there is at least one leading whitespace.
Otherwise, '_\n would be a comment separator followed by a line continuation.
This seems to be treated as a comment followed by a newline.
 
I'm on a mobile but there's no space before your underscore,so it's not a line continuation.
 
Oh, I did not see your space.
I will test regarding the one at the start of the line.
 
7:00 AM
I.e. a '_\n is the same as 'a\n - the underscore is just a normal character so long as it isn't preceded by a space and followed by a newline character.
 
If I can verify that you are right with the start of the line, the grammar fix is trivial.
 
@M.Doerner my comment example in the issue is such an example
 
7:28 AM
I know. Just want to see it with my own eyes.
 
7:59 AM
Ok, this will be a one character fix.
Writing up the failing unit tests will definitely take longer than the fix itself.
However, I bet we have a few unit test that are wrong because of the mandatory whitespace.
 
8:24 AM
Non-breaking spaces are just stupid in VBA: they are legal everywhere in an identifier.
Yet another reason to explicitly type variables.
 
8:42 AM
@M.Doerner I suspect the first thing that the VBE parser does is to remove the line continuations.
@M.Doerner I suspect you might run into issues where the removal of the line-continuations will results in legal VBA code, but code that would otherwise have a space between the character before the line-continuations and the character after the line-continuation.
Eg. Identifiers separated by .,!,( and ) should be OK, but a , and a ; would normally have a space after them, but mightn't after a line continuation is parsed. Likewise operators at the end of a continued line, with operands at the start of the next.
 
 
1 hour later…
10:10 AM
I do not really see what you mean. AFAICS, our definition of LINE_CONTINUATION is just slightly wrong.
We treat those as whitespace.
Btw, I just had to realize that VBA does not really provide type safety at compile time.
Illusions--
 
 
2 hours later…
11:44 AM
@M.Doerner I've added a test procedure to the issue that compiles but doesn't currently parse because of the comments (but otherwise does parse). Hopefully it compiles and parses after you've made your change. There may be other tests that cover some of these.
 
 
1 hour later…
12:53 PM
@Phrancis talking to @Comintern - it's like Dawn of the Living Dead but in a good way! Welcome back!!!
 
1:12 PM
@Duga must still be rate limited.
@ThunderFrame You should take a quick read through my comment on #4193 when you have a chance. It's TTGTW, so ping me here if you comment on the issue and @Duga is still in the penalty box.
 
This is just a matter of curiosity but -- ?TypeOf Class1 Is VBInternal.Class => false. Makes me wonder if it's used similar to how UserForm classes are created; AIUI, UserForm1 does not derive from UserForm but is a literal copy of UserForm template with further customization.
(but then again, TypeOf UserForm1 Is MSForms.UserForm => true)
 
2:11 PM
is '@ignore module on line one of a module the proper syntax to get RD to not inspect an entire module?
 
'@IgnoreModule
 
white space FTL!
thanks
before or after an '@folder ... declaration, or does it matter?
 
shouldn't, no
^ manual-duga
@this is #3956 good to go now?
 
hrm... just installed build 3508. I'm getting a clean compile and no parse errors, but the toolbar isn't giving me any info on the item the cursor is on. No module name, no variable type, no nuttin'
 
@MathieuGuindon IDK if @M.Doerner has reviewed the latest. Would rather that it get reviewed to make sure I didn't do something silly.
 
2:20 PM
removing System.Web from Main is an oversight from me ...but how does removing it from Core not break the version-check feature?
 
maybe the parse wasn't as clean as I thought:
2018-07-17 10:09:31.1613;WARN-2.2.0.3508;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed while parsing the code pane version of module WebHelpers at symbol End Function at L2946C3. Retrying using LL.;
2018-07-17 10:09:31.1613;DEBUG-2.2.0.3508;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode exception;Rubberduck.Parsing.Symbols.ParsingExceptions.MainParseSyntaxErrorException: mismatched input 'End Function' expecting {ABS, ANY, ARRAY, CBOOL, CBYTE, CCUR, CDATE, CDBL, CDEC, CINT, CLNG, CLNGLNG, CLNGPTR, CSNG, CSTR, CURRENCY, CVAR, CVERR, DEBUG, DOEVENTS, FIX, INPUTB, INT, LBOUND, LEN, L
 
@MathieuGuindon 99% sure you don't need it. You probably are using System.Net
 
@FreeMan L2946C3??
@this hmm, might be. the build wouldn't be green otherwise
 
Yeah... this is borrowed code - something I grabbed a few weeks back to try to get my API calls to work better.
Haven't really gotten into figuring out how it works yet (nor have I called it yet).
 
@MathieuGuindon I used R# Remove unused references
 
2:22 PM
but it's sitting in its own module for now.
big module!
 
what's around L2946C3?
 
' WebHelpers v4.1.4
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
 
@this :+1:
 
and besides, you really don't want to use System.Web, seriously. It's basically loading IIS.
 
2:23 PM
brb - boss calling...
 
@Phrancis it’s what some of us are paid to work with.
 
Ha! Boss didn't like the NPS score for an internal survey... I don't like NPS at all, but that's a whole different topic. >:(
@MathieuGuindon here's the offending code with the End Function on L2946:
''
' Parse ISO 8601 date string to local date
'
' @method ParseIso
' @param {Date} utc_IsoString
' @return {Date} Local date
' @throws 10013 - ISO 8601 parsing error
''
Public Function ParseIso(utc_IsoString As String) As Date
  On Error GoTo utc_ErrorHandling

  Dim utc_Parts() As String
  Dim utc_DateParts() As String
  Dim utc_TimeParts() As String
  Dim utc_OffsetIndex As Long
  Dim utc_HasOffset As Boolean
  Dim utc_NegativeOffset As Boolean
  Dim utc_OffsetParts() As String
  Dim utc_Offset As Date
and the nice short function following:
''
  ' Convert local date to ISO 8601 string
  '
  ' @method ConvertToIso
  ' @param {Date} utc_LocalDate
  ' @return {Date} ISO 8601 string
  ' @throws 10014 - ISO 8601 conversion error
  ''
Public Function ConvertToIso(utc_LocalDate As Date) As String
  On Error GoTo utc_ErrorHandling

  ConvertToIso = VBA.Format$(ConvertToUtc(utc_LocalDate), "yyyy-mm-ddTHH:mm:ss.000Z")

  Exit Function

utc_ErrorHandling:
  Err.Raise 10014, "UtcConverter.ConvertToIso", "ISO 8601 conversion error: " & Err.Number & " - " & Err.Description
Shall I submit a bug, Dave?
 
I like how they qualify Left, Right, CInt and others, but not TimeSerial
@FreeMan parses fine here
 
@FreeMan Known issue - you can close and reopen the code pane as a work-around. If it still doesn't work, do it again.
 
@Comintern "have you tried turning it off and back on?"
not a cliche at all
 
2:34 PM
:-D
 
@MathieuGuindon It was an SLL error. So, you can see it only in the log.
 
oh duh
that said when a whole procedure's body is inside an If block, you can easily remove a nesting level by inverting the condition and using Exit Function to bail out @FreeMan
 
@MathieuGuindon I really really do not like Exit <procedure>. GoTo ExitProc is only marginally better. If you have watchdog, ErrEx.DoFinally makes much more sense and keeps code maintainable.
 
If UBound(utc_Parts) = 0 Then Exit function
 
Huh. Just noticed the comment pseudo-block. Tim must be using some sort of automated documentation tool on that.
 
2:40 PM
is that really a killer?
@Comintern thought the same :)
 
@MathieuGuindon for maintainability, yes.
 
if (utcParts.Length == 0)
{
     return;
}
^ but this is fine?
 
Yes.
 
Which module is the failing one?
 
so..
If UBound(utc_Parts) = 0 Then
    Exit Function
End If
^ fine as well, no?
 
2:45 PM
No
 
ok, explain... not ok in VBA, ok in anything else?
 
@Comintern hrm... Okey dokey
 
I'm speaking from the perspective of ensuring that everything gets cleaned up properly. The above would be fine only if there were no cleanup to be done. But suppose you later add a ExitProc with a ErrHandler after in traditional VBA error handling. The ExitProc would contain additional code that would be executed to clean up. Exit <procedure> then becomes dangerous because it allow you to exit a procedure midpoint without guaranteeing a cleanup.
OTOH, ErrEx.DoFinally guarantees that the code within the ErrEx.Finally will be executed, so that clean up always happen.
and even for a procedure that do not have a ErrEx.Finally pseudo-block, the ErrEx.DoFinaly will do the right thing, too.
 
Meh, just make the error handler fall through.
 
Thus you have less changes you need to propagate when you add or modify the clean up to the procedure.
 
2:49 PM
you're over-complicating it... every single executable statement in the procedure is inside that If block
if you bail out instead of nesting in, you're still good
 
we agree on that point. I'm just saying I don't like the use of Exit <procedure> in general because it makes for more work when you need to add cleanup.
 
Closed the .accdb & reopened. now it seems to parse OK and it gives me location info on the tool bar.
I'll work on cleaning up Tim's code once I begin to implement it, and that will be after I have some vague understanding of what it's doing.
In the meantime, it's '@IgnoreModule for the whole lot of 'em!
 
^ good call
that would actually be a good PR to make on Tim's repo
(sticking '@IgnoreModule; Rubberduck inspections ignored in this module at the top of everything)
(or not)
 
LOL
 
can't hurt to ask though
I've seen worse code TBH
try running inspections on the legacy Smart Indenter source :)
 
2:55 PM
O_O
 
a PR with @folder "VBA-Tools.VBA-Web" was the first suggestion made when I grabbed this stuff, so the '@IgnoreModule would a good addition to that, I suppose.
 
hmm that folder annotation is an excellent idea
 
:+1:
 
thing with @IgnoreModule is that is kinda says "look, Rubberduck will flag a ton of things here, I don't care"
 
Yes, yes it will!
 
2:59 PM
hmm. a PR that cleans up the code to RD's satisfaction might be a bit ambitious.
 

« first day (1502 days earlier)      last day (1678 days later) »