« first day (1573 days earlier)      last day (1607 days later) » 
00:00 - 16:0016:00 - 00:00

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 1 opened issue.
 
12:33 AM
huh, \b /backspace gets to the VBE before AC gets to handle it...
@Comintern is that intentional?
 
@MathieuGuindon IIR it was.
 
ok
it kinda wrecks backspace handling though
"|" +\b should result with an empty string and selection at column 1
 
Let me check - it was either backspace or delete that wasn't going through pretranslate.
 
but now I don't know what character was left of caret
basically I need to handle backspace before the VBE gets to see it
(and "eat it" if I handled it)
 
I remembered that wrong. It was [enter] that was messed up.
 
12:37 AM
yeah
 
And delete looks like the only one I gave special handling to.
Does it need to be in the WM_CHAR or the WM_KEYDOWN?
 
I had backspace handled with a Keys value, not a char - which means it was WM_KEYDOWN and now it's WM_CHAR
are we getting WM_CHAR only after the VBE handled it?
 
No, it must mean that the VBE is handling it in WM_KEYDOWN.
My comment here is apparently incorrect:
            // The only keydown we care about that doesn't generate a WM_CHAR is Delete, and the VBE handles Enter in WM_KEYDOWN,
            // so we need to handle it first (otherwise it will already be in code when the managed event is handled).
 
If the VBA is handling it in WM_KEYDOWN, all you need to do is handle it the same way that Enter is being handled currently.
 
12:42 AM
so this test passes:
        [Test]
        public void PlacesCaretBetweenOpeningAndClosingChars_PreservesPosition()
        {
            var pair = new SelfClosingPair('(', ')');
            var input = pair.OpeningChar;
            var original = "foo = |".ToCodeString();
            var expected = "foo = (|)".ToCodeString();

            var result = Run(pair, original, input);
            Assert.AreEqual(expected, result);
        }
but in the VBE I get foo ()=
I think I need to mock the prettifier everywhere
@Comintern thanks, I'll do that
 
Lemme test it really quick.
 
crap, the SCP tests are all usesless
prettifier is at the AC service level
so SCP works fine, and AC service wrecks it all
I need to track whatever gets trimmed at the right upon prettification
 
What gets trimmed to the right?
 
if I have foo = |, then that last space is getting nuked
I think I'm having a major off-by-one nightmare
believe it or not, this test passes:
 
