« first day (1267 days earlier)      last day (1913 days later) » 

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 3 opened issues. 1 closed issue. 10 issue comments.
[rubberduck-vba/RubberduckWeb] 1 commit. 8 additions.
 
12:13 AM
@ThunderFrame I'll have to play with it to grok what you just said I think
 
@Mat'sMug The AvalonEdit/Dragablz window becomes the only VBIDE ToolWindow... All of the other RD windows are then managed within the RDMdiChildHack.... i.e. The AvalonEdit window becomes responsible for it's own internal docking and MDI management.
 
Oh I read MdiChildHack and missed the RD prefix
 
it's too good a name not to immitate.
 
So yeah, that makes only one TW to deal with
@ThunderFrame IKR!
 
 
1 hour later…
1:21 AM
just wondering - once Avalon's up, is there going to be any reasons to still have tool windows dockable? An example would be being able to see the CE in the break mode...
 
hmm
you have a good point there
maybe once our editor is up we can gently ask Microsoft if they will help us make it work in debug mode too =)
man, the VBE, with a VS-grade UI
 
That might be doable, yes.
seriously overdue
 
^^
 
i mean, Microsoft's basically punishing people for writing VBA
 
And then RD will be like..
Mission. Fucking. Accomplished.
 
1:26 AM
makes a mental note to reserve an aircraft carrier for the event
4
 
lol
The editor will quickly become a project of its own... We should make it a separate assembly, not just a namespace in RD.UI
so many new features bugs
 
1:55 AM
 
would love to find out the backstory behind that....
was it a pool along MSFT programmers to see if they'd get an email from someone in world asking it and when?
was it an internal joke that we'll never know?
The inquiring minds want to know.
 
@this This is the closest thing I found to describing it...
 
sounds like it became a running gag in the team, then.
always fun to see those little easter eggs. kind of surprised it's still there, since MSFT had to stop doing that since.... what? 2000? 2002?
VS, why are you showing me exceptions from non-user-code when Just My Code is checked?
YESSSSS!
now the hard part: getting the dialog to work.
 
2:19 AM
whoops. look at the time ...
 
FWIW, this is the new presenter with creation logic simplified... hopefully. Went with a static factory method as this seemed to work best. Feedback welcome!
 
2:46 AM
Trying to parse a string with regex, where double-quotes are delimited just like VBA...
      Caption         =   """Quotes"" ' everywhere""" '""quoted"" comment""
and the regex, which seems to capture the right text:
(?<Indent> *)(?<Name>\w+) *= *(?<Value>"(?:""|[^"])*")(?<Comment> '.+)
with the magic being (?<Value>"(?:""|[^"])*")
does that look robust enough for all double-quote delimiters?
 
should work fine ...
the text you have there is mismatched though...
also it shouldn't be necessary to require a space before the comment :)
 
true
 
either way. 4AM ... Toodles!
 
I'm parsing the FRM, which is hopefully system generated, so the space if fairly reliable, but will make it optional
toodles
 
do we wanna to use regex?
could ANTLR be sic'd on a binary content?
 
2:56 AM
The FRM is plain text, the FRX is binary (and varies by VB6/VBA)
 
ah my bad, I thought that was the binary
but even better then.
if it's text, then you can write grammar for it.
it's usually Begin... End stuff, right?
 
VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   3015
   ClientLeft      =   120
   ClientTop       =   465
   ClientWidth     =   4560
   BeginProperty Font
      Name            =   "Times New Roman"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   Picture         =   "VB6Form2.frx":0000
 
yeah
 
^ that's a VB6 FRM
 
Access has similar syntax
IDK if that syntax is used by others
it seems to me that trying to Regex that data would be to repeat the RD 1.0 days in the .FRM data....
but then it's lot of work, so if you're almost there, might just finish the regex now and hope for best.
 
3:01 AM
It could probably be done with ANTLR, but the binary dependencies make it tricky.
 
yeah...
 
Access uses a slightly different approach
but VBA/VB6 should be doable as a single implementation, AFAICT
just need to build a structure that allows controls to contain controls.... all the way down
 
just curious - do you have any idea of the performance for the regex-based parser so far?
 
2 secs
 
for how many forms and how big?
 
