cleanup obscure code

GitOrigin-RevId: 348d57dce08ae6a92a49f49b0f7292ff6e570311
This commit is contained in:
Alexey Kudravtsev
2019-10-03 11:33:07 +00:00
committed by intellij-monorepo-bot
parent 28aa1f8b32
commit e26f40bd8f
@@ -163,9 +163,9 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
myRefCountHolder = refCountHolder;
Project project = file.getProject();
Document document = PsiDocumentManager.getInstance(project).getDocument(file);
TextRange dirtyScope = Optional.ofNullable(document)
.map(doc -> DaemonCodeAnalyzerEx.getInstanceEx(project).getFileStatusMap().getFileDirtyScope(doc, Pass.UPDATE_ALL))
.orElse(file.getTextRange());
TextRange dirtyScope = document == null ? null : DaemonCodeAnalyzerEx.getInstanceEx(project).getFileStatusMap().getFileDirtyScope(document, Pass.UPDATE_ALL);
if (dirtyScope == null) dirtyScope = file.getTextRange();
success = refCountHolder.analyze(file, dirtyScope, progress, () -> {
highlight.run();
ProgressManager.checkCanceled();