Search in sources :

Example 1 with HoverBinaryRequest

use of com.tabnine.binary.requests.notifications.HoverBinaryRequest in project tabnine-intellij by codota.

the class LimitExceededLookupElement method handleInlayCreation.

private void handleInlayCreation(AtomicReference<Inlay> inlayHolder, AtomicBoolean documentChanged, Editor editor, int inlayOffset) {
    // get the inlay and hover popup data
    HoverBinaryResponse hoverBinaryResponse = this.binaryRequestFacade.executeRequest(new HoverBinaryRequest());
    if (hoverBinaryResponse == null || hoverBinaryResponse.getTitle() == null || documentChanged.get()) {
        return;
    }
    // inlay must be added from UI thread
    ApplicationManager.getApplication().invokeLater(() -> {
        try {
            addInlay(editor, inlayOffset, inlayHolder, documentChanged, hoverBinaryResponse);
        } catch (Exception e) {
            if (e instanceof ControlFlowException) {
                throw e;
            }
            Logger.getInstance(getClass()).warn("Error adding locked item inlay.", e);
        }
    });
}
Also used : ControlFlowException(com.intellij.openapi.diagnostic.ControlFlowException) HoverBinaryRequest(com.tabnine.binary.requests.notifications.HoverBinaryRequest) ControlFlowException(com.intellij.openapi.diagnostic.ControlFlowException) HoverBinaryResponse(com.tabnine.binary.requests.notifications.HoverBinaryResponse)

Aggregations

ControlFlowException (com.intellij.openapi.diagnostic.ControlFlowException)1 HoverBinaryRequest (com.tabnine.binary.requests.notifications.HoverBinaryRequest)1 HoverBinaryResponse (com.tabnine.binary.requests.notifications.HoverBinaryResponse)1