but I seem to remember that when working in refactoring, the core (not main, sorry, bad memory) always rebuilds even though nothing changed in the core.
@Vogel612 could it be just Antlr rebuilding the grammar everytime, thus regenerating the lexer, parser, base listener, and all the generated code - prompting a rebuild of RD.Parsing?
Still hooked on Windows, I refactored the hook into a number of interfaces, and I wanted to support 2-step hotkeys, so I started with defining an IHook that can be attached, detached, exposes a property that tells whether a hook is attached or not, and raises an event when the hook receives a mes...
@IvenBach #FunFact that is exactly why the hotkey settings grid has a "Key1" heading; there's a hidden (or commented-out, I don't recall) "Key2" column that means to accept the 2nd key of a hotkey chord.
@Vogel612 The AttributeAnnotationProvider is meant to provide tha data needed to construct a suitable annotation based on the attribute and attribute value.
The second parameter in the test actually has the wrong name.
It has to provide the information required to insert code into the code pane that results in an attribute annotation corresponding to the attribute provided.
but Provider is not really a good name, considering it returns additional information (namely the number of annotation arguments to help annotation rewriting)
@M.Doerner so far nothing there says to me that it needs to instantiate the Annotation Type?
soo ... AttributeAnnotations don't expose enough information from what I can tell...
that's why there is this weird clunky provider workaround there that for some reason interferes with the responsibilities of the annotations themselves
which means.... I gotta do some refactoring, I guess...
because as it stands Annotations only expose the AttributeValues
So far, there was only a trivial backtransform. So I stopped at that points. The transformations of the annotation systems were already giving me enough headaches.
The question is how to put the information on the annotation
there's special enum values for where an annotation is allowed and the AttributeAnnotations have a C# Attribute tacked on dealing with the attribute transformations
I think I want to get to automatically discovering annotation types through CW and enriching them with information instead of correlating the types we rely on anyways with an enum value
of course doing something like that implies moving the magic in the annotation system from the AnnotationType enum into the class hierarchy, but it should work
most of that information should be statically available, though...
and that makes it a bit harder to enforce in the class hierarchy...
Sub test()
Dim foo As Variant
ReDim foo(1 To 10) As Long
Debug.Print TypeName(foo)
Stop
ReDim foo(1 To 20) As String
Debug.Print TypeName(foo)
Stop
End Sub
Regarding ReDim, it is only a declaration if there is no other declaration for it. So, all we have to do to fix everything around it is to validate whether we are in a ReDim context when we find an undeclared variable and create a different declaration in that case.
pondCheck: Should unit tests contain the name of the unit they're testing? Current book suggests so but that doesn't seem right as it hinders renaming.
Public Sub x()
ReDim foo(0 To 1) As String
foo(0) = "hello"
foo(1) = "world"
Debug.Print foo(0), foo(1)
End Sub
after running the procedure, ?typename(foo) returns String()
so I am not too convinced that the doc commenting that it only considers module variable is correct.
Re-reading the doc, I now see that "module level variables" could include the Public foo -- in actuality the doc should have had said "public module-level variables"
then the following sentence makes sense
If I modify the first module to following:
Private foo
Public Sub test()
Debug.Print TypeName(foo)
End Sub
then the Redim no longer affects the foo, as expected.
@M.Doerner Module name is 'TestPurlinViabilityChecker'. The test method name is 'MinimizesPunchPattern_PanelsWide8_PanelsLong15_StringSize20_MinCant2Point5_MaxCant3Point5_PanelsBetweenColumns10_ReturnsTrue' which invokes the MinimizesPunchPattern on the System Under Test (SUT). I'm wondering if there's a more succinct way to name the test method.
I may just need to take a few deep breaths and accept the long names.
Reading the code, it makes sense but from the name alone, it does give an impression that it's testing too many things.
In actuality, all we are doing is asserting that a failed selection doesn't alter the state. Thus ThrowsExecptionOnTrySetActiveSelection_DoesNotChangeTheActiveCodePane_ReturnsFalse would have been enough, IMO.
@this in many US states there is a Common Law Marriage which basically means that if you've lived together long enough you're considered married for things like wills. That could be considered being "passively married".
Just looking at the factual side of things. While I'm a native English speaker and my mother was an English major, things like "passive voice" aren't over my head, I just don't care enough to be bothered. I can speek it guud enough, so there you is
Is there nothing in a VBA .cls file that indicates what the name of the class is/should be?
I'm adding a new implementation so the easiest thing is copy/pasta the .cls file and load that - I pulled it up in N++ looking for an internal name to change and didn't fine one.
In the end a reddit user helped me figure it out, Their post was the thing that got everything rolling. What i needed to do was set the state of every datarow in my datatable to "Added" using the SetAdded method. Then i needed to set $DestCb.QuotePrefix = "[" and $DestCb.QuoteSuffix = "]" Then it...
interesting... I did a C&R in Access - RD started parsing as soon as it reopened the file. I ignored the spinning ducks and closed the DB - the duckies kept right on spinning... Kept spinning after opening the DB again...
I think I've got a clean parse, but I'm not sure...
Well... I right-clicked the CE and selected Add... | Existing File and had it import my class w/o the class header lines and. (drum roll, please)
2019-08-22 15:16:46.7255;ERROR-2.4.1.4848;Rubberduck.Parsing.VBA.DeclarationResolving.DeclarationResolveRunnerBase;Exception thrown acquiring declarations for 'Quarterly Report.ApptPlusPatientWebDownloader' (thread 78).;System.InvalidCastException: Unable to cast object of type 'Rubberduck.Parsing.Symbols.ProceduralModuleDeclaration' to type 'Rubberduck.Parsing.Symbols.ClassModuleDeclaration'.
at Rubberduck.Parsing.VBA.DeclarationResolving.DeclarationSymbolsListener.EnterImplementsStmt(ImplementsStmtContext context) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\DeclarationResolving\De…
closed w/o saving. Added Version 1.0 Class header lines to .cls file. Opened the DB, imported via CE, hmmmm.....
The first time I tried that, Existing File was the only option enabled under Add. Now they're all available.
I wonder if the CE wasn't in a good state when I tried it the first time. (despite the manual parse)
not shocking... with the Class header lines, it shows up instantly in the PE under Class Modules and, once the parse is complete it shows up in the CE as expected.
Guess I'll need to tweak my export routine. However, for git usage, it seems to work just fine - when I import them, it seems to understand that they're classes even w/o the header.
(at least according to my faulty memory - will have to investigate further, but not today)
I've been doing about 99% exporting lately as I've been adding some new functionality, but I did test importing, and I'm pretty darn sure it worked since my code didn't implode most gracelessly... but, I'll do some additional testing to see what's what.