« first day (401 days earlier)      last day (2779 days later) » 

12:01 AM
RELOAD!
[Cardshifter/Cardshifter] 10 commits. 3 opened issues. 618 additions. 502 deletions.
[Hosch250/Rubberduck] 5 commits. 248 additions. 79 deletions.
[rubberduck-vba/Rubberduck] 4 commits. 672 additions. 118 deletions.
[Vogel612/TranslationHelper\‌​] 4 commits. 2 closed issues. 87 additions. 4 deletions.
[Zomis/StackSTV] 1 commit. 208 additions. 40 deletions.
 
Come on, @Duga, I just pushed.
 
^ Ditto
 
Ha. I'm whupping you guys already - 1k+ changes for tomorrow.
 
[Hosch250/Rubberduck] Hosch250 pushed commit c1651939 to next: Update all extension usages to use RubberduckCodePane
[Hosch250/Rubberduck] Hosch250 pushed commit 8efa91a3 to next: Forgot to DI the IRubberduckFactory<IRubberduckCodePane> factory in one place, and forgot to assign it in another.
 
12:36 AM
@Rossco I guess that depends on your goals. If you'd ever want to use it with VBScript, you'd probably want to support the "other" syntax. If you're just looking to support the VBE, then it's fine.
The only other thing I can think of is implementing your own compiler and/or IDE.
That would be a case where you'd have to make a judgement call. Do you stick to the spec, or keep it simple?
 
I think it's best to implement the spec.
then it's going to work for the VBE and anything else that follows that spec.
 
12:52 AM
Good thoughts guys. I'm just wondering if YAGNI and so not implement it til I do?
I am leaning toward building a standalone grammar (not reliant on the VBE)
 
1:03 AM
I'm not so worried about supporting VBScript (or even VB6) at this stage. It can be extended to that based on demand.
Basically I want to get the grammar functioning perfectly for VBA, with unit tests to verify that, then evolve it from there.
Its really close to being alpha ready now.
 
1:19 AM
@Rossco depends what the goal is. If the goal is to implement the language spec as closely as possible, YAGNI doesn't apply
If the goal is to implement the language specs close enough to work with whatever comes out of the VBE, then maybe yeah
 
1:40 AM
[Hosch250/Rubberduck] Hosch250 pushed commit 996a6843 to next: Finish testing Rename presenter.
Merge pull request #702 from Hosch250/next

Rename tests
Merge pull request #704 from Hosch250/next

Fix bugs, more tests
Merge pull request #705 from Hosch250/next

Closes issue #698
[Hosch250/Rubberduck] Hosch250 pushed commit 6982b5eb to next: Merge branch 'next' of github.com/rubberduck-vba/Rubberduck into next
 
I just pulled from the main repo.
There is my afternoon's work, @Mat'sMug.
 
[rubberduck-vba/Rubberduck] build for commit 996a6843 on ???: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 6982b5eb on ???: AppVeyor build succeeded
 
@Hosch250 well done!
 
BTW, if this broke anything, it serves you right for not already having unit tests up ;)
 
lol
...but we're doing this so tests can be written
I'm having issues with setting up the VBComponent.Designer property.
the thing returns an object...
not sure how we're going to be able to mock a userform
 
1:51 AM
You need to ... cast it?
NVM, it only does that sometimes.
 
what is this?
+    public interface IRubberduckFactory<out TPresenter>
+    {
+        TPresenter Create(object obj);
+    }
 
You've got to cast it.
 
public IRubberduckCodePane Create(object codePane)
{
    return new RubberduckCodePane(codePane as CodePane);
}
 
why did you make it generic?
 
1:56 AM
You said make an abstract factory.
 
lol
 
So, I made the abstract factory just like IRefactoring.
 
abstract factory is a creational pattern
 
Oh.
 
doesn't mean it's an interface that can create just about anything out there and its father
 
1:57 AM
Lol.
 
it returning an interface is good enough :)
 
So, just kill that?
 
see, a "factory pattern" would return a known, concrete type. an "abstract factory" returns an interface, an abstraction
 
