more diagnostics for EA-27033 (invalid caret position on completion restart)

This commit is contained in:
peter
2011-04-19 20:41:53 +02:00
parent c3b7f41f81
commit 9eaf85237a
2 changed files with 6 additions and 2 deletions
@@ -594,7 +594,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
for (Pair<Integer, ElementPattern<String>> pair : myRestartingPrefixConditions) {
int start = pair.first;
if (caretOffset < start) {
LOG.error("caret=" + caretOffset + "; start=" + start);
LOG.error("caret=" + caretOffset + "; start=" + start + "; phase=" + CompletionServiceImpl.getPhaseRaw() + "; running=" + isRunning() + "; canceled=" + isCanceled());
}
final String newPrefix = text.subSequence(start, caretOffset).toString();
if (pair.second.accepts(newPrefix)) {
@@ -225,7 +225,7 @@ public class CompletionServiceImpl extends CompletionService{
public static CompletionPhase getCompletionPhase() {
// ApplicationManager.getApplication().assertIsDispatchThread();
CompletionPhase phase = ourPhase;
CompletionPhase phase = getPhaseRaw();
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.checkCanceled();
@@ -233,6 +233,10 @@ public class CompletionServiceImpl extends CompletionService{
return phase;
}
public static CompletionPhase getPhaseRaw() {
return ourPhase;
}
public CompletionSorterImpl defaultSorter(CompletionParameters parameters, final PrefixMatcher matcher) {
final CompletionLocation location = new CompletionLocation(parameters);