« first day (1157 days earlier)      last day (2023 days later) » 

00:01
RELOAD!
[rubberduck-vba/Rubberduck] 1 opened issue. 4 issue comments.
[Zomis/Duga] 2 issue comments.
[Zomis/FactorioMods] 17 commits. 146 additions. 74 deletions.
00:20
@Mat'sMug yeah, two small CommandBars over to the right. They can be hidden using Win32 functions, but the VBE unhides them on most actions in the VBE. RD is already catching most of those events, so keeping them hidden shouldn't be too hard. IDK if there might be some flashing.
@Mat'sMug All of the host Interop types should be embedded. Is the AutoCAD Interop not set to embedded?
Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common both seem to have Embed Interop Types = true
01:39
> The Code Explorer window does not appear to be refreshing for new modules, possibly more.

I have a nearly-empty Excel file that I have been using for testing while working on RD.

This file:
- Contains the default `Sheet1` and `ThisWorkbook` classes
- Contains an added Userform:
- Userform: renamed `UserForm21`
- Userform: no other modifications
- Contains an added Module:
- Module: contains the following code:

```
Option Explicit

Sub foo()

Debug.Print "Hello World"
02:05
Hehe, programmers are the most psychopathic people group I've ever known: politics.stackexchange.com/questions/23403/…
Politicians cause problems, but they usually aren't psychopathic to individual people. They actually usually kind of like people from what I've seen, they just don't see the big picture.
Or the multiple big pictures, really
@Hosch250 You sure? IMHO they don't really care about people. They care about using or manipulating people for their own gain or to the benefit of their agenda.
Some, sure, but I think most at least start because they want to help.
That might be true but it doesn't last long.
Power corrupts.
 
3 hours later…
05:00
> Hi All. Thanks so much for all your work.
I would like the facility to identify and add-in to the VBA editor in other than Office apps.
I know their are other users| environments, but the one I am interested in at the moment is Arena by Rockwell. It may (i think it does) use a different VBA installation version and location ie not in the shared office library space.
So can anyone a) Write an editable script; or
b) Outline where the changes need to be in the source c
05:38
> Hi, not sure what Arena is, but Rubberduck is absolutely not constrained to Office, and works in any VBE host. Unit tests need a special host-specific bit of code/logic so that Rubberduck can know how to invoke the test methods in that host application, but other than that... If Rubberduck is registered for the bitness of your host application, it "just works"... so long as the application is hosting a VBE environment - exactly what do you mean by *a different VBA installation version and loca
> http://www.globalspec.com/reference/39338/203279/appendix-b-vba-in-arena

Sounds like VBA to me. Note that the installer will register the add-in for the bitness of the Microsoft Office install it finds on your machine. If you have other VBA host applications of a different bitness, you'll need to register the add-in manually. See the *[installing](https://github.com/rubberduck-vba/Rubberduck/wiki/Installing)* wiki page for the registry keys to create, and the regasm.exe command to run as ad
06:08
> Rubberduck should be loading under any VBA 6.x/7.x. It is only the Unit Testing feature that requires host-specific code. Unit testing is currently enabled in Excel, Word, PowerPoint, Access, Outlook, Project, Visio, CorelDRAW, SolidWorks and AutoCAD (although it seems AutoCAD might be broken at the moment).

The only requirement of a host, in order to allow Rubberduck to execute tests, is the presence of a method that can run a named macro. In most Office applications, that is the `Applicat
06:39
hmm, I think I've found a way to execute tests in any host (hosts that support Run).
It requires temporarily adding a class and a module to the project. The module has a procedure that creates an instance of the class, and can be run by Rubberduck by placing the cursor in the code block and programmatically pressing the VBE's Run button.
Once the class is instantiated and wired up to a VBE CommandBarButton, Rubberduck can execute the button, and the class instance handles the click event, and executes code.
actually, there might even be a better way, and one that puts unit tests into classes.
07:37
@Mat'sMug @RubberDuck I think I've worked out a way to run tests from any host. Tests are written in class modules, and the Inititalize/TestMethod/Cleanup procedures are called in response to an event that is triggered from Rubberduck. Here's what a test class might look like:
'ClassModule: TestClass1
Option Explicit

Public WithEvents runner As Rubberduck.TestRunner

Private Assert As Object
Private Fakes As Object

Private Sub runner_ModuleInitialize()
    Debug.Print "runner_ModuleInitialize event Running"
    'this method runs once per module.
    Set Assert = CreateObject("Rubberduck.AssertClass")
    Set Fakes = CreateObject("Rubberduck.FakesProvider")