OK.
I'll kill that an push in a sec.
 
so..
public interface IRubberduckCodePaneFactory
{
    IRubberduckCodePane Create(CodePane codePane);
}
is good enough
 
2:05 AM
[rubberduck-vba/Rubberduck] retailcoder pushed commit 4b4951a1 to GrammarIsFun‌​: implemented mock builders
[rubberduck-vba/Rubberduck] build for commit 4b4951a1 on GrammarIsFun: AppVeyor build succeeded
 
@Hosch250 want to test the builders?
 
Builders?
 
[rubberduck-vba/Rubberduck] build for commit 4b4951a1 on GrammarIsFun: AppVeyor build succeeded
 
var vbeBuilder = new MockVbeBuilder();
var project1 = vbeBuilder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none);
project1.AddComponent("Module1", vbext_ComponentType.vbext_ct_StdModule, content1)
           .AddComponent("Module2", vbext_ComponentType.vbext_ct_StdModule, content2)
           .AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, class1)
           .AddComponent("Class2", vbext_ComponentType.vbext_ct_ClassModule, class2)
vbeBuilder.AddProject(project1.Build());
@Hosch250 you can chain the calls
 
OK.
 
2:12 AM
4 hours ago, by Mat's Mug
builder pattern is pretty nifty
 
Later.
 
not tested yet
 
Merge pull request #710 from rubberduck-vba/GrammarIsFun

implemented mock builders
 
it's just "there", I haven't removed anything in the MockFactory
actually I did
but just the dead code
 
2:13 AM
[rubberduck-vba/Rubberduck] build for commit 26ab044a on next: AppVeyor build succeeded
 
the builders completely mootinate the MockFactory
 
OK.
 
"builder pattern" is another creational pattern ;-)
        public MockProjectBuilder AddComponent(string name, vbext_ComponentType type, string content)
        {
            var component = CreateComponentMock(name, type, content);
            _components.Add(component);

            return this;
        }
^^ the builder methods return ..the builder instance itself
that's why/how you can chain all the builder calls
 
[Hosch250/Rubberduck] Hosch250 pushed commit 7d11c51d to next: Remove the great grand-dady of all abstract factories.
 
@Duga lol
I'll pull that later, gotta go for now
 
2:16 AM
Me too - dishes again.
 
[rubberduck-vba/Rubberduck] build for commit 7d11c51d on ???: AppVeyor build succeeded
 
See you.
 
later!
@RubberDuck I'll need your input & thoughs on this:
5 mins ago, by Mat's Mug
var vbeBuilder = new MockVbeBuilder();
var project1 = vbeBuilder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none);
project1.AddComponent("Module1", vbext_ComponentType.vbext_ct_StdModule, content1)
           .AddComponent("Module2", vbext_ComponentType.vbext_ct_StdModule, content2)
           .AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, class1)
           .AddComponent("Class2", vbext_ComponentType.vbext_ct_ClassModule, class2)
vbeBuilder.AddProject(project1.Build());
 
2:54 AM
Oh, I a sucker for method chaining...
Taking a look at that merge now.
Looks good to me.
Just so I have it straight @Mat'sMug, the MockFactory does all the straight forward setup of individual components, then the builder wires them together, right?
Oh.. And @Rossco I tend to agree with what Mug said.
> depends what the goal is. If the goal is to implement the language spec as closely as possible, YAGNI doesn't apply
If the goal is to implement the language specs close enough to work with whatever comes out of the VBE, then maybe yeah
 
3:13 AM
@RubberDuck nope. Builder replaces the MockFactory
I duplicated a bit of code from the factory, but left everything in place to avoid breaking anything
Oh and if you figure out how to mock the designer.....
 
Ahh okay. Mind marking the MockFactory [Obsolete]? And I'll look at that. What's the issue with it? It's passed as an Object, right?
 
I have no idea what the type is
Doesn't seem to be in the VBIDE library
@RubberDuck I'll mark it obsolete... or refactor the existing tests and just delete it :-)
And yeah, VBComponent.Designer is an object
 
3:29 AM
Well... That complicates things. Okay. I'll have to look into the code to see how it's being used.
 
