Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
check dumb first
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Plushnikov committed Apr 11, 2015
1 parent a7ed89c commit 25bc07c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public LombokAugmentProvider() {
@Override
public <Psi extends PsiElement> List<Psi> getAugments(@NotNull PsiElement element, @NotNull Class<Psi> type) {
final List<Psi> emptyResult = Collections.emptyList();
// skip processing during index rebuild
final Project project = element.getProject();
if (DumbService.isDumb(project)) {
return emptyResult;
}
// Expecting that we are only augmenting an PsiClass
// Don't filter !isPhysical elements or code auto completion will not work
if (!(element instanceof PsiClass) || !element.isValid()) {
Expand All @@ -67,11 +72,6 @@ public <Psi extends PsiElement> List<Psi> getAugments(@NotNull PsiElement elemen
if (!(type.isAssignableFrom(PsiMethod.class) || type.isAssignableFrom(PsiField.class) || type.isAssignableFrom(PsiClass.class))) {
return emptyResult;
}
// skip processing during index rebuild
final Project project = element.getProject();
if (DumbService.isDumb(project)) {
return emptyResult;
}
// skip processing if plugin is disabled
if (!ProjectSettings.loadAndGetEnabledInProject(project)) {
return emptyResult;
Expand Down

0 comments on commit 25bc07c

Please sign in to comment.