@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()); }); }
public ResultConfiguratorFromOne<String> paramsAsString() { LOGGER.debug( "Configuring incoming request params: " + "method: " + method + ", " + "params object class: " + String.class); return new ResultConfiguratorFromOne<>(requestHandlerManager, method, String.class); }
@Inject private void configureTestDetectionHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(Constants.TESTING_RPC_TEST_DETECTION_NAME) .paramsAsDto(TestDetectionContext.class) .resultAsDto(TestDetectionResult.class) .withBiFunction(this::handleTestDetection); }
.methodName("textDocument/fileContent") .paramsAsString() .resultAsString() .withFunction(this::getFileContent); .methodName("textDocument/snippets") .paramsAsDto(SnippetParameters.class) .resultAsListOfDto(SnippetResult.class) .withFunction(this::getSnippets);
@PostConstruct public void configureMethods() { requestHandler .newConfiguration() .methodName("workspace/symbol") .paramsAsDto(ExtendedWorkspaceSymbolParams.class) .resultAsListOfDto(SymbolInformationDto.class) .withFunction(this::symbol); requestHandler .newConfiguration() .methodName("workspace/editFile") .paramsAsDto(FileEditParams.class) .resultAsListOfDto(TextEditDto.class) .withFunction(this::editFile); }
@Inject private void configureRunTestHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(Constants.RUN_TESTS_METHOD) .paramsAsDto(TestExecutionContext.class) .resultAsDto(TestLaunchResult.class) .withBiFunction(this::runTests); }
private <P, R> void dtoToDtoList( String name, Class<P> pClass, Class<R> rClass, Function<P, List<R>> function) { requestHandler .newConfiguration() .methodName("textDocument/" + name) .paramsAsDto(pClass) .resultAsListOfDto(rClass) .withFunction(function); }
@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()); }); }
private <P, R> void dtoToDto( String name, Class<P> pClass, Class<R> rClass, Function<P, R> function) { requestHandler .newConfiguration() .methodName("textDocument/" + name) .paramsAsDto(pClass) .resultAsDto(rClass) .withFunction(function); }
public ResultConfiguratorFromOne<Double> paramsAsDouble() { LOGGER.debug( "Configuring incoming request params: " + "method: " + method + ", " + "params object class: " + Double.class); return new ResultConfiguratorFromOne<>(requestHandlerManager, method, Double.class); }
private void handleProgressesReports() { configurator .newConfiguration() .methodName(PROGRESS_REPORT_METHOD) .paramsAsDto(ProgressReport.class) .noResult() .withConsumer( progressNotification -> progressReportConsumers.forEach(it -> it.accept(progressNotification))); } }
@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); }
public ResultConfiguratorFromOne<Boolean> paramsAsBoolean() { LOGGER.debug( "Configuring incoming request params: " + "method: " + method + ", " + "params object class: " + Boolean.class); return new ResultConfiguratorFromOne<>(requestHandlerManager, method, Boolean.class); } }
@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); }); }
public <P> ResultConfiguratorFromOne<P> paramsAsDto(Class<P> pClass) { checkNotNull(pClass, "Params class must not be null"); LOGGER.debug( "Configuring incoming request params: " + "method: " + method + ", " + "params object class: " + pClass); return new ResultConfiguratorFromOne<>(requestHandlerManager, method, pClass); }
@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("connected") .paramsAsDto(ConnectedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event/project-tree-state-changed") .paramsAsDto(ProjectTreeStateUpdateDto.class) .noResult() .withConsumer(projectTreeChangeHandler::handleFileChange); } }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_started") .paramsAsDto(ProcessStartedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_died") .paramsAsDto(ProcessDiedEventDto.class) .noResult() .withBiConsumer(this); }