-
Notifications
You must be signed in to change notification settings - Fork 0
Add InternalAPIMarker annotation for internal API boundaries #230
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||
| package dev.slne.surf.surfapi.shared.api.annotation | ||||||||
|
|
||||||||
| /** | ||||||||
| * Marker annotation that designates an annotation class as an Internal API marker. | ||||||||
| * | ||||||||
| * Annotation classes annotated with [InternalAPIMarker] are recognized by the IntelliJ plugin | ||||||||
| * to identify internal API boundaries. Declarations annotated with such an annotation will be | ||||||||
| * treated as invisible to consumers in other projects — similar to Kotlin's | ||||||||
| * [DeprecationLevel.HIDDEN] behavior — rather than producing an opt-in warning or error. | ||||||||
| * | ||||||||
| * Example: | ||||||||
| * ```kotlin | ||||||||
| * @RequiresOptIn | ||||||||
| * @InternalAPIMarker | ||||||||
| * annotation class InternalSurfAPI | ||||||||
| * | ||||||||
| * @InternalSurfAPI | ||||||||
| * fun internalFunction() { ... } | ||||||||
| * ``` | ||||||||
| */ | ||||||||
| @Target(AnnotationTarget.ANNOTATION_CLASS) | ||||||||
|
||||||||
| @Target(AnnotationTarget.ANNOTATION_CLASS) | |
| @Target(AnnotationTarget.ANNOTATION_CLASS) | |
| @Retention(AnnotationRetention.BINARY) |
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.
The KDoc example uses
InternalSurfAPI, but the existing internal opt-in annotation in this repo is namedInternalSurfApi. Using a different name in the example is confusing for consumers—either align the example with the actualInternalSurfApiname or make it a clearly generic placeholder name (e.g.,InternalApi).