use of org.eclipse.lsp4j.Unregistration in project xtext-core by eclipse.
the class CommandRegistryTest method unregisterCapability.
@Override
public CompletableFuture<Void> unregisterCapability(final UnregistrationParams params) {
final Unregistration unreg = IterableExtensions.<Unregistration>head(params.getUnregisterations());
this.registered.remove(unreg);
return CompletableFuture.<Void>completedFuture(null);
}
use of org.eclipse.lsp4j.Unregistration in project xtext-core by eclipse.
the class ExecutableCommandRegistry method register.
protected IDisposable register(final String command, final IExecutableCommandService service) {
final String requestId = UUID.randomUUID().toString();
Registration _registration = new Registration();
final Procedure1<Registration> _function = (Registration it) -> {
it.setId(requestId);
it.setMethod(ExecutableCommandRegistry.METHOD);
ExecuteCommandOptions _executeCommandOptions = new ExecuteCommandOptions();
final Procedure1<ExecuteCommandOptions> _function_1 = (ExecuteCommandOptions it_1) -> {
it_1.setCommands(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(command)));
};
ExecuteCommandOptions _doubleArrow = ObjectExtensions.<ExecuteCommandOptions>operator_doubleArrow(_executeCommandOptions, _function_1);
it.setRegisterOptions(_doubleArrow);
};
final Registration reg = ObjectExtensions.<Registration>operator_doubleArrow(_registration, _function);
RegistrationParams _registrationParams = new RegistrationParams();
final Procedure1<RegistrationParams> _function_1 = (RegistrationParams it) -> {
it.setRegistrations(CollectionLiterals.<Registration>newArrayList(reg));
};
RegistrationParams _doubleArrow = ObjectExtensions.<RegistrationParams>operator_doubleArrow(_registrationParams, _function_1);
this.client.registerCapability(_doubleArrow);
this.registeredCommands.put(command, service);
final IDisposable _function_2 = () -> {
Unregistration _unregistration = new Unregistration();
final Procedure1<Unregistration> _function_3 = (Unregistration it) -> {
it.setId(requestId);
it.setMethod(ExecutableCommandRegistry.METHOD);
};
final Unregistration unReg = ObjectExtensions.<Unregistration>operator_doubleArrow(_unregistration, _function_3);
UnregistrationParams _unregistrationParams = new UnregistrationParams();
final Procedure1<UnregistrationParams> _function_4 = (UnregistrationParams it) -> {
it.setUnregisterations(CollectionLiterals.<Unregistration>newArrayList(unReg));
};
UnregistrationParams _doubleArrow_1 = ObjectExtensions.<UnregistrationParams>operator_doubleArrow(_unregistrationParams, _function_4);
this.client.unregisterCapability(_doubleArrow_1);
this.registeredCommands.remove(command, service);
};
return _function_2;
}
Aggregations