Add support of explicit API mode to 'Make public' intention

#KT-41902 Fixed

Do not check languageVersionSettings for fake elements
because this leads to an exception
This commit is contained in:
Leonid Startsev
2021-04-29 19:59:03 +03:00
committed by Space
parent d34c23914a
commit 19dece01f6
10 changed files with 92 additions and 23 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ChangeVisibilityModifierIntention$Public
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Make public
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class C <caret>private constructor(public val /* check no reformat here */ v: Int)
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Make public
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class C(public val /* check no reformat here */ v: Int)
@@ -0,0 +1,6 @@
// INTENTION_TEXT: Remove 'private' modifier
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class Test {
public var foo: String = ""
<caret>private set
}
@@ -0,0 +1,6 @@
// INTENTION_TEXT: Remove 'private' modifier
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class Test {
public var foo: String = ""
set
}
@@ -0,0 +1,4 @@
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class C {
<caret>private fun foo(){}
}
@@ -0,0 +1,4 @@
// COMPILER_ARGUMENTS: -Xexplicit-api=strict
public class C {
public fun foo(){}
}