Fixed KT-5809 Code completion after "?." should not include keywords
#KT-5809 Fixed
This commit is contained in:
@@ -67,7 +67,8 @@ object KeywordCompletion {
|
||||
CommentFilter(),
|
||||
ParentFilter(ClassFilter(javaClass<JetLiteralStringTemplateEntry>())),
|
||||
ParentFilter(ClassFilter(javaClass<JetConstantExpression>())),
|
||||
LeftNeighbour(TextFilter("."))
|
||||
LeftNeighbour(TextFilter(".")),
|
||||
LeftNeighbour(TextFilter("?."))
|
||||
))
|
||||
|
||||
private class CommentFilter() : ElementFilter {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
val str : String?
|
||||
str?.<caret>
|
||||
}
|
||||
|
||||
// NUMBER: 0
|
||||
@@ -17,13 +17,9 @@
|
||||
package org.jetbrains.jet.completion;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.InnerTestClasses;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -52,6 +48,12 @@ public class KeywordCompletionTestGenerated extends AbstractKeywordCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AfterSafeDot.kt")
|
||||
public void testAfterSafeDot() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/keywords/AfterSafeDot.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AfterSpaceAndDot.kt")
|
||||
public void testAfterSpaceAndDot() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/keywords/AfterSpaceAndDot.kt");
|
||||
|
||||
Reference in New Issue
Block a user