Search in sources :

Example 16 with MoveRenameUsageInfo

use of com.intellij.refactoring.util.MoveRenameUsageInfo in project intellij-community by JetBrains.

the class RenameCollisionsTest method testAllUsagesInCode.

public void testAllUsagesInCode() throws Exception {
    configureByFile(BASE_PATH + getTestName(false) + ".java");
    PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
    assertNotNull(element);
    final UsageInfo[] usageInfos = RenameUtil.findUsages(element, "newName", true, true, new HashMap<>());
    assertSize(1, usageInfos);
    for (UsageInfo usageInfo : usageInfos) {
        assertTrue(usageInfo instanceof MoveRenameUsageInfo);
        assertFalse(usageInfo.isNonCodeUsage);
    }
}
Also used : MoveRenameUsageInfo(com.intellij.refactoring.util.MoveRenameUsageInfo) PsiElement(com.intellij.psi.PsiElement) MoveRenameUsageInfo(com.intellij.refactoring.util.MoveRenameUsageInfo) UsageInfo(com.intellij.usageView.UsageInfo)

Aggregations

MoveRenameUsageInfo (com.intellij.refactoring.util.MoveRenameUsageInfo)16 UsageInfo (com.intellij.usageView.UsageInfo)15 PsiElement (com.intellij.psi.PsiElement)5 IncorrectOperationException (com.intellij.util.IncorrectOperationException)4 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)3 UnresolvableCollisionUsageInfo (com.intellij.refactoring.rename.UnresolvableCollisionUsageInfo)3 NonCodeUsageInfo (com.intellij.refactoring.util.NonCodeUsageInfo)3 TextRange (com.intellij.openapi.util.TextRange)2 PsiFile (com.intellij.psi.PsiFile)2 PsiReference (com.intellij.psi.PsiReference)2 DefaultConstructorImplicitUsageInfo (com.intellij.refactoring.util.usageInfo.DefaultConstructorImplicitUsageInfo)2 NoConstructorClassUsageInfo (com.intellij.refactoring.util.usageInfo.NoConstructorClassUsageInfo)2 HashSet (com.intellij.util.containers.HashSet)2 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2 ProperTextRange (com.intellij.openapi.util.ProperTextRange)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 LightElement (com.intellij.psi.impl.light.LightElement)1 PsiDocTagValue (com.intellij.psi.javadoc.PsiDocTagValue)1 XmlElement (com.intellij.psi.xml.XmlElement)1