3:09 AM
for that simple sample form above, 2ms
 
cool.
 
expands form to make it 700 lines, runs in 5ms
 
 
2 hours later…
5:37 AM
> The `QBColor` function returns color values used by earlier versions of Basic (such as Microsoft Visual Basic for MS-DOS and the Basic Compiler), and as such should be considered deprecated.

Furthermore, while the function accepts an integer, a run-time error occurs if the parameter value isn't between 0 and 15, and the values that are between 0 and 15 are not meaningful.

50% of the returned values are already defined as constants in `VBA.ColorConstants`

RD should inspect for usages o
 
 
5 hours later…
11:00 AM
@this regex usually is blazingly fast, because it's used rather often and it's not hard to write regex that stay in hot-memory
 
@Mat'sMug - the code explorer screen looks really familiar, what are you using?stackoverflow.com/a/41024560/5448626
RubberDuck or something else?
Or this is the standard for Excel 2016?
 
11:18 AM
@Vityata that would be Rubberduck
 
@ThunderFrame I guessed so, just wanted to make sure it is :)
Thanks, @ThunderFrame
 
 
2 hours later…
1:55 PM
[rubberduck-vba/Rubberduck] build for commit 4e5cd9dc on unknown branch: AppVeyor build succeeded
 
2:38 PM
@Mat'sMug / @Hosch250 / @M.Doerner when you do have time, I'll appreciate a quick check on the modified creation pattern for dialogs, to confirm I'm not doing anything insane. Thanks!
 
@this I like it. Commented.
 
