Fix inserting variable name suggestion on non-enter char typing
#KT-21933 fixed
This commit is contained in:
-10
@@ -501,11 +501,6 @@ class BasicCompletionSession(
|
|||||||
})
|
})
|
||||||
collector.restartCompletionOnPrefixChange(prefixPattern)
|
collector.restartCompletionOnPrefixChange(prefixPattern)
|
||||||
|
|
||||||
collector.addLookupElementPostProcessor { lookupElement ->
|
|
||||||
lookupElement.putUserData(KotlinCompletionCharFilter.HIDE_LOOKUP_ON_COLON, Unit)
|
|
||||||
lookupElement
|
|
||||||
}
|
|
||||||
|
|
||||||
variableNameAndTypeCompletion.addFromParametersInFile(position, resolutionFacade, isVisibleFilterCheckAlways)
|
variableNameAndTypeCompletion.addFromParametersInFile(position, resolutionFacade, isVisibleFilterCheckAlways)
|
||||||
flushToResultSet()
|
flushToResultSet()
|
||||||
|
|
||||||
@@ -694,11 +689,6 @@ class BasicCompletionSession(
|
|||||||
})
|
})
|
||||||
collector.restartCompletionOnPrefixChange(prefixPattern)
|
collector.restartCompletionOnPrefixChange(prefixPattern)
|
||||||
|
|
||||||
collector.addLookupElementPostProcessor { lookupElement ->
|
|
||||||
lookupElement.putUserData(KotlinCompletionCharFilter.HIDE_LOOKUP_ON_COLON, Unit)
|
|
||||||
lookupElement
|
|
||||||
}
|
|
||||||
|
|
||||||
parameterNameAndTypeCompletion.addFromParametersInFile(position, resolutionFacade, isVisibleFilterCheckAlways)
|
parameterNameAndTypeCompletion.addFromParametersInFile(position, resolutionFacade, isVisibleFilterCheckAlways)
|
||||||
flushToResultSet()
|
flushToResultSet()
|
||||||
|
|
||||||
|
|||||||
+4
@@ -194,6 +194,10 @@ class VariableOrParameterNameWithTypeCompletion(
|
|||||||
fun create(parameterName: String, type: Type, shouldInsertType: Boolean, factory: BasicLookupElementFactory): LookupElement? {
|
fun create(parameterName: String, type: Type, shouldInsertType: Boolean, factory: BasicLookupElementFactory): LookupElement? {
|
||||||
val typeLookupElement = type.createTypeLookupElement(factory) ?: return null
|
val typeLookupElement = type.createTypeLookupElement(factory) ?: return null
|
||||||
val lookupElement = MyLookupElement(parameterName, type, typeLookupElement, shouldInsertType)
|
val lookupElement = MyLookupElement(parameterName, type, typeLookupElement, shouldInsertType)
|
||||||
|
if (!shouldInsertType) {
|
||||||
|
lookupElement.putUserData(KotlinCompletionCharFilter.SUPPRESS_ITEM_SELECTION_BY_CHARS_ON_TYPING, Unit)
|
||||||
|
}
|
||||||
|
lookupElement.putUserData(KotlinCompletionCharFilter.HIDE_LOOKUP_ON_COLON, Unit)
|
||||||
return lookupElement.suppressAutoInsertion()
|
return lookupElement.suppressAutoInsertion()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: ' '
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl <caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: ' '
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: ':'
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl:<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: ':'
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: '='
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
class Clz
|
||||||
|
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
val cl=<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
// INVOCATION_COUNT: 0
|
||||||
|
// ELEMENT_TEXT: clz
|
||||||
|
// CHAR: '='
|
||||||
+18
@@ -192,4 +192,22 @@ public class CompletionCharFilterTestGenerated extends AbstractCompletionCharFil
|
|||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/charFilter/Space.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/charFilter/Space.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("VariableName.kt")
|
||||||
|
public void testVariableName() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/charFilter/VariableName.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("VariableName2.kt")
|
||||||
|
public void testVariableName2() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/charFilter/VariableName2.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("VariableName3.kt")
|
||||||
|
public void testVariableName3() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/charFilter/VariableName3.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user