Introduce Type Alias: Do not suggest type qualifiers
#KT-14693 Fixed
This commit is contained in:
@@ -3,6 +3,13 @@
|
|||||||
<!-- Find: ([^\`/\[])(KT-\d+) -->
|
<!-- Find: ([^\`/\[])(KT-\d+) -->
|
||||||
<!-- Replace: $1[`$2`](https://youtrack.jetbrains.com/issue/$2) -->
|
<!-- Replace: $1[`$2`](https://youtrack.jetbrains.com/issue/$2) -->
|
||||||
|
|
||||||
|
## 1.1-M04 (EAP-4)
|
||||||
|
|
||||||
|
### IDE
|
||||||
|
|
||||||
|
###### Issues fixed
|
||||||
|
- [`KT-14693`](https://youtrack.jetbrains.com/issue/KT-14693) Introduce Type Alias: Do not suggest type qualifiers
|
||||||
|
|
||||||
## 1.1-M03 (EAP-3)
|
## 1.1-M03 (EAP-3)
|
||||||
|
|
||||||
### New language features
|
### New language features
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.idea.codeInsight.CodeInsightUtils
|
|||||||
import org.jetbrains.kotlin.idea.refactoring.introduce.findExpressionOrStringFragment
|
import org.jetbrains.kotlin.idea.refactoring.introduce.findExpressionOrStringFragment
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getNextSiblingIgnoringWhitespaceAndComments
|
import org.jetbrains.kotlin.psi.psiUtil.getNextSiblingIgnoringWhitespaceAndComments
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getPrevSiblingIgnoringWhitespaceAndComments
|
import org.jetbrains.kotlin.psi.psiUtil.getPrevSiblingIgnoringWhitespaceAndComments
|
||||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||||
import java.awt.Component
|
import java.awt.Component
|
||||||
@@ -102,7 +103,9 @@ fun getSmartSelectSuggestions(
|
|||||||
var keepPrevious = true
|
var keepPrevious = true
|
||||||
|
|
||||||
if (element is KtTypeElement) {
|
if (element is KtTypeElement) {
|
||||||
addElement = elementKind == CodeInsightUtils.ElementKind.TYPE_ELEMENT
|
addElement =
|
||||||
|
elementKind == CodeInsightUtils.ElementKind.TYPE_ELEMENT
|
||||||
|
&& element.getParentOfTypeAndBranch<KtUserType>(true) { qualifier } == null
|
||||||
if (!addElement) {
|
if (!addElement) {
|
||||||
keepPrevious = false
|
keepPrevious = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// NAME: InnerF11
|
||||||
|
class F1{
|
||||||
|
inner class InnerF1
|
||||||
|
class NestedF1
|
||||||
|
|
||||||
|
// SIBLING:
|
||||||
|
fun f1(p: <caret>F1.InnerF1) = null
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// NAME: InnerF11
|
||||||
|
class F1{
|
||||||
|
inner class InnerF1
|
||||||
|
class NestedF1
|
||||||
|
|
||||||
|
typealias InnerF11 = F1.InnerF1
|
||||||
|
|
||||||
|
// SIBLING:
|
||||||
|
fun f1(p: InnerF11) = null
|
||||||
|
}
|
||||||
+6
@@ -4178,6 +4178,12 @@ public class ExtractionTestGenerated extends AbstractExtractionTest {
|
|||||||
doIntroduceTypeAliasTest(fileName);
|
doIntroduceTypeAliasTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("skipQualifiers.kt")
|
||||||
|
public void testSkipQualifiers() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/introduceTypeAlias/skipQualifiers.kt");
|
||||||
|
doIntroduceTypeAliasTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("suggestedName.kt")
|
@TestMetadata("suggestedName.kt")
|
||||||
public void testSuggestedName() throws Exception {
|
public void testSuggestedName() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/introduceTypeAlias/suggestedName.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/introduceTypeAlias/suggestedName.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user