OK, guys, I'm back.
 
@RubberDuck IIRC it's used in Declarations, to get the control names (for creating the Control declarations)
 
@Mat'sMug I'll look at the designer in a sec, or tomorrow.
Depends on a couple things.
 
If not I'll try to figure it out when I'm back home, later
@RubberDuck not sure I understand that sentence ;-)
 
@Mat'sMug This help any?
if (module.Parent.Type == vbext_ComponentType.vbext_ct_MSForm)
{
    var codeModule = (CodeModuleClass)module;
    codeModule.Parent.Name = _model.NewName;
    module.Parent.Properties.Item("Caption").Value = _model.NewName;
}
 
3:36 AM
@Hosch250 hmm we need to setup the properties as well it seems
But no that's not it
 
OK.
Hold on, I'm going to write one more Rename test.
 
@Hosch250 try the builder API :-)
I think it works
 
I'm not sure I know how to mock an Object is all. There's no interface to implement. I'm honestly not even sure how the compiler sees that Properties property.
 
@RubberDuck IIRC we're using a dynamic type and just getting the Controls collection
Wouldn't it work as long as we're setting it up to return any type that has a Controls collection?
 
I think so. So long as Moq can handle a dynamic. We might have to do it the old fashioned way though. Like I did for Windows
Frakkin COM Interop anyway. =;)-
 
3:51 AM
uh-huh
@RubberDuck hmm it's not Moq, .. dynamic can't be used in a lambda expression. I wonder.... ugh I want to be on my laptop now!
 
Like I said, might have to Mock it the old fashioned way.
 
Guess what?
I have a test up for making sure renaming a project works.
I didn't use the builder API, AFAIK.
I have to go right now, so I don't have time to look into it.
 
BBL.
 
[rubberduck-vba/Rubberduck] build for commit 863cbbc4 on ???: AppVeyor build succeeded
 
4:01 AM
@Hosch250 wait a minute... renaming a form shouldn't change its caption!
 
4:32 AM
@Mat'sMug That's so.
But, it looks dumb when the caption is just the default caption from a previous version.
Mind if I put an if in there?
Done.
 
[Hosch250/Rubberduck] Hosch250 pushed commit 66b66656 to next: Only change form caption when caption is same as original name
 
And with that, we are probably ready for 1.4.x after you fix the Rename bug.
Might as well finish refactoring Rename while you are at it.
 
[rubberduck-vba/Rubberduck] build for commit 66b66656 on ???: AppVeyor build succeeded
[Hosch250/Rubberduck] Hosch250 pushed commit 32cf4d45 to next: Refactor MessageBox.Show() out of Rename, uses our IMessageBox instead.
[rubberduck-vba/Rubberduck] build for commit 32cf4d45 on ???: AppVeyor build succeeded
 
4:53 AM
@Hosch250 ok, nicely implemented
 
BTW: IConnectionPointContainer
The designer appears to implement that interface.
 
Ooh thanks!!
...where's that interface?
System.ComponentModel?
 
It is a COM object.
 
Yeah, just looked it up
We need the interface that exposes the Controls property
OMG
1
A: Find all controls on msform from c#

