-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create FUUID
macro annotation to auto-generate Id
types
#1
Create FUUID
macro annotation to auto-generate Id
types
#1
Conversation
This annotation can be used to automatically create an inner `Id` tagged `FUUID` type with convenient methods for its creation.
* }}} | ||
*/ | ||
@compileTimeOnly("enable macro paradise to expand macro annotations") | ||
class FUUID extends StaticAnnotation { |
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 conflict on import?
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.
Mmmm, with FUUID
, yep.
Maybe we can think of another name for the annotation... DeriveId
?
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.
Yeah, that seems reasonable.
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.
Updated to @DeriveId
ef5aabb
…ance This way a dependency with `doobie-core` will only be necessary if this parameter is set to true, which is expected.
Error's full output: `parameter value deriveMeta in class DeriveId is never used`
Any objections to getting a base out? |
Nope :) |
What has been done in this PR?
@FUUID
annotation that can be used on any kind of object to automatically create an innerId
taggedFUUID
type with convenient methods for its creation. It also provides implicit instances for cats'Show
,Hash
andOrder
.IntelliJ IDEA users
If you are trying to review this PR using IntelliJ IDEA IDE you will probable be thinking that the
FUUID
annotation is not working, since all references toId
appear red:No problem at all! This is caused by a known issue in IntelliJ IDEA Scala plugin. But it's easily solved with the help of a small plugin, and, guess what? This PR comes with its own support plugin. Just:
IntelliJ Preferences
->Plugins
->...
->Install plugin from disk ...
and select the downloadedjar
And all those nasty red lines will disappear:
References
Future work