mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[lombok] disable class searcher if lombok is not used
GitOrigin-RevId: 439652ce7a4a553bcdda09d7cad13c229964fec5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b868c55448
commit
102fe6cb12
@@ -5,20 +5,27 @@ import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElementFinder;
|
||||
import com.intellij.psi.impl.file.impl.JavaFileManager;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import de.plushnikov.intellij.plugin.util.LombokLibraryUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class LombokElementFinder extends PsiElementFinder {
|
||||
|
||||
private final JavaFileManager myFileManager;
|
||||
private final Project myProject;
|
||||
|
||||
public LombokElementFinder(Project project) {
|
||||
myFileManager = JavaFileManager.getInstance(project);
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
|
||||
if (!LombokLibraryUtil.hasLombokLibrary(myProject)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final int lastDot = qualifiedName.lastIndexOf('.');
|
||||
if (lastDot < 0) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user