user248871This code should work: using System; using Microsoft.Office.Interop.Excel using VBA = Microsoft.Vbe.Interop; ... VBA.Forms.UserForm form; VBA.Forms.Control c; foreach (VBA.VBComponent mod in wb.VBProject.VBComponents) { // Use only VBA Forms if (!(mod.Designer is VBA.Forms.UserForm))...

The obvious was right there in my face!!
 
Oh duh, you wanted that?
var form = _model.Target.QualifiedName.QualifiedModuleName.Component.CodeModule;
var control = ((dynamic)form.Parent.Designer).Controls(_model.Target.IdentifierName);
There you go.
Night.
 
5:30 AM
Night!
 
 
1 hour later…
6:38 AM
@Hosch250 the type we need is in Microsoft.Vbe.Interop.Forms, which is in a separate assembly. @RubberDuck I'm adding the PIA to the unit testing project, but since dynamic works in the Rubberduck project I'll just leave it as is.
 
6:57 AM
[rubberduck-vba/Rubberduck] retailcoder pushed commit 96840e0a to GrammarIsFun‌​: added MockUserFormBuilder
[rubberduck-vba/Rubberduck] build for commit 96840e0a on GrammarIsFun: AppVeyor build succeeded
 
7:15 AM
[rubberduck-vba/Rubberduck] retailcoder pushed commit b1d9556c to GrammarIsFun‌​: added xml docs
[rubberduck-vba/Rubberduck] build for commit b1d9556c on GrammarIsFun: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit b1d9556c on GrammarIsFun: AppVeyor build succeeded
Merge pull request #711 from rubberduck-vba/GrammarIsFun

Mock UserForm
[rubberduck-vba/Rubberduck] build for commit b1d9556c on next: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] retailcoder pushed 14 commits to next (only showing some of them below)
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 8224f49d to next: Fix bug.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit c1651939 to next: Update all extension usages to use RubberduckCodePane
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 8efa91a3 to next: Forgot to DI the IRubberduckFactory<IRubberduckCodePane> factory in one place, and forgot to assign it in another.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 996a6843 to next: Finish testing Rename presenter.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 6982b5eb to next: Merge branch 'next' of github.com/rubberduck-vba/Rubberduck into next
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 7d11c51d to next: Remove the great grand-dady of all abstract factories.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 863cbbc4 to next: Test for renaming project.
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 66b66656 to next: Only change form caption when caption is same as original name
[rubberduck-vba/Rubberduck] Hosch250 pushed commit 32cf4d45 to next: Refactor MessageBox.Show() out of Rename, uses our IMessageBox instead.
Merge pull request #709 from Hosch250/next

Implement IRubberduckCodePane and more Rename tests.
[rubberduck-vba/Rubberduck] build for commit 3f5b3bc6 on next: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 44a11158 on next: AppVeyor build succeeded
 
@Mat'sMug @RubberDuck @Hosch250 Did you know that Rem a comment is not the same as ' a comment?
 
[rubberduck-vba/Rubberduck] build for commit 44a11158 on next: AppVeyor build succeeded
 
@Rossco how so?
 
[rubberduck-vba/Rubberduck] build for commit 44a11158 on next: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 44a11158 on next: AppVeyor build succeeded
 
@Hosch250 your changes broke the RubberduckTests project. The configuration manager is set to not build the test project - only building rubberduck is not sufficient. we have unit tests, they need to be run. if you had executed the tests you would have had the same build error I'm having now.
> Error 49 'Rubberduck.VBEditor.QualifiedSelection' does not contain a constructor that takes 2 arguments C:\Users\Mathieu\Source\Repos\Rubberduck\RubberduckTests\VbeTestBase.c‌​s 42 20 RubberduckTests
> 46 errors in 4 files
I'm changing the configuration
building the solution is going to build the unit test project from now on
@Rossco Rem is an instruction, ' is probably just a lexer token ...aside from semantics, what's the difference?
@Hosch250 my apologies, somehow the project wouldn't build without restarting VS after that merge. Everything works.
I'm still going to change the configuration to build the test project along with the solution.
that was disabled back when tests were broken.
...
it's checked.
 
7:37 AM
@Mat'sMug This is valid:
Public Sub CommentTest1()  ' test
    Dim Class_Initialize   ' test
End Sub                    ' test
This is not:
Public Sub CommentTest2() Rem test
    Dim Class_Initialize  Rem test
End Sub                   Rem test
 
it's an instruction
needs an instruction separator
 
yeah, fair enough. I didn't know that.
 
and Rem comments were historically located at the beginning of a line ;)
 
I wondered why the spec was making such a distinction between the two.
Did you know you can use a line continuation in either of them to continue a comment onto the next line?
 
yup
 
7:39 AM
That's hideous!!!!
 
indeed!
...why do I have 100 tests failing because NLog couldn't be found? ...
ugh
because I removed the NLog reference manually like a twitt
 
7:54 AM
@Hosch250 RenameRefactoring_RenameEvent isn't passing?
 