2:53 PM
Thanks. Being my first time, wanted to be sure it was good before I proceed further with revising the ViewModel & Model for the extract method.
*first time using generics in that manner. Normally generics only need 1 or 2 types. 3 is bordering on abuse. :)
@Mat'sMug, making sure I understood your comments about dispose pattern. Are you saying I need this, too?
    public void Dispose(){
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    protected virtual void Dispose(bool disposing){
        if (disposing){
            if (resource!= null) resource.Dispose();
        }
    }
which seems overkill since the class doesn't own any unmanaged resources itself; calling the view's dispose should be sufficient?
(I do see that my Dispose shouldn't have been virtual; only Dispose(bool disposing) should be virtual)
 
3:16 PM
Hey @Mat'sMug. I tested out your Presenter idea from the other day (with multiple userforms). It's great!
So now I control the userform instances really well in the presenter. What's the best way to deal with the data from the userforms?
At the moment I just have properties in the presenter which expose the form objects to the calling sub
 
@CallumDA That's where the "M" of the MVP pattern come in - you need a model.
 
^ that
 
Essentially, create a class that contains all the data representing something
tell the presenter this is the model for UserForm A, and that is the model for UserForm B. When it's done, the presenter should return to you the modified model.
 
Ohh that's so good
 
^ that's my current project
 
3:23 PM
(incidentally that would be FUBAR in the PE)
3
 
lol
 
Good IDE really does make a huge difference.
 
Right, enough is enough. I'm off to tell my IT department they have to make Rubberduck available for me to download
6
... I got a resounding no
¬.¬
 
I think you're talking to wrong people.
You should talk to your boss and tell him that you are losing hours of billable work because you're forced to use a sucky IDE.
and let him take care of it.
Have to know who has their side of toast buttered by whom.
 
3:30 PM
Haha, that's not a bad idea at all!
 
IT peons can tell office peons No. But they can't say no to bosses. :)
 
3:42 PM
@this actually it doesn't need to return it - the model is mutable so as long as the presenter holds a ref to it, it's aware of all property changes
 
> Hi ,
Is this possible to add Rubber into visual studio community 2017, I installed the rubberduck.exe file on my window , how can i access or use in visual studio 2017
> Hi ,
Is this possible to add Rubber into visual studio community 2017, I installed the rubberduck.exe file on my windows , how can i access or use in visual studio 2017
 
Make sense, @Mat'sMug. We typically do want to read the model after the userform has been dismissed, and possibly not before, but that's not a hard and fast rule.
 
> Hi ,
Is this possible to add Rubber into visual studio community 2017, I installed the rubberduck.exe file on my windows 7 enterprise , how can i access or use in visual studio 2017
 
that's my entire Macros module:
Option Explicit
'@Folder("Macros")

Public Sub AddSalesRep()
    With New SalesRepPresenter
        .Present New OrderSheetProxy, New SalesRepsSheetProxy
    End With
End Sub

Public Sub AddCustomerAccount()
    With New AccountsPresenter
        .Present New OrderSheetProxy, New SalesRepsSheetProxy, New AccountsSheetProxy
    End With
End Sub

Public Sub AddCustomerLocation()
    With New LocationsPresenter
        .Present New OrderSheetProxy, New SalesRepsSheetProxy, New AccountsSheetProxy, New LocationsSheetProxy
here's the SalesRepPresenter.Present method:
Public Sub Present(ByVal orders As IOrderSheet, ByVal reps As ISalesRepsSheet)

    Set this.View = New AddSalesRepForm
    Set this.Model = New SalesRepModel
    Model.Initialize orders, reps

    If Model.OrderSheet.HasValidSalesRep Then
        If MsgBox("A valid AE/SalesRep is currently selected. This will overwrite it. Proceed?", vbYesNo + vbExclamation) = vbNo Then Exit Sub
    End If

    If View.ShowDialog(Model) Then
        Model.SalesRepsSheet.AddSalesRep Model
        Model.OrderSheet.HeaderSalesRepCode(reps) = Model.Code
@CallumDA ^
the SalesRepSheetProxy:
Option Explicit
'@Folder("Data.Concrete")
Implements ISalesRepsSheet

Private Property Get ISalesRepsSheet_SalesRepsTable() As ListObject
    Set ISalesRepsSheet_SalesRepsTable = SalesRepsSheet.ListObjects(1)
End Property

Private Property Get ISalesRepsSheet_SalesRepCodes() As Variant
    ISalesRepsSheet_SalesRepCodes = Application.Transpose(ISalesRepsSheet_SalesRepsTable.ListColumns("Code").DataBodyRange.value)
End Property

Private Sub ISalesRepsSheet_AddSalesRep(ByVal m As SalesRepModel)
    With ISalesRepsSheet_SalesRepsTable.ListRows.Add
 
> @manjugb It's not clear what you intend to do here.

If you are trying to use Rubberduck, it's a VBE add-in, not an add-in for Visual Studio, so you should use a VBA host (e.g. Excel, Access, or anything else that let you writes VBA code)

If you are trying to contribute to Rubberduck, then you need to fork & clone the Rubberduck git repository so that you can then load the project into the Visual Studio.
> Hi @manjugb,

If you mean to *use* Rubberduck, then you're all set (having installed a release build with admin privs) - just start Excel, bring up the VBE and Rubberduck will load.

If you mean to help *develop* Rubberduck, then you need to uninstall the release build and fork/clone the repository through git. See the [wiki](https://github.com/rubberduck-vba/Rubberduck/wiki/Contributing) and read [CONTRIBUTING.MD](https://github.com/rubberduck-vba/Rubberduck/blob/next/CONTRIBUTING.md) - d
 
3:57 PM
@Mat'sMug, ^^ that's the dream. Clearly I need to get more comfortable with interfaces...
 
I wish I could plant some spy in that workbook, that turns on the webcam and streams live feed of whatever dev looks at that code when I'm gone :)
 
of course you can.
Just give them a XLSM.
 
lol
of course it's a xlsm
@CallumDA FWIW I haven't fully decoupled the components yet - if I were to write unit tests I'd be injecting the View and the Model instead of Newing them up in the presenter
 
@Mat'sMug the point being that you can write VBA code to turn on the webcam and stream it.
 
lol, yeah but... no :)
also... that project should be a F'n web app
working on the order details now, and the dynamic data validation is just... mind-wrecking
 
4:11 PM
That's why some of our clients, especially those who don't work with Excel all day, see a xlsm and think it's a bad file marked by AV and refuse to open it, thinking it'd brick their computer. We avoid this by always distributing XLSX files.
Just curious, have you ever looked at PowerApps?
 
nope
 
Supposed to be a good fit for that kind of scenario... If you can persuade your 70 years-old people to gasp not use Excel.
 
Kaz
Hey @Mat'sMug, it's been a while :)
 
hey @Kaz!
 
Kaz
Hi @this
 
4:13 PM
hey Kaz
 
Kaz
How's RD doing these days?
 
IDK about others but I got the dialog to show. :)
(the extract method dialog, that is)
 
