mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix empty spaces in Structure View tree while indexing is in progress (dumb mode on)
This commit is contained in:
+7
-1
@@ -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(){
|
||||
|
||||
@@ -939,7 +939,7 @@ public class AbstractTreeUi {
|
||||
return update.get();
|
||||
}
|
||||
catch (IndexNotReadyException e) {
|
||||
warnOnIndexNotReady();
|
||||
warnOnIndexNotReady(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1619,7 +1619,7 @@ public class AbstractTreeUi {
|
||||
});
|
||||
}
|
||||
catch (IndexNotReadyException e) {
|
||||
warnOnIndexNotReady();
|
||||
warnOnIndexNotReady(e);
|
||||
return ArrayUtil.EMPTY_OBJECT_ARRAY;
|
||||
}
|
||||
finally {
|
||||
@@ -1651,10 +1651,10 @@ public class AbstractTreeUi {
|
||||
return passOne.get();
|
||||
}
|
||||
|
||||
private void warnOnIndexNotReady() {
|
||||
private void warnOnIndexNotReady(IndexNotReadyException e) {
|
||||
if (!myWasEverIndexNotReady) {
|
||||
myWasEverIndexNotReady = true;
|
||||
LOG.warn("Tree is not dumb-mode-aware; treeBuilder=" + getBuilder() + " treeStructure=" + getTreeStructure());
|
||||
LOG.error("Tree is not dumb-mode-aware; treeBuilder=" + getBuilder() + " treeStructure=" + getTreeStructure(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user