Fix empty spaces in Structure View tree while indexing is in progress (dumb mode on)

This commit is contained in:
Sergey Malenkov
2016-06-29 19:48:00 +03:00
parent 01aa6a91a4
commit 20a2b0c121
2 changed files with 11 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ import com.intellij.navigation.ColoredItemPresentation;
import com.intellij.navigation.LocationPresentation;
import com.intellij.openapi.editor.colors.CodeInsightColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
@@ -104,7 +105,12 @@ public abstract class JavaClassTreeElementBase<Value extends PsiElement> extends
@Override
public TextAttributesKey getTextAttributesKey() {
return isDeprecated() ? CodeInsightColors.DEPRECATED_ATTRIBUTES : null;
try {
return isDeprecated() ? CodeInsightColors.DEPRECATED_ATTRIBUTES : null;
}
catch (IndexNotReadyException ignore) {
return null; // do not show deprecated elements while indexing
}
}
private boolean isDeprecated(){