mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+62
-59
@@ -1,59 +1,62 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.lang.StdLanguages;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Consumer;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class XmlBasicToClassNameDelegator extends CompletionContributor {
|
||||
|
||||
@Override
|
||||
public void fillCompletionVariants(CompletionParameters parameters, final CompletionResultSet result) {
|
||||
PsiElement position = parameters.getPosition();
|
||||
if (parameters.getCompletionType() != CompletionType.BASIC ||
|
||||
!JavaCompletionContributor.mayStartClassName(result) ||
|
||||
!position.getContainingFile().getLanguage().isKindOf(StdLanguages.XML)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean empty = result.runRemainingContributors(parameters, true).isEmpty();
|
||||
|
||||
if (!empty && parameters.getInvocationCount() == 0) {
|
||||
result.restartCompletionWhenNothingMatches();
|
||||
}
|
||||
|
||||
if (empty || parameters.isExtendedCompletion()) {
|
||||
CompletionService.getCompletionService().getVariantsFromContributors(parameters.delegateToClassName(), null, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult completionResult) {
|
||||
LookupElement lookupElement = completionResult.getLookupElement();
|
||||
JavaPsiClassReferenceElement classElement = lookupElement.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY);
|
||||
if (classElement != null) {
|
||||
classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE);
|
||||
}
|
||||
lookupElement.putUserData(XmlCompletionContributor.WORD_COMPLETION_COMPATIBLE, Boolean.TRUE); //todo think of a less dirty interaction
|
||||
result.passResult(completionResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.lang.StdLanguages;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.Consumer;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class XmlBasicToClassNameDelegator extends CompletionContributor {
|
||||
|
||||
@Override
|
||||
public void fillCompletionVariants(CompletionParameters parameters, final CompletionResultSet result) {
|
||||
PsiElement position = parameters.getPosition();
|
||||
PsiFile file = position.getContainingFile();
|
||||
if (parameters.getCompletionType() != CompletionType.BASIC ||
|
||||
!JavaCompletionContributor.mayStartClassName(result) ||
|
||||
!file.getLanguage().isKindOf(StdLanguages.XML)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean empty = result.runRemainingContributors(parameters, true).isEmpty();
|
||||
|
||||
if (!empty && parameters.getInvocationCount() == 0) {
|
||||
result.restartCompletionWhenNothingMatches();
|
||||
}
|
||||
|
||||
if (empty && JavaClassReferenceCompletionContributor.findJavaClassReference(file, parameters.getOffset()) != null ||
|
||||
parameters.isExtendedCompletion()) {
|
||||
CompletionService.getCompletionService().getVariantsFromContributors(parameters.delegateToClassName(), null, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult completionResult) {
|
||||
LookupElement lookupElement = completionResult.getLookupElement();
|
||||
JavaPsiClassReferenceElement classElement = lookupElement.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY);
|
||||
if (classElement != null) {
|
||||
classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE);
|
||||
}
|
||||
lookupElement.putUserData(XmlCompletionContributor.WORD_COMPLETION_COMPATIBLE, Boolean.TRUE); //todo think of a less dirty interaction
|
||||
result.passResult(completionResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.*;
|
||||
|
||||
class BarGoo {}
|
||||
|
||||
class Foo {
|
||||
{
|
||||
Map<BarGoo, StringBuilder> goos;
|
||||
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,6 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(false);
|
||||
TemplateState state = TemplateManagerImpl.getTemplateState(myFixture.getEditor());
|
||||
if (state != null) {
|
||||
state.gotoEnd();
|
||||
}
|
||||
@@ -147,28 +146,44 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
public void testToar() throws Throwable {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("toar", "other"));
|
||||
TemplateManagerImpl.getTemplateState(getEditor()).gotoEnd();
|
||||
startTemplate("toar", "other")
|
||||
state.gotoEnd();
|
||||
checkResult();
|
||||
}
|
||||
|
||||
def startTemplate(String name, String group) {
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate(name, group));
|
||||
}
|
||||
|
||||
private void configure() {
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
}
|
||||
|
||||
public void testIter() throws Throwable {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("iter", "iterations"));
|
||||
final TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
|
||||
startTemplate("iter", "iterations")
|
||||
state.nextTab();
|
||||
((LookupImpl)LookupManagerImpl.getActiveLookup(getEditor())).finishLookup((char)0);
|
||||
checkResult();
|
||||
}
|
||||
|
||||
public void testPreferStartMatchesInLookups() throws Throwable {
|
||||
configure();
|
||||
startTemplate("iter", "iterations")
|
||||
myFixture.type('ese\n') //for entrySet
|
||||
assert myFixture.lookupElementStrings == ['barGooStringBuilderEntry', 'gooStringBuilderEntry', 'stringBuilderEntry', 'builderEntry', 'entry']
|
||||
myFixture.type('e')
|
||||
assert myFixture.lookupElementStrings == ['entry', 'barGooStringBuilderEntry', 'gooStringBuilderEntry', 'stringBuilderEntry', 'builderEntry']
|
||||
assert LookupManager.getActiveLookup(editor).currentItem.lookupString == 'entry'
|
||||
}
|
||||
|
||||
private TemplateState getState() {
|
||||
TemplateManagerImpl.getTemplateState(getEditor())
|
||||
}
|
||||
|
||||
public void testIter1() throws Throwable {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("iter", "iterations"));
|
||||
final TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
|
||||
startTemplate("iter", "iterations")
|
||||
state.nextTab();
|
||||
checkResult();
|
||||
}
|
||||
@@ -178,7 +193,7 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
try {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("iter", "iterations"));
|
||||
startTemplate("iter", "iterations")
|
||||
stripTrailingSpaces();
|
||||
checkResult();
|
||||
}
|
||||
@@ -196,20 +211,20 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
public void testIterParameterizedInner() {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("iter", "iterations"));
|
||||
startTemplate("iter", "iterations")
|
||||
stripTrailingSpaces();
|
||||
checkResult();
|
||||
}
|
||||
|
||||
public void testVarargToar() {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("toar", "other"));
|
||||
startTemplate("toar", "other")
|
||||
checkResult();
|
||||
}
|
||||
|
||||
public void testSoutp() {
|
||||
configure();
|
||||
TemplateManager.getInstance(getProject()).startTemplate(getEditor(), TemplateSettings.getInstance().getTemplate("soutp", "output"));
|
||||
startTemplate("soutp", "output")
|
||||
checkResult();
|
||||
}
|
||||
|
||||
@@ -354,7 +369,7 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
writeCommand { manager.startTemplate(editor, template) }
|
||||
|
||||
final TemplateState state = TemplateManagerImpl.getTemplateState(getEditor());
|
||||
final TemplateState state = getState();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
assertFalse(String.valueOf(i), state.isFinished());
|
||||
|
||||
+13
-10
@@ -285,18 +285,21 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
|
||||
@Override
|
||||
public Comparable weigh(@NotNull LookupElement element) {
|
||||
PrefixMatcher itemMatcher = getItemMatcher(element, myLocation);
|
||||
for (String ls : element.getAllLookupStrings()) {
|
||||
if (itemMatcher.isStartMatch(ls)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return !isStartMatch(element, myLocation.getCompletionParameters().getLookup());
|
||||
}
|
||||
}
|
||||
|
||||
private static PrefixMatcher getItemMatcher(LookupElement element, CompletionLocation location) {
|
||||
Lookup lookup = location.getCompletionParameters().getLookup();
|
||||
public static boolean isStartMatch(LookupElement element, Lookup lookup) {
|
||||
PrefixMatcher itemMatcher = getItemMatcher(element, lookup);
|
||||
for (String ls : element.getAllLookupStrings()) {
|
||||
if (itemMatcher.isStartMatch(ls)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static PrefixMatcher getItemMatcher(LookupElement element, Lookup lookup) {
|
||||
PrefixMatcher itemMatcher = lookup.itemMatcher(element);
|
||||
String pattern = lookup.itemPattern(element);
|
||||
if (!pattern.equals(itemMatcher.getPrefix())) {
|
||||
@@ -315,7 +318,7 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
|
||||
@Override
|
||||
public Comparable weigh(@NotNull LookupElement element) {
|
||||
final PrefixMatcher matcher = getItemMatcher(element, myLocation);
|
||||
final PrefixMatcher matcher = getItemMatcher(element, myLocation.getCompletionParameters().getLookup());
|
||||
|
||||
int max = Integer.MIN_VALUE;
|
||||
for (String lookupString : element.getAllLookupStrings()) {
|
||||
|
||||
@@ -1,96 +1,102 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInsight.lookup;
|
||||
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class LookupArranger {
|
||||
protected final List<LookupElement> myItems = new ArrayList<LookupElement>();
|
||||
|
||||
public void addElement(Lookup lookup, LookupElement item, LookupElementPresentation presentation) {
|
||||
myItems.add(item);
|
||||
}
|
||||
|
||||
public void prefixChanged() {
|
||||
}
|
||||
|
||||
public abstract Pair<List<LookupElement>, Integer> arrangeItems(@NotNull Lookup lookup, boolean onExplicitAction);
|
||||
|
||||
public abstract LookupArranger createEmptyCopy();
|
||||
|
||||
protected static void addPrefixItems(Lookup lookup, LinkedHashSet<LookupElement> result, boolean exactly, Collection<LookupElement> items) {
|
||||
for (LookupElement element : items) {
|
||||
if (isPrefixItem(lookup, element, exactly)) {
|
||||
result.add(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean isPrefixItem(Lookup lookup, LookupElement item, final boolean exactly) {
|
||||
final String pattern = lookup.itemPattern(item);
|
||||
if (pattern.equals(item.getLookupString())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!exactly) {
|
||||
for (String s : item.getAllLookupStrings()) {
|
||||
if (s.equalsIgnoreCase(pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected List<LookupElement> matchingItems(Lookup lookup) {
|
||||
final List<LookupElement> items = new ArrayList<LookupElement>();
|
||||
for (LookupElement element : myItems) {
|
||||
if (lookup.prefixMatches(element)) {
|
||||
items.add(element);
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public Map<LookupElement,StringBuilder> getRelevanceStrings() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
public static class DefaultArranger extends LookupArranger {
|
||||
public Pair<List<LookupElement>, Integer> arrangeItems(@NotNull Lookup lookup, boolean onExplicitAction) {
|
||||
LinkedHashSet<LookupElement> result = new LinkedHashSet<LookupElement>();
|
||||
List<LookupElement> items = matchingItems(lookup);
|
||||
addPrefixItems(lookup, result, true, items);
|
||||
addPrefixItems(lookup, result, false, items);
|
||||
result.addAll(items);
|
||||
ArrayList<LookupElement> list = new ArrayList<LookupElement>(result);
|
||||
int selected = list.indexOf(lookup.getCurrentItem());
|
||||
return new Pair<List<LookupElement>, Integer>(list, selected >= 0 ? selected : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LookupArranger createEmptyCopy() {
|
||||
return new DefaultArranger();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInsight.lookup;
|
||||
|
||||
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class LookupArranger {
|
||||
protected final List<LookupElement> myItems = new ArrayList<LookupElement>();
|
||||
|
||||
public void addElement(Lookup lookup, LookupElement item, LookupElementPresentation presentation) {
|
||||
myItems.add(item);
|
||||
}
|
||||
|
||||
public void prefixChanged() {
|
||||
}
|
||||
|
||||
public abstract Pair<List<LookupElement>, Integer> arrangeItems(@NotNull Lookup lookup, boolean onExplicitAction);
|
||||
|
||||
public abstract LookupArranger createEmptyCopy();
|
||||
|
||||
protected static void addPrefixItems(Lookup lookup, LinkedHashSet<LookupElement> result, boolean exactly, Collection<LookupElement> items) {
|
||||
for (LookupElement element : items) {
|
||||
if (isPrefixItem(lookup, element, exactly)) {
|
||||
result.add(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean isPrefixItem(Lookup lookup, LookupElement item, final boolean exactly) {
|
||||
final String pattern = lookup.itemPattern(item);
|
||||
if (pattern.equals(item.getLookupString())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!exactly) {
|
||||
for (String s : item.getAllLookupStrings()) {
|
||||
if (s.equalsIgnoreCase(pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected List<LookupElement> matchingItems(Lookup lookup) {
|
||||
final List<LookupElement> items = new ArrayList<LookupElement>();
|
||||
for (LookupElement element : myItems) {
|
||||
if (lookup.prefixMatches(element)) {
|
||||
items.add(element);
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public Map<LookupElement,StringBuilder> getRelevanceStrings() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
public static class DefaultArranger extends LookupArranger {
|
||||
public Pair<List<LookupElement>, Integer> arrangeItems(@NotNull Lookup lookup, boolean onExplicitAction) {
|
||||
LinkedHashSet<LookupElement> result = new LinkedHashSet<LookupElement>();
|
||||
List<LookupElement> items = matchingItems(lookup);
|
||||
addPrefixItems(lookup, result, true, items);
|
||||
addPrefixItems(lookup, result, false, items);
|
||||
for (LookupElement item : items) {
|
||||
if (CompletionServiceImpl.isStartMatch(item, lookup)) {
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
result.addAll(items);
|
||||
ArrayList<LookupElement> list = new ArrayList<LookupElement>(result);
|
||||
int selected = onExplicitAction ? 0 : list.indexOf(lookup.getCurrentItem());
|
||||
return new Pair<List<LookupElement>, Integer>(list, selected >= 0 ? selected : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LookupArranger createEmptyCopy() {
|
||||
return new DefaultArranger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,6 +449,10 @@ public class TemplateImpl extends Template implements SchemeElement {
|
||||
return myVariables.get(i).skipOnStart();
|
||||
}
|
||||
|
||||
public ArrayList<Variable> getVariables() {
|
||||
return myVariables;
|
||||
}
|
||||
|
||||
private static class Segment {
|
||||
public String name;
|
||||
public int offset;
|
||||
|
||||
@@ -252,6 +252,10 @@ public class TemplateListPanel extends JPanel implements Disposable {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!newTemplate.getVariables().equals(originalTemplate.getVariables())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!areOptionsEqual(newTemplate, originalTemplate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,17 @@ public class Variable implements Cloneable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Variable{" +
|
||||
"myName='" + myName + '\'' +
|
||||
", myAlwaysStopAt=" + myAlwaysStopAt +
|
||||
", myExpressionString='" + myExpressionString + '\'' +
|
||||
", myDefaultValueString='" + myDefaultValueString + '\'' +
|
||||
", mySkipOnStart=" + mySkipOnStart +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean skipOnStart() {
|
||||
return mySkipOnStart;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<idea-plugin>
|
||||
<extensionPoints>
|
||||
<extensionPoint name="ext" interface="foo.FooFooFooFooFoo"/>
|
||||
<extensionPoint name="FFFFoo<caret>"/>
|
||||
</extensionPoints>
|
||||
</idea-plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<idea-plugin>
|
||||
<extensionPoints>
|
||||
<extensionPoint name="ext" interface="foo.FooFooFooFooFoo"/>
|
||||
<extensionPoint name="FooFooFooFooFoo<caret>"/>
|
||||
</extensionPoints>
|
||||
</idea-plugin>
|
||||
@@ -136,6 +136,14 @@ public class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase {
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.xml");
|
||||
}
|
||||
|
||||
public void testNoClassCompletionOutsideJavaReferences() throws Throwable {
|
||||
myFixture.addClass("package foo; public class FooFooFooFooFoo { }");
|
||||
|
||||
myFixture.configureByFile(getTestName(false) + ".xml");
|
||||
myFixture.completeBasic();
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.xml");
|
||||
}
|
||||
|
||||
public void testDeprecatedExtensionAttribute() {
|
||||
myFixture.enableInspections(DeprecatedClassUsageInspection.class);
|
||||
myFixture.testHighlighting("deprecatedExtensionAttribute.xml", "MyExtBean.java");
|
||||
|
||||
@@ -547,7 +547,8 @@ public class XmlCompletionTest extends LightCodeInsightFixtureTestCase {
|
||||
myFixture.addClass("public class ABxxZ {}");
|
||||
|
||||
final String testName = getTestName(false);
|
||||
configureByFile(testName + ".xml");
|
||||
myFixture.configureByFile(testName + ".xml");
|
||||
myFixture.complete(CompletionType.BASIC, 2);
|
||||
assertEquals("ABxxZ", myFixture.getLookupElements()[0].getLookupString());
|
||||
assertEquals("ABxxCDEF", myFixture.getLookupElements()[1].getLookupString());
|
||||
selectItem(myFixture.getLookupElements()[1], Lookup.NORMAL_SELECT_CHAR);
|
||||
@@ -558,7 +559,8 @@ public class XmlCompletionTest extends LightCodeInsightFixtureTestCase {
|
||||
myFixture.addClass("package foo; public class SomeClass {}");
|
||||
|
||||
final String testName = getTestName(false);
|
||||
configureByFile(testName + ".xml");
|
||||
myFixture.configureByFile(testName + ".xml");
|
||||
myFixture.complete(CompletionType.BASIC, 2);
|
||||
selectItem(assertOneElement(myFixture.getLookupElements()), Lookup.NORMAL_SELECT_CHAR);
|
||||
checkResultByFile(testName + "_after.xml");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user