use of com.intellij.codeInsight.lookup.impl.LookupImpl in project intellij-community by JetBrains.
the class JsonLiveTemplateTest method testCustomTemplateExpansion.
public void testCustomTemplateExpansion() {
final String templateContent = "{\n" + " \"foo\": \"$1$\"\n" + "}";
createJsonTemplate("foo", "foo", templateContent);
myFixture.configureByText(JsonFileType.INSTANCE, "foo<caret>");
final Editor editor = myFixture.getEditor();
new ListTemplatesAction().actionPerformedImpl(getProject(), editor);
final LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(editor);
assertNotNull(lookup);
lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR);
myFixture.checkResult(templateContent.replaceAll("\\$.*?\\$", ""));
}
use of com.intellij.codeInsight.lookup.impl.LookupImpl in project intellij-community by JetBrains.
the class JsonSchemaCrossReferencesTest method checkSchemaCompletion.
private void checkSchemaCompletion(VirtualFile moduleFile, final String fileName) {
doHighlighting();
complete();
assertStringItems("\"one\"", "\"two\"");
final VirtualFile baseFile = moduleFile.findChild(fileName);
Assert.assertNotNull(baseFile);
FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
Document document = fileDocumentManager.getDocument(baseFile);
Assert.assertNotNull(document);
String str = "\"enum\": [\"one\", \"two\"]";
int start = document.getText().indexOf(str);
Assert.assertTrue(start > 0);
ApplicationManager.getApplication().runWriteAction(() -> {
document.replaceString(start, start + str.length(), "\"enum\": [\"one1\", \"two1\"]");
fileDocumentManager.saveAllDocuments();
});
LookupImpl lookup = getActiveLookup();
if (lookup != null)
lookup.hide();
JsonSchemaService.Impl.get(getProject()).reset();
doHighlighting();
complete();
assertStringItems("\"one1\"", "\"two1\"");
lookup = getActiveLookup();
if (lookup != null)
lookup.hide();
JsonSchemaService.Impl.get(getProject()).reset();
doHighlighting();
complete();
assertStringItems("\"one1\"", "\"two1\"");
}
use of com.intellij.codeInsight.lookup.impl.LookupImpl in project intellij-community by JetBrains.
the class PythonAutoPopupTest method testAutoPopupAfterDotDuringAnotherAutoPopup.
public void testAutoPopupAfterDotDuringAnotherAutoPopup() {
myFixture.configureByText("a.py", FOO_CLASS + "foo = Foo()\n" + "foo2 = Foo()\n" + "<caret>");
myTester.typeWithPauses("foo");
LookupImpl lookup1 = myTester.getLookup();
assertNotNull(lookup1);
assertFalse(lookup1.isFocused());
myTester.typeWithPauses(".");
LookupImpl lookup2 = myTester.getLookup();
assertNotSame(lookup1, lookup2);
assertNotNull(lookup2);
assertFalse(lookup2.isFocused());
}
use of com.intellij.codeInsight.lookup.impl.LookupImpl in project intellij-plugins by JetBrains.
the class OgnlLiveTemplatesTest method expandLiveTemplate.
private void expandLiveTemplate() {
new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor());
LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(myFixture.getEditor());
assertNotNull(lookup);
lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR);
}
Aggregations