as far as I'm concerned, it's on the backburner right now... lots of work on my plate :(
@this that's awesome!
 
 
:)
it's a start!
 
4:15 PM
currently blank. :) Cos the model & viewmodel now need to be rewritten.
but it's now WPF-in-Winform
 
 'pray to greatbig spaghetti moster in the sky
0
Q: Defining "LastRow" in a worksheet - part of a VBA that aggregates other sheets

roger claveauI am rehashing an older file of mine and cannot figure out how to define Last row so that the script can properly find the last row of data in the destination worksheet and active worksheet. When run I get the definition error. I'm sure this is a simple item. Below is a copy of the VBA: Sub S...

 
@Mat'sMug quick check --- who should be responsible for bringing up the presenter? The command or the refactoring?
 
the refactoring I'd say. that way the command only needs to know about the refactoring
right?
 
That's actually what I did
 
:+1:
IOW the whole MVP salsa is an implementation detail of the refactoring, so the command should only need to be concerned with the higher-abstraction-level refactoring
 
4:30 PM
yes, i asked because in ReorderParameters the command brings up the factory which is then passed into the refactoring.
 
#TechnicalDebt
 
which seemed wrong to me. Once it's refactored with the new creational pattern I wrote, command shouldn't have to know about factory nothing
^
 
the "best design" emerges with time
 
so that. we never get it right first time
that's what the iterative process is supposed to do for us.... but I haven't been very iterative. :\
 
the trick is to actually pay the technical debt as the "best design" gets clearer
 
4:32 PM
yeah
 
Hey, can I ask sth changing the topic?
:)
 
@NelsonVides sure what's up
 
I was just browsing through the VS warnings
and there's a "CS0108 C# hides inherited member. Use the new keyword if hiding was intended."
on UI.Commands.FindAllImplementationsCommand
 
hmm what's the member?
 
"Logger"
It's inherited from the interface CommandBase
but it doesn't have any override or new on it
 
4:39 PM
Currently formatting and positining my userforms in the Presenter like this. Is there a better way?
 
it's an abstract class.. does CommandBase name its logger per the most-derived type?
 
Public Sub ShowMainMenu()
    Set mm = New MainMenu
    FormatAndPosition mm
    mm.Show vbModal
End Sub
 
@CallumDA put the UI concerns in the view's code-behind :)
e.g. formatting & positioning
 
The only problem with that is I'd be putting the same code in (say) ten different forms
Still the right way to go?
 
you have 10 forms that look the same?
 
4:41 PM
I'm also guessing that you want FormatAndPosition to be consistent for all userforms. You can have those userforms implement an interface that requires FormatAndPosition
The interface could be made into an abstract class to provide you with a default implementation.
 
Haha, no. But I have 10 forms which I want to be positioned in the middle of the screen and format with the same background colour
 
on CommandBase we only have
protected ILogger Logger { get; }
and on findAllImplementationsCommand
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
 
    protected CommandBase(ILogger logger)
    {
        Logger = logger;
    }
so it's the derived type that's naming the logger, i.e. the CS warning is warranted - the derived type has no business re-defining a logger
 
btw, how do you do to format as code here on the chatroom?
 
in theory 4 spaces and ctrl+enter ought to work. I doesn't for me, so I click the "fixed font" button to the right.
 
4:43 PM
inline with backticks
 
Paste in and then click fixed font
 