LOL, holding down the ( key is hilarious with that SCP turned on.
 
12:50 AM
        [Test]
        public void DeletingOpeningCharRemovesPairedClosingChar_NestedParensMultiline()
        {
            var pair = new SelfClosingPair('(', ')');
            var input = Keys.Back;
            var original = @"
foo = (| _
    (2 + 2) + 42 _
)
".ToCodeString();
            var expected = @"
foo = | _
    (2 + 2) + 42 _

".ToCodeString();

            var result = Run(pair, original, input);
            Assert.AreEqual(expected, result);
        }
SCP is basically as good as it gets when it's a unit ...and falls apart on integration
@Comintern I don't even want to try that with my build lol
 
Hmm... In my build foo = | results in foo =|" when I hit )`.
 
ok wtf... I think I'm not sync'd up
    private static void OnKeyDown(KeyPressEventArgs e)
    {
        using (var pane = GetCodePaneFromHwnd(e.Hwnd))
        {
            if (pane != null)
            {
                using (var module = pane.CodeModule)
                {
                    // bug: Keys.Enter == Keys.M
                    var args = new AutoCompleteEventArgs(module, e);

                    Suspend = true;
                    KeyDown?.Invoke(_vbe, args);
                    Suspend = false;
                    e.Handled = args.Handled;
^ VBENativeServices.cs lines 161-179
 
That should be current.
 
wut, it is
 
I think I missed that comment.
 
12:56 AM
it's just the comment then?
 
Yes. The change was primarily in CodePaneSubclass and KeyPressEventArgs.
 
right, the bit you worked on was the part providing the KeyPressEventArgs
 
so this should be it then?
if (args.IsDelete || args.Character == '\r' || args.Character == '\b')
trying that
note to self: Batlteship is awesome during build/test
 
Oh damn. That code is re-entrant.
Don't think it matters though.
OK, potentially re-entrant.
 
1:00 AM
eh what's the worst that could... crashes
(jk)
 
public override int SubClassProc(IntPtr hWnd, IntPtr msg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, IntPtr dwRefData)
{
    KeyPressEventArgs args;
    switch ((WM)msg)
    {
        case WM.CHAR:
            args = new KeyPressEventArgs(hWnd, wParam, lParam);
            if (args.Character != '\r' && args.Character != '\n' && args.Character != '\b')
            {
                OnKeyDown(args);
                if (args.Handled) { return 0; }
            }
            break;
        case WM.KEYDOWN:
...and...
        public KeyPressEventArgs(IntPtr hwnd, IntPtr wParam, IntPtr lParam, bool keydown = false)
        {
            Hwnd = hwnd;
            WParam = wParam;
            LParam = lParam;
            ControlDown = (User32.GetKeyState(VirtualKeyStates.VK_CONTROL) & 0x8000) != 0;

            if (keydown)
            {
                // Why \r and not \n? Because it really doesn't matter...
                var key = (Keys) wParam & Keys.KeyCode;
                if (key == Keys.Enter)
                {
 
holding ( gives me ()()()()()()()()()()()()()()()()()()()()()()
 
We end up generating WM_GETTEXT messages when we find the code pane with the caption.
@MathieuGuindon LOL. Isn't that the expected behavior?
 
#nope
((((((((((((|))))))))))))
^ this would be
 
I get foo (((((((((((((((((((((|))))))))))))))))))))
 
1:03 AM
aye, I borked something
 
Off by 1?
 
MsgBox ( -> MsgBo()x
what makes you say that?
I really hate myself for writing this code right now
 
That's better than MsgBox :crashes:
 
lol true
hmm but that's off by two
 
Would using the rewriter be easier?
 
1:07 AM
can't
lest we full-blown parse the current line at every interesting keypress
 
Why's that? Couldn't you keep it in sync without reparsing?
 
not as far as I know
 
Hmm...
So what happens if you inject "invalid" tokens into the parse stream? Does its state always have to be valid?
 
through the rewriter?
 
Yeah.
 
1:09 AM
rewriter will choke if two "steps" rewrite the same position twice
 
OK, that rules out my thought.
Seemed like it might be a good way to keep track of position, because you could apply a "pseudo-prettifier" to the parse tree itself.
 
so uh, args.Chararcter is \0 when I hit backspace
the change is no-op
oh duh
I need to change the ctor in KeyPressEventArgs too
hm, no I don't
 
Shouldn't it be ignored in WM_CHAR though?
 
#lost
keydown is false, yeah
so it's branching to Character = (char)wParam
...inside the WM.CHAR case
and yeah, there's the part that needs to exclude it
damn I fail at reading
 
Eh? That's odd. Let me step through.
Yeah, the code above gives me Character = 8 in WM_KEYDOWN and no event in WM_CHAR.
 
1:19 AM
and I get Character = \0 in WM_KEYDOWN
#whathaveidone
ok, no
 
That should be correct though.
It won't raise the event.
 
yeah no I got it
 
Is there a conditional somewhere on the event type?
 
oh ffs.. I'm passing a zero-based selection to DeleteLines
wait no, it is the one-based selection.. yet it's at L0
 
Backspace moves the caret back.
 
1:22 AM
yeah no it's something else
after result = _selfClosingPairCompletion.Execute runs, result.SnippetPosition should never be at L0
 
Normally a keystroke would move the caret one place to the right, backspace is one to the left, so there's a positional difference of 2, not 1?
 
prettifier makes that irrelevant
 
...and, backspace does nothing if it's at the start of the file.
it's a nop.
 
yeah that part's good
 
Remind me never to write a text editor in assembler.
 
1:25 AM
lol
hmm I think I know what's wrong
I run the prettifier but somehow with a breakpoint in HandleBackspace the code in the editor is |""
should be ""|
no not even, should be "|"
 
Huh. Is it moving the caret on WM_KEYDOWN and then changing the text in WM_CHAR?
 
nah prettifier is interfering with the caret position
 
When does the VBE run the prettifier?
 
lol no I mean mine
 
Oh. LOL
 
1:30 AM
I have "|", hit backspace, and get |"" just after the prettifier ran
that's off by one
now if there's an off-by-one in the prettifier, I don't understand how the prettifier tests are passing
 
Is there a corresponding off by one in the test setup?
 
fixed it, will run the tests in a minute to find out
YEAH BABY
oh boy
    MsgBox "
you'll never guess the outcome
 
crashes?
 
"|"    MsgBox
 
WTF?
Off by line.Length.
 
1:40 AM
but hey, given "|"+backspace, I do get the correct empty line
""MsgBox
^ from MsgBox"
this shit is maddening
 
LOL.
I've just been watching this, it's hilarious :)
 
running prettifier tests
@Hosch250 isn't it
 
If it were C I'd say you have an embedded null char somewhere.
You're running a tokenizer, right?
 
not quite
you mean for the prettifier?
BTW all prettifier tests have gone red
lol they all throw a NRE
 
That might be a good place to start. You getting a null string as output somewhere you shouldn't?
 
1:45 AM
...because _module.CodePane is null ...now hth did they ever pass...
 
Yeah, that would do it.
You didn't answer my question. Where does Sheet1 (the variable you're using) come from? You seem to know how to access Sheet2, but somehow expect Sheet1 to show up by magic or something. So where are you assigning a value to Sheet1j so that you can use it differently than you're using Sheet2? — Ken White 1 min ago
Wow, Ken White had that one sail overhead at cruising altitude.
 
@KenWhite assuming ThisWorkbook.Worksheets("Sheet1").CodeName is "Sheet1", then Sheet1 is a global/project-scope identifier automagically declared by VBA, yes. And using code-name identifiers like this is absolutely the single most robust way of accessing a worksheet that exists at compile-time in ThisWorkbook. — Mathieu Guindon 10 secs ago
use of "automagically" is intentional
 
Autoselfevident.
 
Except, given the error number, I very much suspect that OP doesn't know that, and Option Explicit isn't specified, and Sheet1 was deleted and another sheet was added and its Name was set to "Sheet1", yet the worksheet object probably has a code-name like Sheet4 or something. — Mathieu Guindon 12 secs ago
 
1:56 AM
:OP realizes it was a silly naming error, is never seen again:
Hmmm... I wonder if Rows.Count throws if the active sheet is a chart...
 
I'd think that would be error 438 member not found
 
It's actually a 1004 interestingly enough. "Method 'Rows' of object '_Global' failed"
HTH does that work?
 
gah, right, goes through _Global
 
 
2 hours later…
3:57 AM
ok, prettifier is sane
 
4:22 AM
According to docs.microsoft.com/en-us/office/vba/language/reference/… you can use #123 to use a functiona ordinal position. Why??? I can’t fathom any reason other than backwards compatibility.
 
5:03 AM
What else would you do in case the function in the dll has no name?
 
6:00 AM
> Still needs some polishing, but with this PR self-closing pair completion is no longer annoying.
 
aaand it's 2AM
 
[rubberduck-vba/Rubberduck] build for commit 13ae0ce6 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
oh no you don't
</mug>
 
[rubberduck-vba/Rubberduck] build for commit 13ae0ce6 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
 
6 hours later…
12:00 PM
@Duga so... why?
 
'cause...
Here's my SSIS package setup. Is there a way to identify which step caused the row to appear in my Error File or do I need a separate file from each step to identify that?
 
@MathieuGuindon for comparison. I'm guessing it's tripping flat on the opencover, maybe.
@FreeMan You can add an expression to the output
 
@FreeMan add a "ErrorSource" column to the error output of each component, have your union-all include that column, write it to your export file =)
"Derived column" component works
@this I'm missing something there
 
12:16 PM
@MathieuGuindon So am I. I'd expect the error to be a bit more verbose but all we have is a exit code 1. You got Finished all processing files, which is the last executable line of the powershell script so I'm inclined to think something after that failed.
 
12:29 PM
@this @MathieuGuindon Thanks. I've got that added - 'twas rather easy with the help!
Now that that is working, how come I can't get it to give me the actual row of data that caused the issue?
^ My input file setup
but when I get to the Derived Column output, this is what I have:
I don't get my original source columns to pass through
According to this it appears that it concatenates all the input columns on an error row into once column called Flat File Source Error Output Column. I'm writing that to my error file, but it's coming up blank...
carp. Not, it's not ignoring it. Somehow it's combining everything into one Long. This is what I'm getting: -1071607778 in the mapped column.
somewhat less than helpful...
no, it's not. I don't have any errors from my input CSV file, they're from my Lookup or Insert steps.
 
1:03 PM
and... something else to work on for a while...
 
@MathieuGuindon there's an error about CodeString's constructor usage
 
1:22 PM
AppVeyor says that this line doesn't compile
 
1:39 PM
Have any of you ever encountered .Cells(1, 1).Address returning A1:A1? The asker is not the most inquiring type unfortunately, so information availability is limited. (I'm not sure how to reproduce the issue, but I'm sure I've never encountered it.)
 
@Vogel612 ugh fml.. thanks
 
the "messages" tab helps a bit
should probably be "original" IIUC
the second arg, I mean
@Inarion I assume for the usual case it's returning a Variant/Cell and for the unexpected case it's returning a Variant/Range
 
I'll fix that tonight.. PR is WIP anyway
 
yea. I'm down to four projects to move
 
y'all should have seen the burst of pure joy when I launched the VBE and SCPs finally worked exactly as they should..
#NeverGiveUp
 
1:45 PM
well, imma give up on trying to fix bitlocker being a royal pain in the backside when I just wanna nuke the drive and install ubuntu
Asked my customer to check for their bitlocker key now so I can remove the bitlocker protection
it seems to interfere with bootable USB drives
sometimes I wonder how Microsoft got so big producing that crappy software.
and then I remember that it was pretty good software back then and the office suite is really good
but it honestly hasn't aged well ...
 
Did anyone else see the burst of pure joy on the skyline in the direction of Canada?
 
don't have a west facing window, no
 
@Comintern what did I miss?
some hurricane remnants?
 
8 mins ago, by Mathieu Guindon
y'all should have seen the burst of pure joy when I launched the VBE and SCPs finally worked exactly as they should..
 
it was glorious
I need to get the multiline part to work (that's why I extracted AutoCompleteKeyDownHandler - to write tests for figuring out what's wrong there), and then matched parenthesis deletion should work just as well in the VBE as they do in the SCP tests
but to see code pane selection end up exactly where it needs to be, given any thunderframesque input... #relief
 
2:03 PM
PSA: Rubberduck currently has 265 code inspection enhancement ideas - some easy, some fiendishly hard, all #UpForGrabs! Fork us on @GitHub! #Hacktoberfest #OSS #CSharp https://github.com/rubberduck-vba/Rubberduck/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement+label%3Afeature-inspections
 
so... hacktoberfest.digitalocean.com we can't register a repository before the event starts?
 
#TIL #FunFacts.... Running this SQL:
WITH x AS (
	SELECT foo
	FROM (VALUES
		(NULL),
		(NULL),
		(NULL)
	) AS y(foo)
)
SELECT SUM(foo)
FROM x;
 
@M.Doerner have yourself a weep. Why use a DLL if a member doesn’t have a name. Doesn’t make sense to me.
 
yields error message:
Msg 8117, Level 16, State 1, Line 20
Operand data type NULL is invalid for sum operator.
So I guess NULL is a data type after all! :p
@IvenBach you can export a function without a name.
 
You can also write one in assembly.
 
2:12 PM
@M.Doerner What language? I'm pretty sure you can make dll calls using the ordinal or the function offset.
 
@Vogel612 Not sure I'm following. There's no Cell class.
Dim r As Variant
For Each r In Range("A1:A2").Cells
    Debug.Print r.Address
    Debug.Print TypeName(r)
Next r
 
@this #TIL now it makes sense. Dunno why one would do that though.
 
@IvenBach to keep out the big-nosed people.
 
@Inarion r will have the type Variant/Object/Range.
 
@Inarion IOW, Cells is a lie.
 
2:15 PM
parameterless .Cells is also fully redundant
 
@this Be it as it may. My point is - there is no type Cell. And furthermore, I'm not able to get "A1:A1" as return from Range().Address or Cells().Address
@MathieuGuindon You're going to love this: varAddr = RecColRef.TargetSheet.Cells(Val(strRow), 5).cells(1,1).Address
 
I've so far not managed to come up with a comment without sounding haughty or condescending and thus refrained from posting one.
@this I've never understood why they have a .Cells collection/property (that actually returns a Range object) in Excel without there being an actual Cell class. That would have been logical in my world.
Maybe my mistake was to assume it's a collection. (But given other collection classes they have, like Workbooks, Worksheets and so on, it seems an easy mistake to make.)
 
2:37 PM
@Inarion think of Cells(int,int) as an overload of Range(string), and then it all makes sense ;-)
 
@MathieuGuindon it also doesn't help that COM doesn't allow for function overloading, so Range(int, int) wouldn't have been legal. That said, though, the confusion over Cells implying a Cell object is widespread. Too late for that though.
 
Oh I still haven't merged the analyzer PR.. everyone good with it?
 
it builds w/o error, right? If so, yes.
 
@this They could have made Range(variant, optional variant) and determined the addressing by context. That would have doubled or tripled the SO 1004 errors though.
 
I know we had to comment out the UT and I think @Hosch250 had an idea how to fix that. But we can make do with that.
 
2:44 PM
Merged
 
I'd rather have the analyzer be in effect sooner than later before we make PR that violates the rule anlayzed by that analzyer
 
@Comintern True. That's why I'm not so big on Variant arguments. It only makes it harder to use.
You have no idea how many time I goofed up with a runtime error on a silly thing like MsgBox "blah", "title"
oh, BTW, @MathieuGuindon great job on fixing the SCP. I'm sure it was worth all the pain and misery it bought you. :)
 
there's one assumption that's left and I'm not sure how to work around
 
There's a reason why there's a 90-10 rule. ;-)
What is the assumption?
 
2:48 PM
see I first run the SCP against the original code, to know whether the SCP yields something - if it does then I run the prettifier, and run the SCP again this time against the prettified code
but then if the result of that gets written to the VBE and the in-editor code still mismatches...
I'm assuming it's because one whitespace was added
                    var finalSelection = new Selection(result.SnippetPosition.StartLine, result.CaretPosition.StartColumn + 1)
                        .ShiftRight(offByOne ? 1 : 0);
 
Tangential: why not stick in a Debug.Asset to compare the prettifier's output against VBE's output?
that would help you find any edge case where prettifier don't mimic VBE's behavior
 
the prettifier is the VBE's behavior - it's only "mimicking" in tests :)
 
sorry i thought i remembered you implementing a prettifier service
 
yeah. and it's fully tested, too :)
it reliably returns exactly what the VBE does
i.e. for MsgBox | I get MsgBox|
 
alright back to the regularly scheduled program....
 
2:54 PM
so when SCP takes that and adds the "" autocode...
the result is MsgBox"|"
 
@this No idea. What's the UT?
 
when that's written into the VBE, we get MsgBox |"" - and that's where I assume the diff is only ever going to be off by 1
seems to work
 
@MathieuGuindon don't you mean MsgBox "|" (with a space)?
 
@MathieuGuindon Refresh my memory... what is SCP? Source Code Prettifier?
 
@Hosch250 the one that fails about not finding the chained member's interface even though it works in real environment. You commented last week(?) that you had a idea for fixing it.
 
2:56 PM
no, because prettifying MsgBox | returns MsgBox|, because the VBE trims the trailing space
@FreeMan self-closing pairs
 
ah! even better. thx
 
Bear with me - so if I'm typing normally (with no SCP whatsover), I can go MsgBox |, type ", then end up with MsgBox "| -- no prettifying happens.
right?
 
right, because no prettifying occurs until you leave the line
 
Oh, unit test.
Yeah, sorry, weekends just been exhausting for me.
 
so you can type msgbox"foo bar" and it only becomes MsgBox "foo bar" after you "confirmed" the line
 
2:58 PM
@Hosch250 Or urinary tract if you prefer. :p
 
Yes, I do have an idea.
I was thinking User Type.
 
@Hosch250 for the record, me too :)
 
@MathieuGuindon Right, and with SCP enabled, as soon as I ", I've "left" the line
 
correct
 
From U(D)T.
 
2:59 PM
hmm. need a new acronym, I guess.
or overcome my laziness
 
the prettifier "resets" the selection, putting it back to where it was before the line was deleted-and-readded
 
so why can't SCP just add ` ""` as opposed to just ""
if it's extraneous, subsequent prettifying will get rid of it
 
oh trust me I tried
 
Hmm, in that case if you've already done that, then I guess we'll have to live with that assumption.
 
the problem is when you start correcting trailing whitespace like this, you start having off-by-ones left & right
 
3:01 PM
Right. I can see it cascading
 
I can totally add Debug.Assert result.Code.Length + 1 == module.GetLines(result.SnippetPosition).Length; though
actually, extract the GetLines into a local first
 
Yes that'll be a good idea
provide us with a safeguard when the assumption is violated
 
thing is, if there's a single case where that's not true, then I've no idea where the caret should be then
 
btw i thought there was a case where blah"" wouldn't get prettifed into blah ""
 
then the lengths will be the same
 
3:05 PM
but the only one i can think of is if it's msgbox "blah""
which ends up as msgbox "blah"""
not quite the same thing as Msgbox"" => Msgbox ""
(in fact, I just #TIL'd this behavior - didn't occur to me it can prettify like that. Compared with other stuff like &, you get a syntax error if you don't insert the space because & has a different meaning when there's a leading space or not.
 
Vlookup https://twitter.com/oterocarlos/status/1044601814622994434
 
@TweetingDuck If only those were coming to the desktop versions, as well...
 
@FreeMan it's the same code base. I fully expect it to be in Office 2019 desktop.
 
Which our company will roll out sometime around 2026...
seriously... they're still rolling out 2016. If you haven't got the updates yet you're on 2010...
 
not like MS isn't doing everything it can to nudge people to upgrade...
 
3:12 PM
Most people probably don't need the new features, but performance updates are always handy!
 
and yes, I'm still running Office 2010 here... for performance reasons
 
Office 2013 is sufficient for everything I need to do.
 
I'm still on Office 2010 because I got it for free as a student xD
 
If they go the Windows 10 route, they'll automatically update it (with a reboot) and then send you a bill for it...
 
Heck, I was running 2007 at home quite happily until something borked the setup and it couldn't find DLLs properly and launched the setup every time I opened Excel. Finally installed the copy of 2016 I bought for $10 through the Home Use Program.
 
3:13 PM
any version of Excel that supports table formulas is good enough for my stuff
 
Hence why MS wants everyone subscribing
 
performance of '16 does suck and I don't mean that lightly!
 
It's basically their bread line
 
You don't mean it lightly, or it doesn't suck lightly?
 
...enlighten us?
 
3:15 PM
it doesn't suck lightly, and I don't say that lightly, either.
 
The light bulbs are coming on.
 
and there light was
let there be rooooock!!
 
@MathieuGuindon School of Rock reference?
 
hmm. light powered by rock'n'roll...
 
Damnit, now that song is stuck in my head.
 
3:47 PM
gee, even with 250 bounty (thanks, Mat) all I had was nitpicky comments. Who thunk it would be such a hard question....
 
00:00 - 16:0016:00 - 00:00

« first day (1573 days earlier)      last day (1607 days later) »