Extract stub library file from "Redundant async" inspection tests
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
package kotlinx.coroutines
|
||||||
|
|
||||||
|
interface Deferred<T> {
|
||||||
|
suspend fun await(): T
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CoroutineContext
|
||||||
|
|
||||||
|
object DefaultDispatcher : CoroutineContext
|
||||||
|
|
||||||
|
enum class CoroutineStart {
|
||||||
|
DEFAULT,
|
||||||
|
LAZY,
|
||||||
|
ATOMIC,
|
||||||
|
UNDISPATCHED
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Job
|
||||||
|
|
||||||
|
fun <T> async(
|
||||||
|
context: CoroutineContext = DefaultDispatcher,
|
||||||
|
start: CoroutineStart = CoroutineStart.DEFAULT,
|
||||||
|
parent: Job? = null,
|
||||||
|
f: suspend () -> T
|
||||||
|
): Deferred<T> {
|
||||||
|
TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> runBlocking(
|
||||||
|
context: CoroutineContext = DefaultDispatcher,
|
||||||
|
f: suspend () -> T
|
||||||
|
) {
|
||||||
|
TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun <T> withContext(
|
||||||
|
context: CoroutineContext,
|
||||||
|
start: CoroutineStart = CoroutineStart.DEFAULT,
|
||||||
|
f: suspend () -> T
|
||||||
|
) {
|
||||||
|
TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
<caret>async(ctx) { 42 }.await()
|
<caret>async(ctx) { 42 }.await()
|
||||||
}
|
}
|
||||||
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
withContext(ctx) { 42 }
|
withContext(ctx) { 42 }
|
||||||
}
|
}
|
||||||
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test() {
|
suspend fun test() {
|
||||||
<caret>async { 42 }.await()
|
<caret>async { 42 }.await()
|
||||||
}
|
}
|
||||||
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test() {
|
suspend fun test() {
|
||||||
withContext(DefaultDispatcher) { 42 }
|
withContext(DefaultDispatcher) { 42 }
|
||||||
}
|
}
|
||||||
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
<caret>async(parent = null) { 42 }.await()
|
<caret>async(parent = null) { 42 }.await()
|
||||||
}
|
}
|
||||||
-41
@@ -2,47 +2,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
<caret>async(ctx, CoroutineStart.LAZY) { 42 }.await()
|
<caret>async(ctx, CoroutineStart.LAZY) { 42 }.await()
|
||||||
}
|
}
|
||||||
-41
@@ -2,47 +2,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
withContext(ctx, CoroutineStart.LAZY) { 42 }
|
withContext(ctx, CoroutineStart.LAZY) { 42 }
|
||||||
}
|
}
|
||||||
-41
@@ -3,47 +3,6 @@
|
|||||||
|
|
||||||
package kotlinx.coroutines
|
package kotlinx.coroutines
|
||||||
|
|
||||||
interface Deferred<T> {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CoroutineContext
|
|
||||||
|
|
||||||
object DefaultDispatcher : CoroutineContext
|
|
||||||
|
|
||||||
enum class CoroutineStart {
|
|
||||||
DEFAULT,
|
|
||||||
LAZY,
|
|
||||||
ATOMIC,
|
|
||||||
UNDISPATCHED
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Job
|
|
||||||
|
|
||||||
fun <T> async(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
parent: Job? = null,
|
|
||||||
f: suspend () -> T
|
|
||||||
): Deferred<T> {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> runBlocking(
|
|
||||||
context: CoroutineContext = DefaultDispatcher,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> withContext(
|
|
||||||
context: CoroutineContext,
|
|
||||||
start: CoroutineStart = CoroutineStart.DEFAULT,
|
|
||||||
f: suspend () -> T
|
|
||||||
) {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun test(ctx: CoroutineContext) {
|
suspend fun test(ctx: CoroutineContext) {
|
||||||
<caret>async(start = CoroutineStart.LAZY) { 42 }.await()
|
<caret>async(start = CoroutineStart.LAZY) { 42 }.await()
|
||||||
}
|
}
|
||||||
@@ -114,6 +114,14 @@ abstract class AbstractLocalInspectionTest : KotlinLightCodeInsightFixtureTestCa
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
val parentFile = mainFile.parentFile
|
||||||
|
if (parentFile != null) {
|
||||||
|
for (file in parentFile.walkTopDown().maxDepth(1)) {
|
||||||
|
if (file.name.endsWith(".lib.kt")) {
|
||||||
|
extraFileNames += file.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
myFixture.configureByFiles(*(listOf(mainFile.name) + extraFileNames).toTypedArray()).first()
|
myFixture.configureByFiles(*(listOf(mainFile.name) + extraFileNames).toTypedArray()).first()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user