or hit Ctrl+K on a multiline post (or click the "fixed font" button that shows up)
(multiline messages can't otherwise be formatted)
chat formatting is kinda buggy
 
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
right, now has some format, thanks!
 
^ yup. that's the same logger as the base class
 
coming back to the topic
 
4:45 PM
just delete the private static readonly Logger field
 
btw, naming a type and a variable with the same name feels incredibly confusing
 
that's why the proper declaration is an ILogger ;-)
 
hmmm... so as a type, instead of Logger Logger, it should be ILogger Logger?
 
yeah. that's what the base class has
IOW no CommandBase implementation should have a Logger field or property - they should all use the inherited protected ILogger Logger
 
Base class has several other interfaces implemented, how do we know we're not going to call a method from those other interfaces if we already declared the type as Logger?
 
4:48 PM
base class implements WPF's ICommand interface..
C# interfaces can't have concrete members
this isn't C++ ;-)
 
(sorry for my C++ mindset xD)
 
np
basically the diamond problem is avoided in C#
there's no multiple inheritance
a class can implement as many interfaces as it needs, but can only ever inherit a single base class
 
let me get myself through... CommandBase implements ICommand, but Logger implements ILogger, but also ILoggerBase and so on
 
I guess. I don't really care what ILogger inherits, I just need to know about an ILogger :)
although, ILoggerBase doesn't look right
 
But if we declared Logger as Logger, changing it to ILogger wouldn't make it lose some methods?
 
4:52 PM
35
Q: What's the difference between an abstract class and an interface?

WpfBeeSuppose we have two methods M1() and M2() in an interface. An abstract class also has just the same two abstract methods. If any class implemented this interface or inherited from the abstract class, it will have to implement both the methods in it. So to me, it seems that an interface or an abs...

 
I just wanna to confirm. We are using DI for stuff like state and indenter. However, the DI starts with the command, so that means the refactoring has to take them as a dependency in the ctor, and in turn, the model has to take them as a dependency from the refactoring? Feels a bit too much buck passing.
 
@NelsonVides on the compile-time type, yes - in theory (the concrete type could be exposing members that aren't on ILogger). but we only care about the ILoggerinterface here.
 
excellent, SO discussions to the rescue xD
 
@this something needs a factory I think
 
for the state and indenter?
 
4:54 PM
so if it breaks something it means we caught it doing it what it shouldn't have
 
@this state and indenter need to be dependencies of the types that actually consume them
 
hmm. the root issue is that the model gets new'd, so DI don't apply.
 
^ that's where the factory should take over
basically we broke the rules
and did half-assed DI
 
but.... i'm not sure that get me anywhere.
Because if I made a model factory that takes the state and indenter as a dependency
I still have to pass it through command & refactoring
 
don't make a model factory
 
4:57 PM
@Mat'sMug continuing with this, you're telling me to delete this field from the Child class, as the Base class is already giving it a value. But Child class was giving it a value already, that's going to be used somewhere else: shouldn't we make sure first this value won't be lost?
 
the model gets new'd up as part of the creation of something else
 
right now, it's new'd within the refactoring class, which is then passed to the presenter's static factory method.
 
@NelsonVides both values (references, actually) are pointing to the exact same object
 
bad grammar of mine, references I meant
 
@this not sure I can do this without making drawings
 
4:59 PM
all right... so this like goes out on the Child Class...
 
but I gotta get me some state and indenter somewhere to new up the model; it's required for its ctor. OK.
Will think about it a bit more.
 
oh, I got it now! Mini eureka moment, thank you!
 
:+1:
ugh. Excel just froze to death on me
> Updating Cells...
FML
 
IDK if this works.... webwhiteboard.com/board/395exfag
seems it does (tested in incognito window). Apologies for fugly sketch. :)
 
5:17 PM
Hmm phone doesn't like it lol
Bbl
 
 
1 hour later…
6:42 PM
@Mat'sMug ramen
 
7:39 PM
@Mat'sMug you want to shoot a small look at the libgit2sharp update?
or do you want to run a green release before merging that change?
 
8:31 PM
Updated the mockup here: webwhiteboard.com/board/395exfag
Not sure this helps things that much. Still too much buck-passing.
Also making the command taking model as a dependency feels wrong.
hmm.
I think I see what's wrong.
Command should take Refactoring as the dependency.
Refactoring should take Model as the dependency.
Yeah, that works. No more buck passing.
 
9:01 PM
looks like I DID need a factory but for the refactoring class, so that I can defer the creation of the refactoring class until I actually need it.
that hopefully will then let CW do its magic for the DI on the refactoring class itself.
 
9:20 PM
Personally, I would have gone with a factory instead of each new.
Using an auto-magic factory, you can let CW provide all those exterior dependencies.
Only problem: you have to release them in the end.
On the other hand, you can write a not auto-magic factory that does the same but does not bind the created object to the container.
 
> TODO:

- [ ] finalize UI
- [x] don't nuke the whole runtime on doubleclick
- [x] write (and fix) unit-tests for nesting level
- [ ] i18n corrections
[rubberduck-vba/Rubberduck] build for commit ec3061ad on unknown branch: AppVeyor build succeeded
> Current Status:
![unbenannt](https://user-images.githubusercontent.com/7288995/33224193-0bcf4676-d167-11e7-8f5d-94200be72630.PNG)

There's still some minor cosmetic fixes on the UI to be done, as well as i18n. Reviews are highly welcome
 
10:10 PM
> TODO:

- [x] finalize UI
- [x] don't nuke the whole runtime on doubleclick
- [x] write (and fix) unit-tests for nesting level
- [ ] i18n corrections
 
@M.Doerner That's what I'll be doing for the refactoring class. The model should be DI'd into the refactoring class. The other classes (presenter, view, viewmodel) all are managed by a non-magic factory.
 
[rubberduck-vba/Rubberduck] build for commit 01fb5aa4 on unknown branch: AppVeyor build succeeded
 
^^ finished...
 
> TODO:

- [x] finalize UI
- [x] don't nuke the whole runtime on doubleclick
- [x] write (and fix) unit-tests for nesting level
- [x] i18n corrections
> Current Status:
![unbenannt](https://user-images.githubusercontent.com/7288995/33224193-0bcf4676-d167-11e7-8f5d-94200be72630.PNG)

There's still some minor cosmetic fixes on the UI to be done, as well as i18n. Reviews are highly welcome
> TODO:

- [x] finalize UI
- [x] don't nuke the whole runtime on doubleclick
- [x] write (and fix) unit-tests for nesting level
- [x] i18n corrections
 
The other thing I'm looking at -- is command really supposed to be responsible for determining if refactor is possible or not? Seems that should be a concern of the refactoring class, not the command class....
 
10:23 PM
[rubberduck-vba/Rubberduck] build for commit 0f1f57b7 on unknown branch: AppVeyor build succeeded
> I want that in 2.x, but it needs to be specified in more details:
- [x] **Lines of code**; easy. just count non-empty trimmed lines; separate comment lines from actual lines with executable instructions.
- [x] **Cyclomatic complexity**; that's probably a job for a parse tree listener. not exactly a walk in the park, I'm not sure how I'd calculate this metric, but it's certainly feasible.
- [ ] **Maintainability index**; even harder, requires the above two metrics, and some "Halstead Volume" fi
> #3522 includes "lines" "cyclomatic complexity" and "nesting level". It does not include a maintainability index. The design should be extensible enough to not completely go bonkers when somebody wants to implement it. I think we can close this issue when the PR is merged, though.
 
4 messages moved to trash because checklists on Github suck
'nuff RD for today.
 
Normally I don't mind Duga being talkative but I think that's one time where she is a bit too much talkative. We don't exactly benefit from getting individual notifications for each comment in a review group, do we?
 
@this we don't but Duga only gets each review comment as a separate comment event from Github. so that's basically
 
Ninja'd me :P
 
10:58 PM
who? where?
 
You.
Just now.
I literally logged in to tell this that we couldn't help it.
2
 
@Duga Yeah, @Vogel612 - that's why I commented about that comment, since it's basically the cause of the misery because Mat did it twice. :)
 
holy carp it's midnight already
 
Cld be worse. It was 4 am for you before.
Take a break, man. :)
 
Don't worry about that.
Checking the CancellationToken will add a non-insignificant amount of time to the walk.
 
11:02 PM
JIT should be able to hotpath that
 
True.
Ishh, Java style:
if (parser.State.Status == ParserState.Error) {
Approved, pending that brace position being fixed :P
 
11:27 PM
oh whoops
 
> Just to mention it, because of the first exception handler in the post above, the comment in the commented out code is a complete lie: uncommentiong does not crash the process. This has already been rather confusing and annoying when porting to CW. (I really wanted to see where it crashes in the debugger.)
 

« first day (1267 days earlier)      last day (1913 days later) »