use of com.intellij.refactoring.rename.RenameDialog in project intellij-community by JetBrains.
the class MavenPropertyRenameHandler method invoke.
@Override
public void invoke(@NotNull Project project, @NotNull PsiElement[] elements, DataContext dataContext) {
PsiElement element = elements.length == 1 ? elements[0] : null;
if (element == null)
element = findTarget(dataContext);
RenameDialog.showRenameDialog(dataContext, new RenameDialog(project, element, null, CommonDataKeys.EDITOR.getData(dataContext)));
}
use of com.intellij.refactoring.rename.RenameDialog in project intellij by bazelbuild.
the class RenameRefactoringTest method testRenameSuggestionForSkylarkFile.
@Test
public void testRenameSuggestionForSkylarkFile() {
BuildFile buildFile = createBuildFile(new WorkspacePath("java/com/google/tools/build_defs.bzl"));
RenamePsiElementProcessor processor = RenamePsiElementProcessor.forElement(buildFile);
RenameDialog dialog = processor.createRenameDialog(getProject(), buildFile, buildFile, null);
String[] suggestions = dialog.getSuggestedNames();
assertThat(suggestions[0]).isEqualTo("build_defs.bzl");
}
Aggregations