End Sub

Private Sub runner_ModuleCleanup()
    Debug.Print "runner_ModuleCleanup event Running"
    'this method runs once per module.
And an auto-generated module that look this:
'Module: Module1 (auto-generated)
Option Explicit

Private runner As Rubberduck.TestRunner
Private tests As TestClass1

Sub auto_generated_code()
  'This procedure is auto-generated and executed by the "Run" CommandBarButton

  Set runner = New Rubberduck.TestRunner

  Set tests = New TestClass1
  Set tests.runner = runner

End Sub
Once that procedure is run by using the "Run" CommandBarButton, Rubberduck should be able to raise the events that trigger the handlers in the class instance.
I haven't tried it from Rubberduck, but once that class is instantiated, I was able to trigger the events with this VBA code:
Sub PseudoCode()
  Dim testNames As Variant
  testNames = Array("TestMethod1", "TestMethod2")

  If Not runner Is Nothing Then
    With runner
      .RaiseModuleInitialize
      Dim testNumber As Long
      For testNumber = LBound(testNames) To UBound(testNames)
        .RaiseTestInitialize
        .RaiseExecuteTest CStr(testNames(testNumber))
        .RaiseTestCleanup
      Next testNumber
      .RaiseModuleCleanup
    End With
  End If
End Sub
could that work?
Maybe RD could even pass the Assert object as a ByRef argument to the ExecuteTest event (and it wouldn't need to be created or destroyed in the initialize/Cleanup)?
08:03
C# events should run synchronously, so it should work, right?
 
3 hours later…
10:37
It might work. So long as those events don't get fired in parallel, yeah. Maybe.
10:49
Hey there :)
11:35
Monking
but which ones (events) though?
> Thanks Guys. I will try the installing wiki page notes and then follow through and let you know when I know more. Brilliant responsiveness by the way. Cheers Richard.
11:53
I hope it's OK - just modified a Wiki Page... here: github.com/rubberduck-vba/Rubberduck/wiki/Unit-Testing
Added early exit if a loop fails...

For i = 0 To 9
testResult = sut.IsValidKey(Asc(CStr(i)), value)
If Not testResult Then GoTo TestExit ' Exit if any test fails
Next
@PeterMTaylor runner_ModuleInitialize is an event handler for an event named ModuleInitialize which would be declared in a COM exposed object in Rubberduck.
Made some progress pinpointing the cause for the shutdown issue: it is not the windows crashing on exit, it is the selection change service.
> OK. [Retailcoder] Using the installing notes for 64 bit I get the described RegAsm message. Tick VG.
When I look in the VBE references I can now see the checkbox for RubberDuck.
So far so good. But that is it, no Menu entry and no Rubberduck in the add-in manager.

Now moving on to [ThunderFrame]'s advice.
BR Richard
> PS. The install worked fine out of the box for my Office apps, so I realise I am in a much smaller population that would like to use it for other environments/Host apps such as Arena. BR Richard
12:23
@Duga dude, it's only the bitness
@Duga you're still missing the reg.key
> @VeryTidyBoy if RD isn't listed in the add-ins manager then you're missing the registry key for Rubberduck.Extension under HKCU:Software/Microsoft/VBA/VBE/6.0/AddIns[64].
@M.Doerner \o/
@M.Doerner interesting. I was attached to Excel in Debug mode this afternoon. Closed some CodePanes, and got some (Window is null) errors in the Selection code. I'm unsure if we're catching all of the codepane closures?
@Mat'sMug See my event-triggered unit-testing idea? I'm unsure about synchronicity and event handlers with Interop. You think it might work? I guess the auto-generated code could put a hash value in a VBE CommandBarButton, and then RD would know that the auto-generated code had run, and then RD could fire the events.
> Good stuff! Thanks retailcoder, you got me there. I don't like to fiddle with the registry unless I am sure I have to. But, as you correctly deduced, that was the problem. And so far everything else is still working.
BR Richard.
PS: Again, brilliant responsiveness, be proud!
> @VeryTidyBoy Microsoft doesn't allow 32-bit *and* 64-bit installs of Office apps on the same PC, but there's nothing to stop you having 32-bit Office and 64-bit Rockwell Arena, or 64-but Office and 32-bit Arena....

