@mansellan @MathieuGuindon first, to be clear - for a debug build, the COM registration is always HKCU. The VBE registration are done with this script. I see that I forgot to update that.
OTOH, the installer (and the registration repair via start menu) uses this script.
So... Interesting. I can't turn AC off. And there are so many bugs I can't code normally :-D Here's the log when I open settings, uncheck everything, press OK, open settings (AC are all enabled)
2018-06-06 11:20:41.9390;TRACE-2.2.6730.26134;Rubberduck.Common.Hotkeys.Hotkey;Hotkey for the associated command Rubberduck.UI.Command.Refactorings.CodePaneRefactorRenameCommand was registered with id 49266;
2018-06-06 11:20:41.9390;TRACE-2.2.6730.26134;Rubberduck.Common.Hotkeys.Hotkey;Hotkey for the associated command Rubberduck.UI.Command.Refactorings.RefactorEncapsulateFieldCommand was registered with id 49579;
2018-06-06 11:20:41.9390;TRACE-2.2.6730.26134;Rubberduck.Common.Hotkeys.Hotkey;Hotkey for the associated command Rubberduck.UI.Command.Refactorings.RefactorExtractMethodCommand wa…
Additional info: The config file is set like this:
cool. I sync with next and reupdated my packages and build in admin. Switched over to non-admin and ran Excel and could see the indent parts works nicely. Good stuff.
@SonGokussj4 yeah I noticed the service was loading the defaults at startup.. and never updating them. That's also why FreeMan's 2-space indent setting is ignored.
Presumably the settingschanged event simply isn't firing
Also to be fair only the inline completion have a real problem.. went to bed without finding a solution last night
> This issue is probably related to #4056, #3468 and #3469.
**Rubberduck version 2.2.6731.26856**
**Expected behaviour:** Rubberduck renames a field in a class AND updates Code Explorer tree AND updates references ie. on right-click "Open" Rubberduck takes you to the definition of said field.
**Actual behaviour:** Rubberdack renames a field in a class but does not update Code Explorer tree and does not update references.
`[TestNamedRange].ClearContents` square bracket notation in a class module is probably a bad idea though: an explicitly qualified `Range` member call would be less bug-prone.
Square-bracketed expressions are evaluated not by VBA, but by the host application (EXCEL.EXE) at run-time, so you don't get intellisense for further member calls, and VBA
`[TestNamedRange].ClearContents` square bracket notation in a class module is probably a bad idea though: an explicitly qualified `Range` member call would be less bug-prone, since there's no way to tell what worksheet the expression will be evaluated against.
2018-06-05 17:55:52.0490;ERROR-2.2.6730.21818;Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase;System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Rubberduck.Parsing.ComReflection.ReferencedDeclarationsCollector.LoadDeclarationsFromLibrary() dans C:\projects\rubberduck\Rubberduck.Parsing\ComReflection\ReferencedDeclarationsCollector.cs:ligne 143
à Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase.LoadReferenceFromTypeLibrary(IReference localReference, ReferencedDeclarationsCollector comReflector) dans C:\projects\rubberduck\Rubberduc…
you know, you got me wondering whether putting & vbNewLine & _ is the sensible default
it kinda makes complete sense most of the time
perhaps the AC could look 2 chars ahead, and do " & _[NEWLINE] on ENTER when the next char is just ", and do " & vbNewLine & _[NEWLINE] when the next char is " preceded by a space
so you get straight-up concat with no mangling whatsoever without a space, and if you put the trailing space in then you tell RD that you're writing a "verbatim multiline string"
the trailing space is required anyway, when writing SQL. common source of invalid SQL syntax too, that missing trailing space...
you hit ENTER and RD doesn't give you the & vbNewLine & _, you know you have a syntax error in the making
> A major problem with unit tests is to make sure that they are robust in the face of a changing system. One of the most common problems programmers have with unit tests is the so-called Fragile Test smell. Every time you attempt to refactor your code, tests break.
For a challenge, a fellow code golfer wrote the following code:
import java.util.*;
public class Main {
public static void main(String[] args) {
int size = 3;
String[] array = new String[size];
Arrays.fill(array, "");
for(int i = 0; i <= 100; ) {
array[i++%size] += i + " ...
> **REPRODUCTION:** 1. In a UserForm there is a Frame 2. In that Frame there is a TextBox 3. Right-Click the TextBox and select "RubberDuck > Rename"
You will see a dialog to rename the Frame and not the TextBox.
**HYPOTHESIS:** When selecting control items the parent frame appears to be selected in the GUI at all times. It is not possible to select a control child of a frame without the parent frame also being selected.
**SOLUTION BASED ON THAT HYPOTHESIS:** If SelectedItems.Co
> Want to present this for discussion. I've observed that unit tests are quite brittle, especially when refactoring involves changing the constructor parameters and we have lot of objects that has non-trivial constructor injections.
Currently, the tests will directly `new` up any objects it needs to fulfill the dependencies to execute. It does not use any IoC at the moment, and depending on who you listen to, some may regard using IoC in a UT as a code smell.
> Using the same IoC configuration as the "production code" would be dead wrong indeed, if that's what "IoC in UT is a code smell" stands for. Otherwise I don't see what the problem is with having a "test IoC configuration" that wires up the mocks automatically. It could actually be rather beneficial.
The challenge would probably be to make sure we only construct the minimal dependency tree for the system under test, without needing an IoC config module per test class.
> I like the "pop a dialog and prompt to confirm" option, but only if it's not possible to determine the specific deepest non-parent control that's selected. I do think we should be able to recursively locate the actual selected control though.
> I installed build 3347 this afternoon and I'm getting a consistent crash in Access 2016 (desktop) running on Win10. I was running build 3342 all day yesterday and having no issues whatsoever. I've gone back and forth between the two several times and it's consistently crashing in 3347 right at the end of the initial parse.
2018-06-05 17:55:52.0490;ERROR-2.2.6730.21818;Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase;System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Rubberduck.Parsing.ComReflection.ReferencedDeclarationsCollector.LoadDeclarationsFromLibrary() dans C:\projects\rubberduck\Rubberduck.Parsing\ComReflection\ReferencedDeclarationsCollector.cs:ligne 143
à Rubberduck.Parsing.VBA.COMReferenceSynchronizerBase.LoadReferenceFromTypeLibrary(IReference localReference, ReferencedDeclarationsCollector comReflector) dans C:\projects\rubberduck\Rubberduc…
I skimmed through the posts since I left yesterday - that one didn't jump out at me.
Yes, MRE = Meal, ready to eat. They don't call 'em that anymore. My boy's in the Army now, and he's brought some home, but I don't recall what he calls them.
Seems to prefer the ones with M&Ms in the package...
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=h1) Report > Merging [#3934](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f530a9a773ff1da95882fada9ffea150f1e1a3eb?src=pr&el=desc) will **decrease** coverage by `0.16%`. > The diff coverage is `36.96%`.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=h1) Report > Merging [#3934](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f530a9a773ff1da95882fada9ffea150f1e1a3eb?src=pr&el=desc) will **decrease** coverage by `0.16%`. > The diff coverage is `36.96%`.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=h1) Report > Merging [#3934](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f530a9a773ff1da95882fada9ffea150f1e1a3eb?src=pr&el=desc) will **decrease** coverage by `0.16%`. > The diff coverage is `36.96%`.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=h1) Report > Merging [#3934](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f530a9a773ff1da95882fada9ffea150f1e1a3eb?src=pr&el=desc) will **decrease** coverage by `0.15%`. > The diff coverage is `38.64%`.
TBH I'm not terribly thrilled with constant "ClassID" embedded all over the places. They feel like a booby traps ready to spring on the next unsuspecting fool. (mind you, the fool we speak of is of course, this).
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=h1) Report > Merging [#3934](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/3934?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/f530a9a773ff1da95882fada9ffea150f1e1a3eb?src=pr&el=desc) will **decrease** coverage by `0.15%`. > The diff coverage is `38.64%`.
if you wanted to do something like seeing what it's displaying, I guess you should be doing stuff like Debug.Print pt.DataLabel.Text or something like that.
pt.DataLabel is basically assuming that the DataLabel is either a primitive non-object/non-array value or is an object that has a default member (which isn't always the case).
Argh!!!! the "DataLabel" is the text at the end of the bar that says what the value of the bar is (25, 37, 153054992, whatever). It's NOT the value that's being measured...
> No repro with Access 2010 running from source (next):
2018-06-06 21:31:05.0539;TRACE-2.2.6731.38670;Rubberduck.Common.LogLevelHelper; Rubberduck version 2.2.6731.38670 loading: Operating System: Microsoft Windows NT 6.2.9200.0 x64 Host Product: Microsoft Office 2010 x86 Host Version: 14.0.7195.5000 Host Executable: MSACCESS.EXE;
For 'Static' VBA Classes, those that have VB_PredeclaredID = True. When is the class initialized? I want to use it for my codereview.stackexchange.com/questions/191441/… and want to make sure they'll have their dictionaries populated when I need them.
but don't quote me on that. tEst this by siccing a Debug.Print in the Class_Initialize event
If you see debug printed when you use it for first time in the session, then that's the answer. But if the first use doesn't print anything, then you know it got initialized long before you reached it.
Currently, I have my converters each as their own class. They started out in standardModules but I swapped them to a class as I thought that was best. Have I misunderstood static?
no, sorry, I'm not clear. What I mean is that the differences b/t standard/class are artificial. It would have been easier if VBA pretended everything was a class, that's all.
@IvenBach I would prefer to use standard module if possible.
Because that way, there's no accidental instancing and the syntax still works, too... MyModule.MyMethod()
But if you must subscribe events or raise events or something like that, then you can use a class module with predeclaredId, but then you have to be attentive in that your code don't try to instantiate such class (which is still legal)
@MathieuGuindon yet the noobs are all "huh what's class? it scares me!". Had it been classes everywhere, I think it'd been easier for them to use events and everything.
but no, they think they have to pass around strings and invoke methods on the application to get the objects which they already had in their calling method.... :\
> sorry found it … by accident when I typed a ‘(‘ it auto closed it with ‘)’. Nice!
As a suggestion on the RD toobar, how about having a global turn ON/OFF button for Autocomplete?. I found that it was not easy to delete one of the ‘(‘ without it not deleting and forcing the ‘)’ again. So I left the ‘()’ and cut and pasted the code in between that. That may be a good thing long term tho.
Regards,
Luke
From: Luke A Burlet <Luke.Burlet@HSConsultants.net.au> Sent: Wednesday,
@MathieuGuindon It is. I happened to grab it where the With New ... was using it here it's expecting an error and I don't care about the return string since Err.Raise gets invoked.
@MathieuGuindon It took me far too long to realize that the MR produces some janky-nasty code...
I knew it wasn't good, but never knew how bad it was.
> @LukeHSC I like the idea of a toggle on the toolbar (although, that toolbar is getting rather wide by now), however do note that backspacing/deleting is currently broken and only effectively works when the left-most character is removed - I'm giving up on trying to devise a fix using the current VBE messenging hook; I'll swap the hooking for an actual keyhook tonight, that way I can know what key was pressed, and reliably fire when a key is actually pressed, instead of filtering caret messag
> sorry found it … by accident when I typed a ‘(‘ it auto closed it with ‘)’. Nice!
As a suggestion on the RD toobar, how about having a global turn ON/OFF button for Autocomplete?. I found that it was not easy to delete one of the ‘(‘ without it not deleting and forcing the ‘)’ again. So I left the ‘()’ and cut and pasted the code in between that. That may be a good thing long term tho.
> PS: would be nice to have a ‘matching bracket ’ finder (and IF/END etc finder) !
From: Luke A Burlet <Luke.Burlet@HSConsultants.net.au> Sent: Thursday, 7 June 2018 6:58 AM To: 'rubberduck-vba/Rubberduck' <reply@reply.github.com> Subject: RE: [rubberduck-vba/Rubberduck] Bracket matcher/finder and auto-completion (#4033)
sorry found it … by accident when I typed a ‘(‘ it auto closed it with ‘)’. Nice!
As a suggestion on the RD toobar, how about having a global turn ON/OFF button fo
BTW2 – love the toolbar when I am on a function and tells me where in the overall VBA it is being used .
And … sorry a bit of a hate … the Code Explorer on my projects takes about 1.5 to 4 mins to refresh, have to do everytime I open the project as I noted before. I wouldn’t think my dinky code is that complex (?) . I have about 12 forms (each form may have between 5 to 10 cmd’s) , about 24 modules and a maybe a couple classes. I
BTW2 – love the toolbar when I am on a function and tells me where in the overall VBA it is being used .
And … sorry a bit of a hate … the Code Explorer on my projects takes about 1.5 to 4 mins to refresh, have to do everytime I open the project as I noted before. I wouldn’t think my dinky code is that complex (?) . I have about 12 forms (each form may have between 5 to 10 cmd’s) , about 24 modules and a maybe a couple classes. I do
> Personally, I think the problem with the tests is not that there is no IoC; the problem rather is that there are too many tests not fully using the centrally provided mocks. For all the refactorings I did to the parsing process, I basically only had to adapt these central mocks. I only had to change families of tests that did not already have a proper method for their purpose in the centralized mocks.
> Would be nice indeed, but we won't have that in the VBE's native code panes, for several reasons:
- Selection can only be in one single contiguous place - Using the selection to highlight brackets would interfere with typing in a highly disruptive way - Matching token would have to be visible on-screen, which isn't always the case esp. for blocks - Changing font/weight of matching token in the code pane requires Win32/COM wizardry beyond my paygrade - Matching would need "inline pa
> @LukeHSC note, we've just identified a bug that may cause the resolver to basically fail to resolve everything defined in a referenced library - if that's the case then MANY exceptions would be thrown (and logged), and this could very well make the whole parsing/resolving much slower than normal (and inspections might be raising a bunch of false positives too, so firing many more results than they normally would -> more peformance & memory pressure)... does pre-release 2.2.3310 perform better
I had created a validation loop while attempting to do textbox validation. The textbox was infinitely validated. It was so valid that the application crashed.
> Yeah there's a known issue about the "about" box showing the version# from the wrong assembly, following the split of `Rubberduck.Main` and `Rubberduck.Core`; the correct/intended version is only shown on the splash form at startup.
If you're referencing libraries that you're not using, removing them could help with performance a bit. Otherwise, watching logs for exceptions can indicate problems. Note that only the initial parse should take a while, subsequent parses only process what needs
Been working coding this AM with the autocomplete on, for most part seems ok, few glitches , i.e. re-autocompleting brackets if I go to edit them or backspace over them.
Biggest issue just now, I went to copy and paste a variable after a ‘[‘ bracket and RD made this:
I sent to turn off the autocomplete for RD but it does not want to turn off? I sent to Settings, unticked the ‘Close Square Brackets’ pressed Ok. But still autocompletes square brackets. I
Been working coding this AM with the autocomplete on, for most part seems ok, few glitches , i.e. re-autocompleting brackets if I go to edit them or backspace over them.
Biggest issue just now, I went to copy and paste a variable after a ‘[‘ bracket and RD made this:
I sent to turn off the autocomplete for RD but it does not want to turn off? I sent to Settings, unticked the ‘Close Square Brackets’ pressed Ok. But still autocompletes square brackets. I went back to settings