Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve multi-preview annotations in other modules #69
Resolve multi-preview annotations in other modules #69
Changes from all commits
c70c817
07a3941
9c57e26
4dc1cdb
fa63263
16ae684
4cd623f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran locally and this outputted 5 previews, matching what I expected. Awesome job!
Might be good for us to add a test case in
snapshots-processor-test
for this, but inherently that's a bit tough as it currently relies on a single/input
directory producing outputs. Maybe adding aninput2
orsubmodule
containing a multipreview with an import/usage ininput
would produce a valid test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea testing this has proven to be difficult, I'll keep trying some things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only potential nit here would be to move this up above
.filter { it.annotations.count() > 0 }
, that way we're only working with annotation class declarations at that point, and don't risk runningannotation.count()
andgetClassDeclarationByName
on classes that are not annotation classes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that's possible since
it
is aKSDeclaration
for the sequence of symbols with annotations, we haven't mapped to the annotation class declarations yet.I think the filter is actually redundant since we are flatmap'ing to the annotation class declaration, so it should only be a sequence of annotation classes at this point, but it does make it a little more readable so I'll leave it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this get annotations that are transitively added to this annotation? Ex:
Will it pick up Class2 as having a preview annotation? If not can we do this in a loop building up what annotations are eligible to make a preview?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had discussed v1 of this only supporting a single level of Multipreview nesting (and checked with clients that that was ok), so that means we're only intending to cover your first example here.
But, if it's easy enough to add, we might as well add support for all potential cases here.