« first day (2092 days earlier)      last day (1088 days later) » 
00:00 - 20:0020:00 - 00:00

8:11 PM
depends...
I don't think it would be bad, but it could splice responsibilities for validation of annotations a bit
as of now we have some validation built into an Inspection (not sure what it's named rn)
 
@M.Doerner I might be missing something but is this going to be verified at compile time?
 
@this if you add it as a member to the IAnnotation class, it would need to be provided by all annotations
a sensible default would probably be 0
 
8:26 PM
I think I agree with this
 
Currently, the MissingAnnotationArgumentInspection just looks for the hard-coded list containing exactly Folder and Ignore.
 
Yeah that won't scale well
 
We have the following fixme
// FIXME don't maintain a separate list for annotations that require arguments, instead use AnnotationAttribute to store that information
It is a bit stale though, since the attribute does not exist anymore.
 
I'd probably just call it RequiredArgs though
with xmldocs saying " the number of arguments that must be provided for this annotation"
 
The minimal number
 
8:29 PM
^
doesn't IllegalAnnotationInspection check for the presence of required arguments?
or does that only deal with multi-annotation of exclusive annotations?
 
It only looks at stuff like unbound annotations, attribute annotations in documents and attribute annotations on targets that cannot have attributes.
 
Yeah. "must" covers it, but "minimal" clarifies it =)
 
@MathieuGuindon must is actually stricter, because it defines an exact number
 
right
#wordz =)
 
Annotations like Ignore can take arbitrarily many arguments.
 
8:36 PM
same goes for TestCategory IIRC
 
8:53 PM
Hm, how is the Obsolete annotation supposed to work?
It has a fixme // FIXME correctly handle the fact that the replacement documentation is only the first parameter! and a member ReplacementDocumentation, which is not used.
Should the potential first argument be loaded into that member?
Or is the state relating to arguments the problem?
 
9:08 PM
Hm, should we expose the annotations per module on the declaration finder instead of on the parser state?
 
annotations are just a special kind of declarations, no?
 
Probably, yeah
 
@this They are not declarations.
 
@M.Doerner not sure what to make of that comment, but basically the (only?) arg is optional
 
I have just wired it up to assign to the property when processing arguments.
 
9:10 PM
No but they're basically metadata pertaining to declarations
 
Then they can't belong to the declaration finder? Feels a bit weird to be finding annotations using a declaration finder.
 
less weird than having them on the parser state though
 
I can see finding declarations having a certain annotation, though.
@MathieuGuindon There's that, too.
 
The declaration finder already provides them by line of code, but not for the whole module.
 
9:34 PM
TBH the finder is turning into more and more of a querying service.
 
It always has been.
It represents a snapshot of the system.
There are a few bits on it that should be extracted, though.
Like the temporary storage for undeclared variables used in the resolver.
I think there are also a few computationally complex methods that are obsolete once the resolver has run.
Come on, why can't I use the null from a nullable value type as dictionary key?
It is well-defined after all.
 
My point was that it probably should be represented as a querying service rather than just a "declaration finder" that happens to also find annotations or other things.
 
10:23 PM
@M.Doerner IIRC that one's from me and I think the annotationArgs are not correctly concatenated together for the ReplacementDocumentation filling
but I'm not sure
especially for cases like:
'@Obsolete Use "Foo" instead
Sub Bar()
End Sub
 
hmm should have had required ()
 
Ah, this is where the syntax flexibility is biting us in the rear end
 
but I assume this is too late. An option would be to decorate such annotation parameter as basically "concatenate everything else you find on the rest of the line."
kind like param, I guess, but more stringified.
 
(hey, I've been absent but I'm still alive!)
Speaking of annotations, I'd like to suggest that the procedure do Apply the @PredeclaredId and @Exposed ones (https://stackoverflow.com/questions/58600560/how-to-set-the-attribute-vb-predeclaredid-using-rubberduck-predeclaredid) to be included into their wiki entry (https://github.com/rubberduck-vba/Rubberduck/wiki/VB_Attribute-Annotations)
I've tried to use them before, without success, and thought they were inactive due to some bug. Only today it crossed my mind to google it more thoroughly and came across that Stack Overflow thread
 
10:39 PM
@CarlosGustavoReetz right - the wiki is kind of glossing over the quickfix part
 
I would have expected a syntax like '@Obsolete "Use ""Foo"" instead".
 
@CarlosGustavoReetz feel free to edit the wiki, all contributions are welcome!
 
I guess we should follow through with the annotation xml-doc idea at some point.
 
@MathieuGuindon nice! I was unsure whether I was able to, i've never contributed to a public wiki before
I'll come up with a draft then!
 
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5404?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request head (`RefactorParseTreeInspections@d21dacf`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-head-commit).
> The diff coverage is `n/a`.
 
10:43 PM
@Duga Sorry for the giant diff, again.
 
As long as no one starts vandalizing it, it's open for contributions - OSS contributions don't have to be code! =)
 
