IDEA-175378 "Open Task" makes the whole IDE freeze when selecting a task too quickly

This commit is contained in:
Dmitry Avdeev
2017-09-13 14:40:55 +03:00
parent 02fc99880c
commit 4134e3af63
@@ -15,15 +15,11 @@
*/
package com.intellij.tasks.generic;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.XmlElementFactory;
import com.intellij.psi.xml.XmlTag;
import com.intellij.tasks.Task;
import com.intellij.ui.EditorTextField;
import com.intellij.ui.LanguageTextField;
@@ -31,7 +27,6 @@ import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.FormBuilder;
import com.intellij.util.xmlb.annotations.Tag;
import com.intellij.xml.util.XmlUtil;
import org.intellij.lang.regexp.RegExpLanguage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -117,14 +112,6 @@ public final class RegExResponseHandler extends ResponseHandler {
for (int i = 0; i < max && matcher.find(); i++) {
String id = matcher.group(placeholders.indexOf(ID_PLACEHOLDER) + 1);
String summary = matcher.group(placeholders.indexOf(SUMMARY_PLACEHOLDER) + 1);
// temporary workaround to make AssemblaIntegrationTestPass
final String finalSummary = summary;
summary = ReadAction.compute(() -> {
XmlElementFactory factory = XmlElementFactory.getInstance(ProjectManager.getInstance().getDefaultProject());
XmlTag text = factory.createTagFromText("<a>" + finalSummary + "</a>");
String trimmedText = text.getValue().getTrimmedText();
return XmlUtil.decode(trimmedText);
});
tasks.add(new GenericTask(id, summary, myRepository));
}
return tasks.toArray(new Task[tasks.size()]);