use of com.intellij.codeInsight.template.impl.actions.ListTemplatesAction in project intellij-community by JetBrains.
the class PyLiveTemplatesExpandingTest method doMultiFileTest.
private void doMultiFileTest() {
myFixture.copyDirectoryToProject(getTestName(false), "");
myFixture.configureByFile("a.py");
final Editor editor = myFixture.getEditor();
final Project project = myFixture.getProject();
new ListTemplatesAction().actionPerformedImpl(project, editor);
final LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(editor);
assertNotNull(lookup);
lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR);
myFixture.checkResultByFile(getTestName(false) + "/a_after.py");
}
use of com.intellij.codeInsight.template.impl.actions.ListTemplatesAction in project intellij-community by JetBrains.
the class ListTemplateActionTest method doTest.
private void doTest(@NotNull String lookupText) {
myFixture.configureByFile(getTestName(false) + ".java");
new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor());
LookupElement[] elements = myFixture.getLookupElements();
assertNotNull(elements);
for (LookupElement element : elements) {
if (lookupText.equals(element.getLookupString())) {
myFixture.getLookup().setCurrentItem(element);
myFixture.finishLookup(Lookup.NORMAL_SELECT_CHAR);
myFixture.checkResultByFile(getTestName(false) + "_after.java");
return;
}
}
//noinspection ConstantConditions
fail("Lookup element with text '" + lookupText + "' not found:\n" + StringUtil.join(myFixture.getLookupElementStrings(), "\n"));
}
use of com.intellij.codeInsight.template.impl.actions.ListTemplatesAction in project intellij-community by JetBrains.
the class ListTemplateActionTest method testWithSameKeys.
public void testWithSameKeys() {
myFixture.configureByFile(getTestName(false) + ".java");
new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor());
assertSameElements(myFixture.getLookupElementStrings(), "duplicateKey", "duplicateKey");
}
use of com.intellij.codeInsight.template.impl.actions.ListTemplatesAction in project intellij-plugins by JetBrains.
the class DartLiveTemplatesTest method expandTemplate.
public void expandTemplate(final Editor editor) {
final Project project = editor.getProject();
assertNotNull(project);
new ListTemplatesAction().actionPerformedImpl(project, editor);
final LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(editor);
assertNotNull(lookup);
lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR);
TemplateState template = TemplateManagerImpl.getTemplateState(editor);
if (template != null) {
Disposer.dispose(template);
}
}
use of com.intellij.codeInsight.template.impl.actions.ListTemplatesAction in project intellij-community by JetBrains.
the class CodeInsightTestUtil method doLiveTemplateTest.
public static void doLiveTemplateTest(@NotNull final CodeInsightTestFixture fixture, @NotNull final String before, @NotNull final String after) {
fixture.configureByFile(before);
new ListTemplatesAction().actionPerformedImpl(fixture.getProject(), fixture.getEditor());
final LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(fixture.getEditor());
assert lookup != null;
lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR);
fixture.checkResultByFile(after, false);
}
Aggregations