I would like to enhance the Indexing API with a cache for errors/warnings. This cache should be filled from indexers, and should show the errors/warnings automatically in the tasklist. Error badges in the projects tab should be also handled automatically by this cache.
Also requires a small enhancement in the csl.api.
Working patch is on:
Implementation may need improvements, but the API should be ready for review. The API changes are in:
Adding a new class:
and changing (adding subclass):
Please review. Thanks.
Well, that was fast! Excellent.
Y01 The Convertor pattern is slightly unusual. It deserves more documentation, for example that it will be called immediately while the method is running, not anytime later (am I right?).
Y02 Except better documentation, you might simplify life of ordinary users by providing other method that would take Iterator<Error>, and define case class Error(ErrorKind,int,String).
Y03 Error.BadgeError might be just Error.Badged or Error.Badgable or something to avoid double Error occurrence
Y04 I don't see change in dependencies of csl.api to request new version of parsing.api
As an addition to our morning discussion: Changing the friends of masterfs this way is OK.
Thanks for the comments.
Y01: I improved the javadoc with a claim that the convertor is used only inside the setErrors method invocation ("The methods on the convertor are not invoked after this method finishes."). The javadoc is still somewhat concise - if there is something particular that is missing there, I will be happy to enhance it.
Y02: I think that the ordinary users should use the convertor(s) and that the API should discourage creating wrapping objects for errors. I was able to rewrite the TLIndexer, so that it does not create wrapping objects for errors (untested, and it might be needed to use wrapping objects in TLIndexer eventually).
Y03: I renamed it to Error.Badging - but if someone has a better name, I will be happy to change it.
Y04: csl.api (currently) has an impl. dep. on parsing.api.
If there are no objections, I would like to integrate tomorrow.
Thanks for the review.
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jan Lahoda <firstname.lastname@example.org>
Log: #179459: introducing ErrorsCache that allows to easily implement error badging.
I know that it's a bit late - that's why I'm not reopening this bug - but couldn't we add a yellow icon for warning? Currently, warnings are just ignored.
What do you think, Honzo?