@M.Doerner I know I asked a similar question before but if we are passing in the declaration finder into the DoGetInspectionResults, will that influence what results get returned due since the members of the declaration don't change for a given instance (right?)?
 
Ugh, why are games this big nowadays?
 
still related to those two annotations (PredeclaredId and Exposed) you refer to their appliance as a quickfix. Were they intended to behave in the same way as the @Folder ones do? (meanong, they take effect simply by pressing the Sync button)
 
Yes they should do now
Max enabled that capability few versions ago.
 
10:48 PM
The only difference in that regard is that currently a very tiny chance exists that the state to validate whether results are ignored differs from the state to generate the results.
 
if there's no technical impediment for them to behave the same way, I'd also suggest that their syntax was something like '@PredeclaredId("True") / '@PredeclaredId("False") and they could appear by default (the same way @Folder() does)
 
In my mind, getting a consistent result is important, and that should be determined at the time of the parse button being clicked (or triggered) but not in the middle of parse.
@CarlosGustavoReetz I think you can do that. But note that you will get inspections for redundant attributes
 
@CarlosGustavoReetz The attribute annotations work as follows. The annotation itself is just a marker specifying the expected attribute and they do not directly influence the attribute itself. This marker is picked up by the attribute annotation inspections, which report mismatches between the attributes and annotations. The quickfixes allow to sync the annotations and attributes, in both ways.
 
so if you had @PredeclaredId(false), it would be flagged as redundant because default is false anyway, but @PredeclaredId(true) would be OK and a bit more explicit than just @PredeclaredId (also legal).
 
Actually, we simply ignore superfluous annotation arguments.
@Predeclared(True), @Predeclared(False) and @Predeclared should all do the same thing.
 
10:54 PM
even for @Predeclared(false)? Kind of confusing.
 
The argument is fixed.
Do we need a SuperfluousAnnotationArgumentsInspection?
 
does it at least throw an inspection about invalid or ignored argument usage?
 
No
 
I would say yes. Otherwise, people might make the mistake of writing @PredeclaredId(False) which would be a lie.
 
@this @M.Doerner, what I had in mind would probably require a lot of refactoring to implement (and probably run into technical difficulties) but it's as follows:

instead of handling these annotations via the Code Inspections, handle it "in the same way" (actually, I don't know how this is currently implemented, I know only the behavior I see from the user perspective) the @Folder is.

Uppon creation a new Class Module would have @Folder annotation (as currently happens), @PredeclaredId(False) (or true if created via the special template Rubberducj offers) and @Exposed(False)
 
11:04 PM
@BloggingDuck @this should figure 3-7 change If Len(This.FirstName) = 0 Then to If Len(This.FirstName) <> 0 Then?
 
[rubberduck-vba/Rubberduck] build for commit d21dacf2 on unknown branch: AppVeyor build succeeded
 
:derp: nope. #ReadingFail.
 
@CarlosGustavoReetz this would imply automatically synchronizing the annotation value to the underlying attribute, which is not always what you'd want to happen
for example if the attribute is correct and the annotation wasn't updated to reflect that.
 
Moreover, the folder change happens as part of us parsing. If we synchronize there, we have to do another parse immediately.
 
Oh, I haven't considered that
 
11:09 PM
Does IgnoreTest have arguments?
 
what I described would (I guess) approximate the behaviour expected from the native VBE editor IF it actually didn't hide all VB_Attributes
 
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5404?src=pr&el=h1) Report
> Merging [#5404](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5404?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/9734c7ff3a1dfd33341a1e877a5e69d52cbd858f?src=pr&el=desc) will **increase** coverage by `0.3%`.
> The diff coverage is `86.93%`.


```diff
@@ Coverage Diff @@
## next #5404 +/- ##
==========================
[rubberduck-vba/Rubberduck] build for commit d21dacf2 on unknown branch: 86.93% of diff hit (target 60%)
 
Which annotations actually allow arguments?
I get the impression that there are very few.
@ticker Nowadays, people seem to have shifted from scraping the web with VBA to generating PDFs.
 
@M.Doerner yea, it's not many
@M.Doerner I think it used to allow for an explanation, but we never really surfaced that?
 
To implement the new inspection, I have just added an AllowdArguments property to IAnnotation, which defaults to 0.
I have set it to 1 for ignore test.
 
11:57 PM
@M.Doerner


No Argument
'@PredeclaredId
'@Exposed
'@DefaultMember
'@Enumerator


With Argument
'@ModuleDescription("Description of the module's purpose")
'@VariableDescription("It's a thing")
'@Description("Does something")
'@ExcelHotkey("D")

'@Folder("VBAProject") <- I just noticed this one is't listed at the Wiki among the others
 
We also have the generic @ModuleAttribute(AttributeName, AttributeValue1, AttributeValue2,...)and the @MemberAttributeversion of it.
 
00:00 - 20:0020:00 - 00:00

« first day (2092 days earlier)      last day (1088 days later) »