From 63faf67726aeb4d511a1d2166879e7b2bb536fb7 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 13 Oct 2011 13:34:46 +0200 Subject: [PATCH] limit the length of progress text (IDEA-75379) --- .../psi/impl/search/PsiSearchHelperImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 6454e9f51bab..f96786b5734c 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -611,7 +611,18 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { } if (progress != null) { - progress.setText(PsiBundle.message("psi.search.for.word.progress", StringUtil.join(allWords, ", "))); + final StringBuilder result = new StringBuilder(); + for (String string : allWords) { + if (string != null && string.length() != 0) { + if (result.length() > 50) { + result.append("..."); + break; + } + if (result.length() != 0) result.append(", "); + result.append(string); + } + } + progress.setText(PsiBundle.message("psi.search.for.word.progress", result.toString())); } return processPsiFileRoots(new ArrayList(candidateFiles.keySet()), new Processor() {