use of com.intellij.codeInsight.editorActions.SelectWordHandler in project intellij-community by JetBrains.
the class CodeInsightTestUtil method doWordSelectionTestOnDirectory.
public static void doWordSelectionTestOnDirectory(@NotNull final CodeInsightTestFixture fixture, @TestDataFile @NotNull final String directoryName, @NotNull final String filesExtension) {
final SelectWordHandler action = new SelectWordHandler(null);
fixture.copyDirectoryToProject(directoryName, directoryName);
fixture.configureByFile(directoryName + "/before." + filesExtension);
int i = 1;
while (true) {
final String fileName = directoryName + "/after" + i + "." + filesExtension;
if (new File(fixture.getTestDataPath() + "/" + fileName).exists()) {
action.execute(fixture.getEditor(), DataManager.getInstance().getDataContext(fixture.getEditor().getComponent()));
fixture.checkResultByFile(fileName);
i++;
} else {
break;
}
}
assertTrue("At least one 'after'-file required", i > 1);
}
use of com.intellij.codeInsight.editorActions.SelectWordHandler in project intellij-plugins by JetBrains.
the class DartSelectWordTest method doTest.
private void doTest(@NotNull final String before, @NotNull final String... after) {
myFixture.configureByText("file.dart", before);
final DataContext dataContext = DataManager.getInstance().getDataContext(myFixture.getEditor().getComponent());
final SelectWordHandler handler = new SelectWordHandler(null);
for (String text : after) {
handler.execute(myFixture.getEditor(), myFixture.getEditor().getCaretModel().getCurrentCaret(), dataContext);
myFixture.checkResult(text);
}
}
use of com.intellij.codeInsight.editorActions.SelectWordHandler in project intellij-community by JetBrains.
the class CodeInsightTestUtil method doWordSelectionTest.
public static void doWordSelectionTest(@NotNull final CodeInsightTestFixture fixture, @TestDataFile @NotNull final String before, @TestDataFile final String... after) {
assert after != null && after.length > 0;
fixture.configureByFile(before);
final SelectWordHandler action = new SelectWordHandler(null);
final DataContext dataContext = DataManager.getInstance().getDataContext(fixture.getEditor().getComponent());
for (String file : after) {
action.execute(fixture.getEditor(), dataContext);
fixture.checkResultByFile(file, false);
}
}
Aggregations