another place in parameter info to use async commit

This commit is contained in:
peter
2016-04-07 16:18:16 +02:00
parent 90ebb4e467
commit f3a8897763
@@ -36,7 +36,6 @@ import com.intellij.openapi.application.TransactionId;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Key;
@@ -178,22 +177,14 @@ public class AutoPopupController implements Disposable {
}
final PsiFile file1 = file;
final Runnable request = new Runnable(){
@Override
public void run(){
if (myProject.isDisposed() || DumbService.isDumb(myProject)) return;
documentManager.commitAllDocuments();
if (editor.isDisposed() || !editor.getComponent().isShowing()) return;
Runnable request = () -> {
if (!myProject.isDisposed() && !DumbService.isDumb(myProject) && !editor.isDisposed() && editor.getComponent().isShowing()) {
int lbraceOffset = editor.getCaretModel().getOffset() - 1;
try {
ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false);
}
catch (IndexNotReadyException ignored) { //anything can happen on alarm
}
ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false);
}
};
addRequest(request, settings.PARAMETER_INFO_DELAY);
addRequest(() -> documentManager.performLaterWhenAllCommitted(request), settings.PARAMETER_INFO_DELAY);
}
}