8:20 AM
ok so I switched 3 tests over to the builder, and they pass.
the API needs a bit of work though
because the 1-liner..
var project = SetupMockProject(inputCode);
turned into..
        var builder = new MockVbeBuilder();
        var projectBuilder = builder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none);
        projectBuilder.AddComponent("Module1", vbext_ComponentType.vbext_ct_StdModule, inputCode);
        var project = projectBuilder.Build();
        builder.AddProject(project);
the difference is obviously that the former only had a project and the latter gives us a full-fledged IDE
...which might be overkill
 
[rubberduck-vba/Rubberduck] retailcoder pushed commit b44f3eb6 to next: fixed NRE in QualifiedModuleName, added XML comment to Selection.Home
[rubberduck-vba/Rubberduck] retailcoder pushed commit 6748cdcf to next: testing MockVbeBuilder API... switched 3 tests to it.
 
hey @Vogel612
 
[rubberduck-vba/Rubberduck] build for commit 6748cdcf on next: AppVeyor build succeeded
 
4:26AM here, I'm out!
 
Hiya
ohhh dear
 
8:25 AM
yeah
Hmm the builder might be overkill when all you need is a module, but it gives you a mock IDE that's guaranteed to be set up so that if the SUT calls module.VBE it gets a correctly mocked-up instance. Not sure it's overkill afterall. Might just need a little "shortcut API" that takes fewer params and spits out a module.
Dammit, I need to sleep.
 
yes, you do
you might facedesk tomorrow when reading today's code
 
lol
 
8:41 AM
new question for you guys.
The MS spec distinguishes between class and standard module grammars.
I've currently written it neutrally because I wasn't sure that it would always be possible to know that a module is a class or standard module.
Assuming that we may be working outside the VBE at some point in the future.
Is this reasonable? Or should I follow the spec and expect that the caller will use the correct root grammar rule?
 
 
2 hours later…
10:31 AM
@Mat'sMug leave the factory in addition to the builder. I'm sure we'll run across things where we only need pieces. It's not production code, we don't have to treat it like production code.
@Rossco that's a really tough question. If you parse the simple text from the editor, without the header and some help from the VBComponent, I don't know how you could possibly tell that it's one or the other. So, it does make sense to have a single grammar for both of them.
On the other hand, lots of stuff is only valid in one place or another, so separating them makes a ton of sense.
In short, idk brother...
 
Hmmm....
I would expect that the header info would be available.
Otherwise it would be impossible.
I was wanting to allow it to create a parse tree, then use a semantic pass to advise whether a particular declaration is valid for the module type.
But I may not need to since Antlr is good at adding/removing tokens which are invalid/missing.
 
The header is only available if you export the module into a text file.
Which isn't hard. I more or less solved the hard part of that problem.
 
For the source control feature I presume?
 
Remind me why you do something different for document modules?
I've forgotten.
 
Come to think of it @Rossco, it was only a hard problem because I needed to get those files back into the project.
Because I couldn't straight import a file into a document's code behind.
Threw a runtime error.
 
Ah that's right. The import side.
I guess because it already exists.
 
Yup, so exporting is really a simple thing. Yes, and there's no way to make some of them not exist.
Like, ThisWorkbook
And removing a sheet could be disastrous. Lol
 
 
2 hours later…
1:13 PM
[Vogel612/TranslationHelper]‌​ Vogel612 pushed commit d56a6c14 to master: Update README.md
[Vogel612/TranslationHelper] build for commit d56a6c14 on master: The Travis CI build passed
> So I just stumbled upon this in the code:

// FIXME: send that to the presenter so we can clean up and close shit!

and my past self is completely right. We should check the WindowClosing event for unsaved changes and prompt the user when they want to close this
 
1:43 PM
> Prerequisite for the Return based Translation initiation seems to be implementing a nice selection model for the JTable when using the arrow keys to navigate, basically highlighting or rather selecting a whole row is necessary before the Return Key can be bound.
 
2:10 PM
hey @RubberDuck that "SourceControl_AttributesFile" ... what is that?
 
