下面列出了怎么用org.eclipse.lsp4j.ImplementationParams的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public CompletableFuture<Either<List<? extends Location>, List<? extends LocationLink>>> implementation(ImplementationParams position) {
logInfo(">> document/implementation");
return computeAsyncWithClientProgress((monitor) -> {
ImplementationsHandler handler = new ImplementationsHandler(preferenceManager);
return Either.forLeft(handler.findImplementations(position, monitor));
});
}
/**
* Finds all implemenations of an interface.
*/
@Override
public CompletableFuture<Either<List<? extends Location>, List<? extends LocationLink>>> implementation(ImplementationParams params)
{
return CompletableFutures.computeAsync(compilerWorkspace.getExecutorService(), cancelToken ->
{
cancelToken.checkCanceled();
//make sure that the latest changes have been passed to
//workspace.fileChanged() before proceeding
if(realTimeProblemsChecker != null)
{
realTimeProblemsChecker.updateNow();
}
compilerWorkspace.startBuilding();
try
{
ImplementationProvider provider = new ImplementationProvider(workspaceFolderManager, fileTracker);
return provider.implementation(params, cancelToken);
}
finally
{
compilerWorkspace.doneBuilding();
}
});
}
/**
* The goto implementation request is sent from the client to the server to resolve
* the implementation location of a symbol at a given text document position.
*
* Registration Options: TextDocumentRegistrationOptions
*
* Since version 3.6.0
*/
@JsonRequest
@ResponseJsonAdapter(LocationLinkListAdapter.class)
default CompletableFuture<Either<List<? extends Location>, List<? extends LocationLink>>> implementation(ImplementationParams params) {
throw new UnsupportedOperationException();
}