From a7d5dd0ab470162375156f03f4fcbd777bef3e5c Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 13 Jan 2014 19:28:21 +0400 Subject: [PATCH] IDEA-118521 Latest 13.0.1 keeps locking up. Editor becomes unresponsive. Various file types... using allScope() --- .../properties/xml/XmlPropertiesIndex.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/properties/src/com/intellij/lang/properties/xml/XmlPropertiesIndex.java b/plugins/properties/src/com/intellij/lang/properties/xml/XmlPropertiesIndex.java index 6c3b4b1a371c..370f07fab505 100644 --- a/plugins/properties/src/com/intellij/lang/properties/xml/XmlPropertiesIndex.java +++ b/plugins/properties/src/com/intellij/lang/properties/xml/XmlPropertiesIndex.java @@ -3,10 +3,11 @@ package com.intellij.lang.properties.xml; import com.intellij.ide.highlighter.XmlFileType; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.project.DumbService; +import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.io.StreamUtil; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.search.EverythingGlobalScope; +import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.xml.XmlFile; import com.intellij.util.Consumer; import com.intellij.util.indexing.*; @@ -101,20 +102,22 @@ public class XmlPropertiesIndex extends FileBasedIndexExtension() { - @Override - public boolean process(VirtualFile file, String value) { - return false; - } - }, new EverythingGlobalScope()); + return !FileBasedIndex.getInstance().processValues(NAME, MARKER_KEY, file.getVirtualFile(), + new FileBasedIndex.ValueProcessor() { + @Override + public boolean process(VirtualFile file, String value) { + return false; + } + }, GlobalSearchScope.allScope(project)); } - static boolean isAccepted(CharSequence bytes) { + private static boolean isAccepted(CharSequence bytes) { MyIXMLBuilderAdapter builder = parse(bytes, true); return builder != null && builder.accepted; }