mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ClassNameCompletionTest -> community
This commit is contained in:
@@ -0,0 +1 @@
|
||||
abc = StrinBui<caret>
|
||||
@@ -0,0 +1 @@
|
||||
abc = java.lang.StringBuilder<caret>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A{
|
||||
void foo() {
|
||||
throw new OurException()<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A{
|
||||
void foo() {
|
||||
throw new OurNotException.InnerException()<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A{
|
||||
void foo() {
|
||||
throw new Our<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A{
|
||||
void foo() {
|
||||
throw new Inner<caret>
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
public class OurException extends Throwable{
|
||||
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
public class OurNotException {
|
||||
public static class InnerException extends Throwable{
|
||||
}
|
||||
public static class InnerNonException{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import pack.AClass;
|
||||
|
||||
public class Test1 {
|
||||
public void foo() {
|
||||
new AClass()<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import pack.WithInnerAClass;
|
||||
|
||||
public class Test1 {
|
||||
public void foo() {
|
||||
new WithInnerAClass()<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Test1 {
|
||||
public void foo() {
|
||||
new ACl<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Test1 {
|
||||
public void foo() {
|
||||
new WithInnerACl<caret>
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package pack;
|
||||
|
||||
public class AClass{
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package pack;
|
||||
|
||||
public class WithInnerAClass{
|
||||
public static class Inner{}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
Object[] a = new FFFFF<caret>[];
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
Object[] a = new FooFooFooFooFoo<caret>[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class LifeUniverseEverythingEntity {}
|
||||
class LifeUniverseEverythingManager {}
|
||||
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
LUEv<caret>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class LifeUniverseEverythingEntity {}
|
||||
class LifeUniverseEverythingManager {}
|
||||
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
LifeUniverseEverything<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
StringBuf<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
StringBuffer<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
new FFFFF<caret>();
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
new FooFooFooFooFoo()<caret>;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
int a = 0;
|
||||
ABCD<caret>
|
||||
foo(new String[]{"a"}, 1);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import foo.bar.ABCDEF;
|
||||
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
int a = 0;
|
||||
ABCDEF<caret>
|
||||
foo(new String[]{"a"}, 1);
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
new FFFFF<caret>(x);
|
||||
}
|
||||
|
||||
FooFooFooFooFoo(int x) {}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
new FooFooFooFooFoo(<caret>x);
|
||||
}
|
||||
|
||||
FooFooFooFooFoo(int x) {}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
@interface Column {
|
||||
String name();
|
||||
}
|
||||
|
||||
@Column(<caret>)
|
||||
@interface Annotation {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
@interface Column {
|
||||
String name();
|
||||
}
|
||||
|
||||
Colu<caret>
|
||||
@interface Annotation {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.io.FileInputStream;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
equals(FileInputStream<caret>aaa);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
equals(FileInputStrea<caret>aaa);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// java.io.FileInputStream<caret>
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// java.FileInputStrea<caret>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import static java.io.FileInputStream<caret>
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
equals(FileInputStrea<caret>aaa);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import static FileInpStre<caret>
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
equals(FileInputStrea<caret>aaa);
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class Main {
|
||||
|
||||
foo.bar.AxBxCxDxEx<caret>
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class Main {
|
||||
|
||||
ABCDE<caret>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements Foo, ZZZZZZ<caret>{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements Foo, ZZZ<caret>{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements Foo<ZZZZZZ<caret>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements Foo<ZZZ<caret>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MyClass1<caret>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MCla<caret>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MyClass1<caret>f.oo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MCla<caret>f.oo()
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class MyClass1 {
|
||||
MyClass1<caret>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class MyClass1 {
|
||||
MyCla<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
aaa.MyObjectType<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
aaa.MyObj<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
MyObjectType<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
MyObj<caret>
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
void aaa() {
|
||||
getClass().getAnnotations(MyObjectType<caret>)
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package aaa;
|
||||
@interface MyObjectType {}
|
||||
class A {
|
||||
void aaa() {
|
||||
getClass().getAnnotations(MyObject<caret>)
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package aaa;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface MyObjectType {}
|
||||
|
||||
class A {
|
||||
MyObjectType<caret>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package aaa;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface MyObjectType {}
|
||||
|
||||
class A {
|
||||
My<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Test1 {
|
||||
public void foo(){
|
||||
Test1<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Test1 {
|
||||
public void foo(){
|
||||
Tes<caret>
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements ZZZZZZ<caret>{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class ZZZZZZ{}
|
||||
|
||||
class A implements ZZZ<caret>{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface ZZZZZZ{}
|
||||
|
||||
class A implements ZZZZZZ<caret>{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface ZZZZZZ{}
|
||||
|
||||
class A implements ZZZ<caret>{}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyObject {}
|
||||
@interface MyObjectType {}
|
||||
|
||||
@MyObjectType<caret>
|
||||
class A {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyObject {}
|
||||
@interface MyObjectType {}
|
||||
|
||||
@MyObj<caret>
|
||||
class A {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
@interface MyObjectType {}
|
||||
|
||||
class A {
|
||||
void aaa(@MyObjectType<caret>);
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
@interface MyObjectType {}
|
||||
|
||||
class A {
|
||||
void aaa(@MyObj<caret>);
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import MyObjectType<caret>
|
||||
@interface MyObjectType {}
|
||||
class A {}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import MyObj<caret>
|
||||
@interface MyObjectType {}
|
||||
class A {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import MyObjectType<caret>
|
||||
@interface MyObjectType {
|
||||
int param();
|
||||
}
|
||||
class A {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import MyObj<caret>
|
||||
@interface MyObjectType {
|
||||
int param();
|
||||
}
|
||||
class A {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
@interface MyObjectType {
|
||||
int param();
|
||||
}
|
||||
class A {
|
||||
void foo() {
|
||||
MyObjectType<caret>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
@interface MyObjectType {
|
||||
int param();
|
||||
}
|
||||
class A {
|
||||
void foo() {
|
||||
MyOb<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MyClass1<caret>f.oo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class MyClass1 {
|
||||
{
|
||||
MCla<caret>f.oo()
|
||||
}
|
||||
}
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.lookup.impl.TestLookupManager;
|
||||
import com.intellij.openapi.module.JavaModuleType;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ClassNameCompletionTest extends CompletionTestCase {
|
||||
private static final String BASE_PATH = "/codeInsight/completion/className/";
|
||||
protected boolean myOldSetting;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
setType(CompletionType.CLASS_NAME);
|
||||
myOldSetting = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CLASS_NAME_COMPLETION;
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CLASS_NAME_COMPLETION = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return JavaTestUtil.getJavaTestDataPath();
|
||||
}
|
||||
|
||||
protected Sdk getTestProjectJdk() {
|
||||
return JavaSdkImpl.getMockJdk15("java 1.5");
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CLASS_NAME_COMPLETION = myOldSetting;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void testImportAfterNew() throws Exception {
|
||||
String path = BASE_PATH + "/importAfterNew";
|
||||
|
||||
configureByFile(path + "/before1.java");
|
||||
checkResultByFile(path + "/after1.java");
|
||||
|
||||
configureByFile(path + "/before2.java");
|
||||
checkResultByFile(path + "/after2.java");
|
||||
}
|
||||
|
||||
public void testAfterNewThrowable1() throws Exception {
|
||||
String path = BASE_PATH + "/afterNewThrowable";
|
||||
|
||||
configureByFile(path + "/before1.java");
|
||||
checkResultByFile(path + "/after1.java");
|
||||
}
|
||||
|
||||
public void testAfterNewThrowable2() throws Exception {
|
||||
String path = BASE_PATH + "/afterNewThrowable";
|
||||
|
||||
configureByFile(path + "/before2.java");
|
||||
checkResultByFile(path + "/after2.java");
|
||||
}
|
||||
|
||||
public void testExcessParensAfterNew() throws Throwable { doTest(); }
|
||||
|
||||
public void testReuseParensAfterNew() throws Throwable { doTest(); }
|
||||
|
||||
public void testBracesAfterNew() throws Throwable { doTest(); }
|
||||
|
||||
public void testInPlainTextFile() throws Throwable {
|
||||
configureByFile(BASE_PATH + getTestName(false) + ".txt");
|
||||
checkResultByFile(BASE_PATH + getTestName(false) + "_after.txt");
|
||||
}
|
||||
|
||||
public void testDoubleStringBuffer() throws Throwable {
|
||||
createClass("package java.lang; public class StringBuffer {}");
|
||||
doTest();
|
||||
assertNull(myItems);
|
||||
}
|
||||
|
||||
public void testReplaceReferenceExpressionWithTypeElement() throws Throwable {
|
||||
createClass("package foo.bar; public class ABCDEF {}");
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCamelHumpPrefix() throws Throwable {
|
||||
String path = BASE_PATH + "/java/";
|
||||
configureByFile(path + getTestName(false) + ".java");
|
||||
complete();
|
||||
checkResultByFile(path + getTestName(false) + "_after.java");
|
||||
assertEquals(2, myItems.length);
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
String path = BASE_PATH + "/java/";
|
||||
configureByFile(path + getTestName(false) + ".java");
|
||||
checkResultByFile(path + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testNameCompletionJava() throws Exception {
|
||||
String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/test1-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test1-result.java");
|
||||
configureByFile(path + "/test2-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test2-result.java");
|
||||
}
|
||||
|
||||
public void testImplementsFiltering1() throws Exception{
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/test4-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test4-result.java");
|
||||
}
|
||||
|
||||
public void testImplementsFiltering2() throws Exception{
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/test3-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test3-result.java");
|
||||
|
||||
configureByFile(path + "/implements2-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/implements2-result.java");
|
||||
|
||||
configureByFile(path + "/implements3-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/implements3-result.java");
|
||||
}
|
||||
|
||||
protected boolean clearModelBeforeConfiguring() {
|
||||
return "testAnnotationFiltering".equals(getName());
|
||||
}
|
||||
|
||||
public void testAnnotationFiltering() throws Exception{
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/test7-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test7-result.java");
|
||||
|
||||
configureByFile(path + "/test8-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test8-result.java");
|
||||
|
||||
configureByFile(path + "/test9-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test9-result.java");
|
||||
|
||||
configureByFile(path + "/test9_2-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test9_2-result.java");
|
||||
|
||||
configureByFile(path + "/test9_3-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test9_3-result.java");
|
||||
|
||||
configureByFile(path + "/test11-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test11-result.java");
|
||||
|
||||
configureByFile(path + "/test10-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test10-result.java");
|
||||
|
||||
configureByFile(path + "/test12-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test12-result.java");
|
||||
|
||||
configureByFile(path + "/test13-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/test13-result.java");
|
||||
}
|
||||
|
||||
public void testInMethodCall() throws Throwable {
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/methodCall-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/methodCall-result.java");
|
||||
}
|
||||
|
||||
public void testInMethodCallQualifier() throws Throwable {
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/methodCall1-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/methodCall1-result.java");
|
||||
}
|
||||
|
||||
public void testInVariableDeclarationType() throws Throwable {
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/varType-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/varType-result.java");
|
||||
}
|
||||
|
||||
public void testExtraSpace() throws Throwable { doJavaTest(); }
|
||||
|
||||
public void testAnnotation() throws Throwable { doJavaTest(); }
|
||||
|
||||
public void testInStaticImport() throws Throwable { doJavaTest(); }
|
||||
|
||||
public void testInCommentWithPackagePrefix() throws Throwable { doJavaTest(); }
|
||||
|
||||
private void doJavaTest() throws Exception {
|
||||
final String path = BASE_PATH + "/nameCompletion/java";
|
||||
configureByFile(path + "/" + getTestName(false) + "-source.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "/" + getTestName(false) + "-result.java");
|
||||
}
|
||||
|
||||
protected void configureByFile(String filePath) throws Exception {
|
||||
final String path = getTestDataPath() + new File(filePath).getParent() + "/source";
|
||||
if (new File(path).exists()) {
|
||||
PsiTestUtil.createTestProjectStructure(myProject, myModule, path, myFilesToDelete);
|
||||
}
|
||||
super.configureByFile(filePath);
|
||||
}
|
||||
|
||||
private void performAction() {
|
||||
CodeCompletionHandlerBase handler = new CodeCompletionHandlerBase(CompletionType.CLASS_NAME);
|
||||
handler.invoke(myProject, myEditor, myFile);
|
||||
final LookupManager instance = LookupManager.getInstance(myProject);
|
||||
if(instance instanceof TestLookupManager){
|
||||
final TestLookupManager testLookupManager = ((TestLookupManager)instance);
|
||||
if(testLookupManager.getActiveLookup() != null)
|
||||
testLookupManager.forceSelection(Lookup.NORMAL_SELECT_CHAR, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void testQualifyNameOnSecondCompletion() throws Throwable {
|
||||
final Module module = ModuleManager.getInstance(getProject()).newModule("second.iml", new JavaModuleType());
|
||||
createClass(module, "package foo.bar; class AxBxCxDxEx {}");
|
||||
configureByFileNoCompletion(BASE_PATH + "/nameCompletion/java/" + getTestName(false) + "-source.java");
|
||||
new CodeCompletionHandlerBase(CompletionType.CLASS_NAME).invokeCompletion(myProject, myEditor, myFile, 2);
|
||||
checkResultByFile(BASE_PATH + "/nameCompletion/java/" + getTestName(false) + "-result.java");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user