MC
Metalama CommunityXaniff
Warn on ineligibility instead of throwing
I've got two conditions in my BuildEligibility for a method override aspect: If the target type is a record the method must be explcitly declared on the type, and the type's name must end with "Store".
Unfortunately, when looking at the build logs, this means I've got several dozen errors as it's throwing an exception for any conditions that fails eligibility. I'd rather it not throw an error, but rather simply notate that it's skipped the application with a warning.
Is this possible? Can I still get the benefits of build eligibility without it breaking the build due to all the errors thrown? Thanks!
Xaniff•267d ago
So far I've just shifted all the logic out to the Fabric, but I'd like to keep it in the aspects themselves as they're the "foremost expert" authorities of what they should be applied to or not
Petr Onderka•264d ago
You can keep the logic in the aspect, if you move it to
BuildAspect
and produce a diagnostic warning instead of failing eligibility.Xaniff•264d ago
Thank you!
Want results from more Discord servers?
More PostsReferencing value assigned to variable in statement builder within another statementGiven a statement that does something like:
```cs
var expr = new ExpressionBuilder();
expr.AppendVerSpecifying generic constraints of compile-time introduced typeI have a TypeAspect that has three attribute arguments when applied to a type. One of these is a `TyStep-through aspect-debuggingI'm sure I've asked this before, but I cannot find the thread in which it was answered (if I actuallCodeLens HelpMetalama is configured in CodeLens, and I have an aspect that has been applied. I am able to right-How to apply an attribute to a method introduced by another aspect?I have an aspect that has a dependency on another aspect. However, I'd like for downstream projects Advising the addition of code commentsUsing Metalama
Is there a way to advise adding code comments? For example, when I advise a method Set eligibility to not run against (built-in) methods of record classes or structsI've figured out how to set up an `If` statement for the record types, but I cannot figure out how tHow to specify an IMethod as the callback for an event?I'd like to specify an introduced method on a TypeAspect as the callback for an event handler.
1) W