-
Notifications
You must be signed in to change notification settings - Fork 393
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
Provide a way to manually create SampleAnalysisEnvironment #3589
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/DelicateDokkaApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package org.jetbrains.dokka | ||
|
||
/** | ||
* Marks declarations in the Dokka that are **delicate** — | ||
* they have limited use-case and shall be used with care in general code. | ||
* Any use of a delicate declaration has to be carefully reviewed to make sure it is | ||
* properly used and does not create problems like memory and resource leaks. | ||
* Carefully read documentation of any declaration marked as `DelicateDokkaApi`. | ||
*/ | ||
@RequiresOptIn( | ||
level = RequiresOptIn.Level.WARNING, | ||
message = "This is a delicate API and its use requires care." + | ||
" Make sure you fully read and understand documentation of the declaration that is marked as a delicate API." | ||
) | ||
@Retention(AnnotationRetention.BINARY) | ||
public annotation class DelicateDokkaApi |
Oops, something went wrong.
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.
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.
minor question: do we still need this here?
As we now provide
create()
(even if it's delicate), for me it looks a little strange, thatcreator.use(block)
andcreator.create().use(block)
will behave differently, and most likely users of this API need to know aboutinternals
to work with it properly.WDYT about this?
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.
I believe we do, otherwise it can lead to the mentioned issues :) This is the controlled environment that addresses the issues that we're aware of, and more hacks and fixes might be added here in the future
yeah, the naming is unfortunate :( this is a lesson for the future - do not use names that can clash with the names from stdlib. otherwise, I'd say it's expected:
indeed, that is the whole point of
create()
being unsafe, delicate and NOT recommended, anduse()
being the safest and recommended optionuse()
and have encountered a bug/leak/etc? Report it, we'll have a look and try to resolve it (most likely by adding some hacks/workarounds touse()
)create()
and have encountered a bug/leak/etc? Well, we gave no guarantees and warned you, you better research and figure out how to mitigate it on your own. Or start usinguse()
, then it becomes our problemIf we remove
use()
, we'll have to add therunBlocking
detail (and any other) to the KDoc ofcreate()
, but I see several problems with this approach:So to me it makes sense to have
use()
, which takes care of all this for youWe can soft-rename
use
to something else to not clash withkotlin.io.use
, but let's do it as a separate issue/PR