But for Rubberduck to work in both 32-bit and 64-bit hosts, you need to ensure that the Rubberduck registry entries are present in the 32-bit registry keys and the 64-bit registry keys.
12:52
> Yes Thunderframe, I was worried about that but, as retailcoder tactfully pointed out, I just needed to follow all of the installation instructions .
As an aside, We do seem to be making life complicated for ourselves don't we, as software evolves.
The danger used to be spaghetti code, then it was lasagne object structures. Now we seem to be heading for microservices, which raises the prospect of signalling hell (which was a mainframe issue) and container problems like which russian doll is
@ThunderFrame sounds like the Outlook hack... might just work! ;-)
Better than the Outlook hack. It doesn't require an Interop reference.
13:08
Hmm you think it would work in VB6?
@Duga can we haz a star?
 
2 hours later…
15:39
@Mat'sMug Wouldn't a VB6 app need to actually start? I guess you could set a command line argument to indicate testing is active, or the specific tests to run, and then programmatically press the run button?
the run button wouldn't work any more than it would in VBA though...
i.e. you need a startup object or Main entry point.
you can't execute arbitrary procedures like you can in VBA.
the entry point would need to determine that it should run tests.
16:19
Hmm
Let's hope that unit testing VB6 won't require re-rewriting the whole feature..
Anyway, we're so not there yet ;-)
16:38
@Mat'sMug It won't.
We can always just write a second one for VB6.
17:11
Hey. Any thoughts on sharing code between autocad and Excel? git submodules could be used but I don't know if rubberduck sees files in subfolders
Or maybe two separate projects pointed at same git repository?
@NicuTofan VB6 works off actual files on the file system; VBA code is embedded in a host document, so sharing code between hosts without duplicating it has to involve exporting and importing the code files.
also RD's source control feature has... several issues, it's currently being overhauled (thanks to @shadowofsilicon)
I don't think source control is the solution for this though; code would be completely sync'd between the two projects - that's the whole point right?
Yet for different hosts, you would only want part of the code to be shared.
I think importing the files manually from a local repo would work
...but then you'd have to treat the imported modules as "read-only", and maintain the shared code as a separate project
clearly VBA wasn't made for this =)
@Hosch250 that's probably the safest solution
17:37
@Mat'sMug submodules in git should work if supported, right? And - from the point of view of the RubberDuck it is just a folder
dunno. probably worth a shot =)
admittedly, the submodules are not designed specifically for this
@shadowofsilicon @Mat'sMug what are the changes required so that we can use files inside folders in source control?
I think we would need some kind of "project file" - that has been a recurring idea for a while
But there is already a tree structure in place; would it not be easy to simply replicate this structure on the file system?
And how do you restore it without knowing what goes where?
17:48
recursive file search to get back your flat list of files
You need to have the metadata somewhere - IMO best place for that would be some .vbp project file
then simply read the markings
in the comments
'@Folder("Folder1.Folder2.Folder3")
you keep track of the location where it was at load time
and move it from there if - at next iteration - the location is different
Folder annotations might work
17:52
but it might break the things @shadowofsilicon is working on
the VBComponents wrapper (which does the actual export) can't know about declarations and annotations though, so something else needs to go in between
I made some progress again regarding the shutdown issue: apparently, the interop objects do not like to be handed over to another thread.
@NicuTofan aye. Let's get SC to work before we go and add features. We don't want to build on a broken foundation.
@M.Doerner ha, that makes complete sense!
After I changing the handling of the selection change to be sunchronous, I can now shut down cleanly as long as I do not run _app.Startup().
We have been sending the code pane object to another thread.
Hmm
arent we sending every single module to background threads as we parse?
17:55
Now, I can have a look what is the problem in the startup method.
Hmm, that is true.
Maybe, only some interop objects are a problem.
Or, maybe they just do not like to be part of events on another thread.
Still, that would be a problem.
I'd think the COM marshaler handles it, so long as no concurrent access is made
I think the parser doesn't concurrently work with the COM objects - only the extracted strings.
It wouldn't make sense to do concurrent I/O anyway
Still, Declaration knowing about its VBComponent has always been an issue. QMN's literally meant to address that... and failed.
@M.Doerner hmm, if that causes a lag with typing, we're going to have a problem
18:55
@NicuTofan - Can you create a new issue on GitHub and provide a use case example of what you are trying to accomplish? I understand the basic concept but have too many little questions, I don't know what to say. Ether way, I'm not adding any extra features until the SC base is patched up. Plus, I just joined the project... I've still got a lot of learning to do. @Mat'sMug
@shadowofsilicon sure, will do
@shadowofsilicon should I split it in two? 1. for folders in file system and 2. for submodules in (git) version control?
I mean, implementation wise, these will touch two separate parts of the code, right?
Absolutely. Smallest individual feature requests are best.
Do I understand correctly that feature #2 requires #1?
"A submodule allows you to keep another Git repository in a subdirectory of your repository" so yes, #2 requires #1
Wouldn't that already be possible through command-line git?
sure, git can do it; it's just a matter of rubberduck reading the directories
but afterwards, your git client will not work
for changes brought to those submodules
because that requires you to change the context
so two issues (#1 is enough for me but - for consistency - #2 would implement submodule-aware client)
19:11
So RD will be the superproject?
In RD right now you create a repository for the project
!for one project!
you can have multiple projects => multiple repositories
inside each git allows submodules
so each repository is a container
not sure what a superproject is
but thinking outside the box here for a second
there are already good git gui clients that work pretty well
right now RD SC only works* with one project.
why not let them do their job?
*for some values of "works"
19:14
If I read the linked man page correctly, the superproject is the top level projects that contains the subprojects
oh, ok. my bad.
@NicuTofan the idea was to have everything in the IDE, like Visual Studio's Team Explorer
I wonder if any of the git clients have a com interface
If the VBA was a subproject, this woundnt be that bad once the Export Project and Import Projects features land (Pun intended) ... Then it's just a matter of another client doing the Git-work
or something to allow embedding it inside and use it as a dependency
19:16
VS is COM
@shadowofsilicon you can't import a project without getting the host app involved though
the modules, yes. but not the project.
@Mat'sMug so there is a chance with visual studio, depending on the license
GitExtensions is a shell extension, a Visual Studio 2010-2015 plugin and a standalone Git repository tool. gitextensions.github.io
Yes, I meant "all modules in the project"
The project must already exist
@NicuTofan we are using (an older build though) the very same libgit2sharp that VS is using
Does this also provide teh GUI? I was under the impression that libgit2sharp does not provide the GUI.
no
it's just an API
19:24
I thought that we could reduce the maintenance burden by using the GUI from an external source
I want the UI in a docked toolwindow, integrated in the IDE
and then you don't have to wory about redesigning the gui for submodules
and, if that external tool is written in .net, you can have it :)
one can hope
TBH I'd think submodules would be rather advanced usage. we need our stuff to not break with it, but I don't think we need to actively support it. you can git with VS completely without using the team explorer; you could git with the VBE without using RD's SC panel.
ok, then; supporting folders in export - import is all that we need
Is there a way to keep the project in sync with the file system?
Apart from the SC?
that probably needs to be a setting in the SC panel (probably disabled by default), to treat @Folder annotations as output folders
nope
that's literally SC's job
19:34
@Mat'sMug and, also, to go recursively through folders (except .git) when reading from file system
right. that's part of the @Folder integration
when does the sync between project and file system takes place?
through the SC panel's "refresh" command
@Mat'sMug It is causing lag when typing. I think we will have to organize triggering the DeclarationsChangeEvent a bit different.
The thing taking rather long is finding the selected declaration.
It should not take too long to get the selection from the code pane itself.
right. I see what you're thinking :)
19:40
We could pass this to the DeclarationFinder instead of the actual CodePane.
yep
principle of least knowledge at work
However, before I investigate more in that direction, I will have a look at what in the startup causes the crash on shutdown.
19:58
> For a number of reasons it might be useful to take advantage of the tree structure of the file system.
As the project already employs a tree structure by using `'@Folder("F1.F2.F3")` markings, half of the work is already done.

