mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rename validators: ensure that validators with same patterns can still reject new name if others accept them
This commit is contained in:
@@ -5,9 +5,11 @@ package com.intellij.mock;
|
||||
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.lang.Language;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -19,10 +21,18 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class MockPsiDirectory extends MockPsiElement implements PsiDirectory {
|
||||
private final PsiPackage myPackage;
|
||||
private final Project myProject;
|
||||
|
||||
public MockPsiDirectory(final PsiPackage aPackage, @NotNull Disposable parentDisposable) {
|
||||
super(parentDisposable);
|
||||
myPackage = aPackage;
|
||||
myProject = null;
|
||||
}
|
||||
|
||||
public MockPsiDirectory(Project project, @NotNull Disposable parentDisposable) {
|
||||
super(parentDisposable);
|
||||
myProject = project;
|
||||
myPackage = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,6 +40,12 @@ public class MockPsiDirectory extends MockPsiElement implements PsiDirectory {
|
||||
return true;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Project getProject() {
|
||||
return myProject != null ? myProject : super.getProject();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Language getLanguage() {
|
||||
@@ -110,7 +126,7 @@ public class MockPsiDirectory extends MockPsiElement implements PsiDirectory {
|
||||
@Override
|
||||
@NotNull
|
||||
public VirtualFile getVirtualFile() {
|
||||
throw new UnsupportedOperationException("Method getVirtualFile is not yet implemented in " + getClass().getName());
|
||||
return new LightVirtualFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user