mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
IDEA-95528 Remove completion common prefix insertion in tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
public class Foo {
|
||||
{
|
||||
verify(runP4WithClient("integ", "main/...", "rel/..."));
|
||||
FInpSt.<caret>
|
||||
FileInputStream.<caret>
|
||||
verify(runP4WithClient("resolve", "-at"));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
{
|
||||
Zzoo.Impl l = new Zzoo<caret>
|
||||
Zzoo.Impl l = new Zzoo.Impl()<caret>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
class AaaaBbbb {}
|
||||
class AaaaBbbbb {}
|
||||
|
||||
class Foo {
|
||||
|
||||
|
||||
{
|
||||
AaBb<caret>
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
class AaaaBbbb {}
|
||||
class AaaaBbbbb {}
|
||||
|
||||
class Foo {
|
||||
|
||||
|
||||
{
|
||||
AaaaBbbb~<caret>
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
public class FooBar {
|
||||
|
||||
String getFoo();
|
||||
String getBar();
|
||||
|
||||
{
|
||||
String s = new FooBar().<caret>
|
||||
}
|
||||
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
public class FooBar {
|
||||
|
||||
String getFoo();
|
||||
String getBar();
|
||||
|
||||
{
|
||||
String s = new FooBar().get<caret>
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
class Bar {
|
||||
{
|
||||
SaxP<caret>
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
class Bar {
|
||||
{
|
||||
SAXParse<caret>
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
public class Main {
|
||||
Main getAxParent() {}
|
||||
Main getAxFoo() {}
|
||||
|
||||
{
|
||||
gA<caret>
|
||||
}
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
public class Main {
|
||||
Main getAxParent() {}
|
||||
Main getAxFoo() {}
|
||||
|
||||
{
|
||||
getAx<caret>
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class Foo {
|
||||
class Bar {
|
||||
void foo() {
|
||||
Foo f;
|
||||
if ("abc".equals(f.fo<caret>))
|
||||
if ("abc".equals(f.foo<caret>))
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -125,7 +125,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
myFixture.complete(CompletionType.BASIC, 2);
|
||||
}
|
||||
|
||||
public void testDontDispreferImplsAfterNew() throws Throwable {
|
||||
public void _testDontDispreferImplsAfterNew() { //todo[peter]
|
||||
myFixture.addClass("package foo; public interface Xxx {}");
|
||||
configureSecondCompletion();
|
||||
assertPreferredItems(0, "Xxx", "XxxImpl");
|
||||
|
||||
+3
-31
@@ -525,13 +525,6 @@ public class ListUtils {
|
||||
|
||||
public void testLastExpressionInFor() throws Throwable { doTest(); }
|
||||
|
||||
public void testUndoCommonPrefixOnHide() throws Throwable {//actually don't undo
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
checkResult()
|
||||
LookupManager.getInstance(getProject()).hideActiveLookup();
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testOnlyKeywordsInsideSwitch() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
assertStringItems("case", "default");
|
||||
@@ -575,7 +568,7 @@ public class ListUtils {
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testDefaultAnnoParam() throws Throwable { doTest(); }
|
||||
public void testDefaultAnnoParam() throws Throwable { doTest('\n'); }
|
||||
|
||||
public void testSpaceAfterLookupString() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
@@ -599,14 +592,6 @@ public class ListUtils {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFillCommonPrefixOnSecondCompletion() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
type('ge');
|
||||
complete();
|
||||
checkResult()
|
||||
assertStringItems("getBar", "getFoo", "getClass");
|
||||
}
|
||||
|
||||
public void testQualifierAsPackage() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
selectItem(myItems[0]);
|
||||
@@ -754,13 +739,6 @@ public class ListUtils {
|
||||
assertStringItems("fofoo", "fofoo");
|
||||
}
|
||||
|
||||
public void testDontCancelPrefixOnTyping() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
type('~');
|
||||
assertNull(getLookup());
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testAnnotationQualifiedName() throws Throwable {
|
||||
doTest();
|
||||
}
|
||||
@@ -779,7 +757,7 @@ public class ListUtils {
|
||||
type '\n'
|
||||
checkResult()
|
||||
}
|
||||
public void testClassNameWithInner2() throws Throwable { doTest() }
|
||||
public void testClassNameWithInner2() throws Throwable { doTest('\n') }
|
||||
|
||||
public void testClassNameWithInstanceInner() throws Throwable { doTest('\n') }
|
||||
|
||||
@@ -1124,12 +1102,6 @@ public class ListUtils {
|
||||
public void testPrimitiveArrayOnlyClass() throws Exception { doAntiTest() }
|
||||
public void testPrimitiveArrayInAnno() throws Exception { doTest() }
|
||||
|
||||
public void testSaxParserCommonPrefix() throws Exception {
|
||||
myFixture.addClass("public class SAXParser {}")
|
||||
myFixture.addClass("public class SAXParseException {}")
|
||||
doTest()
|
||||
}
|
||||
|
||||
public void testNewClassAngleBracket() throws Exception { doTest('<') }
|
||||
public void testNewClassAngleBracketExpected() throws Exception { doTest('<') }
|
||||
public void testNewClassSquareBracket() throws Exception { doTest('[') }
|
||||
@@ -1234,7 +1206,7 @@ public class ListUtils {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
type '\b'
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
myFixture.completeBasic()
|
||||
myFixture.complete(CompletionType.BASIC, 2)
|
||||
assert lookup
|
||||
type '.'
|
||||
checkResult()
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ public class SmartTypeCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
checkPreferredItems(0, "Goo", "InnerGoo", "Bar", "AGoo");
|
||||
}
|
||||
|
||||
public void testPrefixOutweighsGenericity() throws Throwable {
|
||||
public void _testPrefixOutweighsGenericity() { //todo[peter]
|
||||
checkPreferredItems(0, "getUserData", "getUserDataString");
|
||||
}
|
||||
|
||||
|
||||
+1
-5
@@ -457,11 +457,7 @@ public class CodeCompletionHandlerBase {
|
||||
if (decision == AutoCompletionDecision.SHOW_LOOKUP) {
|
||||
CompletionServiceImpl.setCompletionPhase(new CompletionPhase.ItemsCalculated(indicator));
|
||||
indicator.getLookup().setCalculating(false);
|
||||
if (indicator.showLookup() && isAutocompleteCommonPrefixOnInvocation() && items.length > 1) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
indicator.fillInCommonPrefix(false);
|
||||
}
|
||||
}
|
||||
indicator.showLookup();
|
||||
}
|
||||
else if (decision instanceof AutoCompletionDecision.InsertItem) {
|
||||
final Runnable restorePrefix = rememberDocumentState(indicator.getEditor());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<ImageView android:layout_<caret>
|
||||
<ImageView layou<caret>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ import com.intellij.codeInsight.template.TemplateManager;
|
||||
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
|
||||
import com.intellij.javaee.ExternalResourceManager;
|
||||
import com.intellij.javaee.ExternalResourceManagerEx;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.javaee.ExternalResourceManagerImpl;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.psi.PsiReference;
|
||||
@@ -59,22 +58,7 @@ public class XmlCompletionTest extends LightCodeInsightFixtureTestCase {
|
||||
return;
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
manager.addResource(url, location);
|
||||
}
|
||||
});
|
||||
|
||||
disposeOnTearDown(new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
manager.removeResource(url);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ExternalResourceManagerImpl.addTestResource(url, location, myTestRootDisposable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -323,12 +307,15 @@ public class XmlCompletionTest extends LightCodeInsightFixtureTestCase {
|
||||
addResource(url,location);
|
||||
|
||||
configureByFile("16.xml");
|
||||
assertNullOrEmpty(myFixture.getLookupElementStrings());
|
||||
checkResultByFile("16_after.xml");
|
||||
|
||||
configureByFile("17.xml");
|
||||
assertNullOrEmpty(myFixture.getLookupElementStrings());
|
||||
checkResultByFile("17_after.xml");
|
||||
|
||||
configureByFile("31.xml");
|
||||
assertNullOrEmpty(myFixture.getLookupElementStrings());
|
||||
checkResultByFile("31_after.xml");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user