mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
upper case
This commit is contained in:
+7
-7
@@ -267,7 +267,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
|
||||
final LookupImpl lookup = obtainLookup(editor);
|
||||
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.synchronous);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.Synchronous);
|
||||
|
||||
final Semaphore freezeSemaphore = new Semaphore();
|
||||
freezeSemaphore.down();
|
||||
@@ -476,7 +476,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
|
||||
final AutoCompletionDecision decision = shouldAutoComplete(indicator, items);
|
||||
if (decision == AutoCompletionDecision.SHOW_LOOKUP) {
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.itemsCalculated);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.ItemsCalculated);
|
||||
indicator.getLookup().setCalculating(false);
|
||||
indicator.showLookup();
|
||||
if (isAutocompleteCommonPrefixOnInvocation() && items.length > 1) {
|
||||
@@ -494,7 +494,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
// the insert handler may have started a live template with completion
|
||||
if (CompletionService.getCompletionService().getCurrentCompletion() == null) {
|
||||
indicator.liveAfterDeath(null);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.insertedSingleItem);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.InsertedSingleItem);
|
||||
} else {
|
||||
LOG.assertTrue(!indicator.isZombie(), indicator);
|
||||
}
|
||||
@@ -597,12 +597,12 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
}
|
||||
|
||||
protected CompletionPhase handleEmptyLookup(Project project, Editor editor, final CompletionParameters parameters, final CompletionProgressIndicator indicator) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return CompletionPhase.noCompletion;
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return CompletionPhase.NoCompletion;
|
||||
if (!invokedExplicitly) {
|
||||
return CompletionPhase.noCompletion;
|
||||
return CompletionPhase.NoCompletion;
|
||||
}
|
||||
|
||||
CompletionPhase result = CompletionPhase.noCompletion;
|
||||
CompletionPhase result = CompletionPhase.NoCompletion;
|
||||
for (final CompletionContributor contributor : CompletionContributor.forParameters(parameters)) {
|
||||
final String text = contributor.handleEmptyLookup(parameters, editor);
|
||||
if (StringUtil.isNotEmpty(text)) {
|
||||
@@ -615,7 +615,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
connection.subscribe(EditorHintListener.TOPIC, listener);
|
||||
HintManager.getInstance().showErrorHint(editor, text);
|
||||
connection.disconnect();
|
||||
result = CompletionPhase.noSuggestionsHint;
|
||||
result = CompletionPhase.NoSuggestionsHint;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,15 +19,15 @@ package com.intellij.codeInsight.completion;
|
||||
* @author peter
|
||||
*/
|
||||
public enum CompletionPhase {
|
||||
noCompletion,
|
||||
autoPopupAlarm,
|
||||
synchronous,
|
||||
bgCalculation,
|
||||
itemsCalculated,
|
||||
restarted,
|
||||
insertedSingleItem,
|
||||
noSuggestionsHint,
|
||||
possiblyDisturbingAutoPopup,
|
||||
emptyAutoPopup,
|
||||
NoCompletion,
|
||||
AutoPopupAlarm,
|
||||
Synchronous,
|
||||
BgCalculation,
|
||||
ItemsCalculated,
|
||||
Restarted,
|
||||
InsertedSingleItem,
|
||||
NoSuggestionsHint,
|
||||
PossiblyDisturbingAutoPopup,
|
||||
EmptyAutoPopup,
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -146,7 +146,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
}
|
||||
|
||||
void notifyBackgrounded() {
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.bgCalculation);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.BgCalculation);
|
||||
myState.setBackgrounded();
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
Disposer.dispose(myQueue);
|
||||
unregisterItself(false);
|
||||
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.noCompletion);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@@ -495,9 +495,9 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
|
||||
private void unregisterItself(boolean afterDeath) {
|
||||
if (afterDeath) {
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.noSuggestionsHint, CompletionPhase.insertedSingleItem);
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.NoSuggestionsHint, CompletionPhase.InsertedSingleItem);
|
||||
} else {
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.bgCalculation, CompletionPhase.itemsCalculated, CompletionPhase.synchronous, CompletionPhase.restarted);
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.BgCalculation, CompletionPhase.ItemsCalculated, CompletionPhase.Synchronous, CompletionPhase.Restarted);
|
||||
}
|
||||
|
||||
myState.handleDeath(afterDeath);
|
||||
@@ -533,7 +533,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
if (!isAutopopupCompletion()) {
|
||||
CompletionServiceImpl.setCompletionPhase(myHandler.handleEmptyLookup(getProject(), myEditor, myParameters, CompletionProgressIndicator.this));
|
||||
} else {
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.noCompletion);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -541,7 +541,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
myLookup.setFocused(true);
|
||||
}
|
||||
updateLookup();
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.itemsCalculated);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.ItemsCalculated);
|
||||
}
|
||||
}
|
||||
}, myQueue.getModalityState());
|
||||
@@ -554,7 +554,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
if (items.isEmpty() && !myLookup.isCalculating()) {
|
||||
myLookup.hideLookup(false);
|
||||
LOG.assertTrue(CompletionServiceImpl.getCompletionService().getCurrentCompletion() == null);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.emptyAutoPopup);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.EmptyAutoPopup);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
if ((item.getPrefixMatcher().getPrefix() + myLookup.getAdditionalPrefix()).equals(item.getLookupString())) {
|
||||
myLookup.hideLookup(true); // so that the autopopup attempts to restart after the next typed character
|
||||
LOG.assertTrue(CompletionServiceImpl.getCompletionService().getCurrentCompletion() == null);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.possiblyDisturbingAutoPopup);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.PossiblyDisturbingAutoPopup);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -690,7 +690,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
public void scheduleRestart() {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
myState.scheduleRestart();
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.restarted);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.Restarted);
|
||||
|
||||
final Project project = getProject();
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@@ -699,7 +699,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
if (isOutdated()) {
|
||||
return;
|
||||
}
|
||||
if (CompletionServiceImpl.getCompletionPhase() != CompletionPhase.restarted) {
|
||||
if (CompletionServiceImpl.getCompletionPhase() != CompletionPhase.Restarted) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.impl.CompletionServiceImpl");
|
||||
private Throwable myTrace = null;
|
||||
private CompletionProgressIndicator myCurrentCompletion;
|
||||
private static CompletionPhase ourPhase = CompletionPhase.noCompletion;
|
||||
private static CompletionPhase ourPhase = CompletionPhase.NoCompletion;
|
||||
private static String ourPhaseTrace;
|
||||
|
||||
public static CompletionServiceImpl getCompletionService() {
|
||||
|
||||
+5
-5
@@ -94,12 +94,12 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate {
|
||||
|
||||
final boolean isMainEditor = FileEditorManager.getInstance(project).getSelectedTextEditor() == editor;
|
||||
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.autoPopupAlarm);
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.AutoPopupAlarm);
|
||||
|
||||
final Runnable request = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (CompletionServiceImpl.getCompletionPhase() != CompletionPhase.autoPopupAlarm) return;
|
||||
if (CompletionServiceImpl.getCompletionPhase() != CompletionPhase.AutoPopupAlarm) return;
|
||||
|
||||
if (project.isDisposed() || !file.isValid()) return;
|
||||
if (editor.isDisposed() || isMainEditor && FileEditorManager.getInstance(project).getSelectedTextEditor() != editor) return;
|
||||
@@ -157,14 +157,14 @@ public class CompletionAutoPopupHandler extends TypedHandlerDelegate {
|
||||
}
|
||||
|
||||
final CompletionProgressIndicator currentCompletion = CompletionServiceImpl.getCompletionService().getCurrentCompletion();
|
||||
if (CompletionServiceImpl.isPhase(CompletionPhase.autoPopupAlarm, CompletionPhase.emptyAutoPopup, CompletionPhase.possiblyDisturbingAutoPopup)) {
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.noCompletion);
|
||||
if (CompletionServiceImpl.isPhase(CompletionPhase.AutoPopupAlarm, CompletionPhase.EmptyAutoPopup, CompletionPhase.PossiblyDisturbingAutoPopup)) {
|
||||
CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
|
||||
assert currentCompletion == null;
|
||||
} else {
|
||||
if (currentCompletion != null) {
|
||||
currentCompletion.closeAndFinish(true);
|
||||
}
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.noCompletion);
|
||||
CompletionServiceImpl.assertPhase(CompletionPhase.NoCompletion);
|
||||
}
|
||||
|
||||
state.stopAutoPopup();
|
||||
|
||||
Reference in New Issue
Block a user