use of com.intellij.refactoring.rename.JavaNameSuggestionProvider in project intellij-community by JetBrains.
the class RenameLocalTest method testRenameParamUniqueName.
public void testRenameParamUniqueName() throws Exception {
configureByFile(BASE_PATH + getTestName(false) + ".java");
PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
assertNotNull(element);
final HashSet<String> result = new HashSet<>();
new JavaNameSuggestionProvider().getSuggestedNames(element, getFile(), result);
assertTrue(result.toString(), result.contains("window"));
}
use of com.intellij.refactoring.rename.JavaNameSuggestionProvider in project intellij-community by JetBrains.
the class RenameMembersInplaceTest method testNameSuggestion.
public void testNameSuggestion() throws Exception {
configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");
final PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.getInstance().getAllAccepted());
assertNotNull(element);
final Set<String> result = new LinkedHashSet<>();
new JavaNameSuggestionProvider().getSuggestedNames(element, getFile(), result);
CodeInsightTestUtil.doInlineRename(new MemberInplaceRenameHandler(), result.iterator().next(), getEditor(), element);
checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
}
Aggregations