private void handleProgressesReports() { configurator .newConfiguration() .methodName(PROGRESS_REPORT_METHOD) .paramsAsDto(ProgressReport.class) .noResult() .withConsumer( progressNotification -> progressReportConsumers.forEach(it -> it.accept(progressNotification))); } }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(EVENT_DEBUGGER_UN_SUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::remove); } }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:ws-agent-output:un-subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceId) -> { endpointIds.getOrDefault(endpointId, emptySet()).remove(workspaceId); endpointIds.entrySet().removeIf(entry -> entry.getValue().isEmpty()); }); }
@PostConstruct private void configureMethodHandlers() { configurator .newConfiguration() .methodName("languageServer/initialize") .paramsAsString() .resultAsDto(ServerCapabilitiesDto.class) .withFunction(this::initialize); configurator .newConfiguration() .methodName("languageServer/getLanguageRegexes") .noParams() .resultAsListOfDto(LanguageRegexDto.class) .withSupplier(this::getLanguageRegexes); }
.newConfiguration() .methodName("textDocument/fileContent") .paramsAsString() .resultAsString() .withFunction(this::getFileContent); .newConfiguration() .methodName("textDocument/snippets") .paramsAsDto(SnippetParameters.class) .resultAsListOfDto(SnippetResult.class) .withFunction(this::getSnippets);
@Inject private void configureHandlers(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(EXCLUDES_CHANGED) .paramsAsListOfString() .noResult() .withConsumer( newExcludes -> { excludes.clear(); excludes.addAll(newExcludes); }); configurator .newConfiguration() .methodName(EXCLUDES_CLEAN_UP) .noParams() .noResult() .withConsumer(s -> excludes.clear()); }
public ParamsConfigurator methodName(String name) { checkNotNull(name, "Method name must not be null"); checkArgument(!name.isEmpty(), "Method name must not be empty"); LOGGER.debug("Configuring incoming request method name name: " + name); return new ParamsConfigurator(requestHandlerManager, name); } }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("git/checkoutOutput/subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdAndProjectName) -> { endpointIdsWithWorkspaceIdAndProjectName.putIfAbsent( endpointId, newConcurrentHashSet()); endpointIdsWithWorkspaceIdAndProjectName .get(endpointId) .add(workspaceIdAndProjectName); }); configurator .newConfiguration() .methodName("event/git/subscribe") .noParams() .noResult() .withConsumer(endpointIds::add); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("connected") .paramsAsDto(ConnectedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(INCOMING_METHOD) .noParams() .noResult() .withConsumer(endpointIds::add); }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:environment-output:un-subscribe-by-machine-name") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdPlusMachineName) -> { endpointIds.getOrDefault(endpointId, emptySet()).remove(workspaceIdPlusMachineName); endpointIds.entrySet().removeIf(entry -> entry.getValue().isEmpty()); }); }
@Inject private void configureTestDetectionHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(Constants.TESTING_RPC_TEST_DETECTION_NAME) .paramsAsDto(TestDetectionContext.class) .resultAsDto(TestDetectionResult.class) .withBiFunction(this::handleTestDetection); }
@Inject private void configureHandler(RequestHandlerConfigurator requestHandlerConfigurator) { requestHandlerConfigurator .newConfiguration() .methodName("websocketIdService/getId") .noParams() .resultAsString() .withFunction(this::extractClientId); }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:ws-agent-output:subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceId) -> { endpointIds.putIfAbsent(endpointId, newConcurrentHashSet()); endpointIds.get(endpointId).add(workspaceId); }); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_started") .paramsAsDto(ProcessStartedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject private void configureHandlers(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(WORKSPACE_SYNCHRONIZE_METHOD_NAME) .noParams() .noResult() .withConsumer(this::updateProjects); }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:environment-output:subscribe-by-machine-name") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdPlusMachineName) -> { endpointIds.putIfAbsent(endpointId, newConcurrentHashSet()); endpointIds.get(endpointId).add(workspaceIdPlusMachineName); }); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_died") .paramsAsDto(ProcessDiedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator requestHandler) { requestHandler .newConfiguration() .methodName("window/showMessage/unsubscribe") .noParams() .noResult() .withConsumer(endpointIds::remove); }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("git/checkoutOutput/unsubscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdAndProjectName) -> { endpointIdsWithWorkspaceIdAndProjectName .getOrDefault(endpointId, newConcurrentHashSet()) .remove(workspaceIdAndProjectName); endpointIdsWithWorkspaceIdAndProjectName.computeIfPresent( endpointId, (key, value) -> value.isEmpty() ? null : value); }); } }