Search in sources :

Example 1 with CompletionResolveHandler

use of org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler in project eclipse.jdt.ls by eclipse.

the class SyntaxLanguageServer method resolveCompletionItem.

/* (non-Javadoc)
	 * @see org.eclipse.lsp4j.services.TextDocumentService#resolveCompletionItem(org.eclipse.lsp4j.CompletionItem)
	 */
@Override
public CompletableFuture<CompletionItem> resolveCompletionItem(CompletionItem unresolved) {
    logInfo(">> document/resolveCompletionItem");
    CompletionResolveHandler handler = new CompletionResolveHandler(preferenceManager);
    final IProgressMonitor[] monitors = new IProgressMonitor[1];
    CompletableFuture<CompletionItem> result = computeAsync((monitor) -> {
        monitors[0] = monitor;
        if ((Boolean.getBoolean(JAVA_LSP_JOIN_ON_COMPLETION))) {
            waitForLifecycleJobs(monitor);
        }
        return handler.resolve(unresolved, monitor);
    });
    result.join();
    if (monitors[0].isCanceled()) {
        result.cancel(true);
    }
    return result;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) CompletionItem(org.eclipse.lsp4j.CompletionItem) CompletionResolveHandler(org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 CompletionResolveHandler (org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler)1 CompletionItem (org.eclipse.lsp4j.CompletionItem)1