Uhhh.... I don't know.
I didn't really mess with the localization at all. Hosch and Mug did all that.
I'm guessing it has something to do with the .gitattributes file.
 
.... there is something like that??
'cuz I don't know that from git..
or is that the configuration?
yea.. no .gitattributes on my lappie.
 
@Mat'sMug I DID run the unit tests, and I wrote like 5 more to boot.
Oh, now I see the apologies.
And yes, the events test is failing.
@Vogel612 No idea.
 
2:26 PM
hmm...
another thing.. you're expecting \r\n out of the .resx right?
 
Um, no.
 
because I tried doing the linebreaks and it got converted into &#xD; by JDOM
 
On Windows, I assume it uses \r\n, but I don't handle that.
That is handled deeper by the system.
 
do you by chance know a multiline string off the top of your head?
 
Yes.
 
2:29 PM
do tell then :D
 
Rubberduck Code Inspections - {0}
{1} issues found.
CodeInspections_NumberOfIssuesFound_Plural
In RubberduckUI.resx
 
hmm yea
okay it's handled by the "xml:preserve"
 
which means I need to stop JDOM from butchering my newlines into XML-Escapes
 
I just used a streamreader and a streamwriter and wrote to the file.
 
2:33 PM
well.. I got a whole nice DOM tree
maybe it'd be simpler to not do that
then again I'd probably still need JDOM XML Serializer to stop doing the escape
 
@Mat'sMug Correct.
 
You guys know you have "new Branch" twice? once as title, once as .. vanilla?
 
Leaving now.
Be back in the afternoon.
 
2:51 PM
[Vogel612/TranslationHelper]‌​ Vogel612 pushed commit 7e12894f to master: Added Esc and Return listeners, see #8
[Vogel612/TranslationHelper] build for commit 7e12894f on master: The Travis CI build passed
 
CRAP:
Overencoding!...
hmm... comparing directly it doesn't look too bad...
 
[rubberduck-vba/Rubberduck] build for commit fb599a9a on ???: AppVeyor build succeeded
 
^ there you go
PR open :D
 
3:27 PM
@Vogel612 great! Next bugfix release will include a German localization! :-)
 
> Danke schoen, sehr gut! :+1
 
3:42 PM
> @ckuhn203 I'm merging this PR, but we need to add "de-DE" to the language dropdown in the settings dialog before Rubberduck can speak German.
Added translation to German

Signed-off-by: Vogel612 <Vogel612@gmx.de>
Merge pull request #712 from Vogel612/next

Added translation to German
 
And done!
 
[rubberduck-vba/Rubberduck] build for commit b9030cef on next: AppVeyor build succeeded
 
Just merged a PR with the German translation! We'll release it with the next bugfix release.
 
4:46 PM
@rubberduckvba thank you @vogel612 for all the hard work! Check out his translation helper project: https://github.com/Vogel612/TranslationHelper
2
 
5:16 PM
[Hosch250/Rubberduck] retailcoder pushed commit 4b4951a1 to next: implemented mock builders
Merge pull request #710 from rubberduck-vba/GrammarIsFun

implemented mock builders
[Hosch250/Rubberduck] retailcoder pushed commit 96840e0a to next: added MockUserFormBuilder
[Hosch250/Rubberduck] retailcoder pushed commit b1d9556c to next: added xml docs
Merge pull request #711 from rubberduck-vba/GrammarIsFun

Mock UserForm
Merge pull request #709 from Hosch250/next

Implement IRubberduckCodePane and more Rename tests.
[Hosch250/Rubberduck] retailcoder pushed commit b44f3eb6 to next: fixed NRE in QualifiedModuleName, added XML comment to Selection.Home
[Hosch250/Rubberduck] retailcoder pushed commit 6748cdcf to next: testing MockVbeBuilder API... switched 3 tests to it.
 
Stupid Git, that was just a pull.
 
Added translation to German

Signed-off-by: Vogel612 <Vogel612@gmx.de>
Merge pull request #712 from Vogel612/next

Added translation to German
 

« first day (401 days earlier)      last day (2779 days later) »