Implementation example:

- the module/class/form object stores:
- its path in the tree (say `F1.F2.F3.mymodule.bas`) and
- its path in the file system (say `C:\projects\prj1\F1\F2\F3\mymodule.bas`);
- whenever the user changes the name of the module or
We have the same problem with the FocusChanged event.
It just does not always occur because, in contrast to the selection change, one actually has to do something to change focus.
You get selection changed events when the VBE opens with opened code panes.
that should make the context label update... if it's ready at that point
could it explain some of the crash-at-startup some users have experienced?
The FocusChangedEvent does exactly the same as the SelectionChangedEvent; it just looks at the code exploerer and the project window as well.
It uses the same mechanism as the selection change to distribute the selected declaration.
The selection changed event fires as the very last thing in the startup of the VBE, I think. It seems to fire, when the VBE UI is visible.
20:08
makes sense
20:40
^ @RubberDuck @Hosch250 @ThunderFrame @M.Doerner @Vogel612 @BZngr @IvenBach @shadowofsilicon @contributors seeing this ^^ I haven't received the goods yet, and I still need more funds to ship overseas, but in the meantime you can fill up that form =)
@Mat'sMug Don't have a G account. Can I email you my address?
Or is there a way you could make it so I don't need to log in?
Oh heck, never mind.
I'll use my old U's account.
@Hosch250 it's easier if I have everything in one place...
G is stupid.
Outlook can detect if I'm using an Exchange Server account and sign me in. so I can do [email protected], and it just works
G doesn't work like that.
Looks sweet.
I might not be able to wear the L shirt, but you can send it anyway.
@Mat'sMug maybe hit up Donald Trump for being too tight with the dollars....
21:00
@Mat'sMug aaand filled out :)
woot!
apparently source control is much loved ...
SC is hard.
yup...
on that note: @shadowofsilicon IIRC you offered yourself as a tribute to be the primarily responsible maintainer, right?
How is that coming along?
I feel like a tribute... Tied to the stake with the village ready to make a sacrifice...
3
if I can help you with anything, feel free to shoot me a note. Apparently I'm the Code Review resident git wizard
Lol j/k... It's good... It's my first experience with C# so there's a lot of learning involved. It's hard enough to learn a new project, much less another language too.
@Vogel612 Well that's good... I'll remember that lol
unrelated... @Mat'sMug I think I might be straining GH projects a bit...
whenever I'm dragging cards across the board it kinda starts stuttering
21:17
@Vogel612 Thx for the offer
21:40
COM interop is hard, too.
I think Ninject does not play well with COM interop.
Just adding the menu items to the VBE on startup causes tons of marshalling errors on shutdown.
I think we will have to resort to poor mans's DI for the menus and maybe the command bar.
seems like it could be much worse, honestly..
IIUC all the menu items are bound in singleton scope anyways
@shadowofsilicon If there is something that I can do to help let me know - point me in the right direction
We also configure each manu separately in the binding setup.
22:00
> It uses a couple of third party DLLs tools and as it's still using the good old RichEdit control i basically can raise my own Bug farm with just this tool alone.
2
^ lol
22:14
Hi there!
@Kapol hi!
I am having trouble with unit tests for my inspection... I would really appreciate some help.
1. I don't know how to set up a class module, so that it's IsExposed property is true
2. If the code inside a module starts with Option Private Module, the moduledeclaration
the module's declaration IsPrivateModule is false
my unit tests are red, but the implementation is fine, I believe :)
@Kapol which inspection is it? I'm having similar impossible-to-test issues with my quickfix =)
You may need to tweak the mock VBE builder classes to support the feature
In the worst case, I will just skip the tests, I guess
@Mat'sMug I can try
but I have looked at the builder and I don't think that my issues can be easily fixed
the builder created mocks of IVBComponents, and I am not sure if it's possible to somehow influence the IsExposed property using members of that interface
as for the Option Private Module statement, if my reasoning is correct, the parser should set the IsPrivateModule property when in encounters the statement
why it doesn't work in my case, I don't know
@Mat'sMug Anyway, I'm almost done with shadowing declarations in referenced projects. There is a second part to this inspection - shadowing your own code. Is it OK if I create a pull request with what I have? I will add some explanation what is missing (including unit tests if I can't find a way to make them work)?
That way someone will be able to look at what I have now.
And later on I'll add more stuff to the PR and we will merge it at the end.
23:17
@Mat'sMug I had a peak at SimplyVBUnit. It looks like they create their own VBProject, and set it to be the startup project. They use a UserForm Load event, and add UnitTest class instances with a TLB-referenced, global procedure: AddTest. The UserForm also has a KeyDown event that cancels the tests upon Escape key.
@ThunderFrame I'm sure we can/will come up with a Rubberduckish zero-boilerplate way to do this =)
@Mat'sMug getting RD loading/parsing in VB6 would be the priority. tests can come later
23:33
Absolutely
First challenge being to get the menus & commandbars to show up =)
@Mat'sMug ... and disappear without combustion
Last I heard, they don't show at all in Max's build.
for now. #tempfix
The command bar is there, I just had to deativate all click events and not load the manus to get a clean exit.
This is very frustrating.
Adding even one manu, generates tons of marshalling errors on shutdown.
Adding a few, results in a non-zero exit state.
As long as you do not mind the crash on exit, everything works just fine.
8
23:51
@M.Doerner The crash feature is complete!!!
4

« first day (1157 days earlier)      last day (2023 days later) »