protected void testSingleParams(Object params, String expectedString, Predicate<String> predicate) throws Exception { LogMessageAccumulator logMessages = null; try { if (predicate != null) { logMessages = new LogMessageAccumulator(); logMessages.registerTo(GenericEndpoint.class); } GenericEndpoint endpoint = new GenericEndpoint(new Object() { @JsonRequest public CompletableFuture<String> getStringValue(String stringValue) { return CompletableFuture.completedFuture(stringValue); } }); Assert.assertEquals(expectedString, endpoint.request("getStringValue", params).get()); if (predicate != null) { logMessages.await(r -> Level.WARNING == r.getLevel() && predicate.test(r.getMessage())); } } finally { if (logMessages != null) { logMessages.unregister(); } } }
@JsonRequest CompletableFuture<Capabilities> initialize(InitializeRequestArguments param);
@JsonRequest CompletableFuture<DisconnectResponse> disconnect(DisconnectArguments disconnectArguments);
@JsonRequest CompletableFuture<SetBreakpointsResponse.Body> setBreakpoints(SetBreakpointsArguments setBreakpointsArgs);
@JsonRequest CompletableFuture<SetFunctionBreakpointsResponse.Body> setFunctionBreakpoints( SetFunctionBreakpointsArguments setFunctionBreakpointsArgs);
@JsonRequest CompletableFuture<Void> launch(Either<Map<String, Object>, LaunchRequestArguments> launchArguments);
@JsonRequest CompletableFuture<Void> configurationDone();
@JsonRequest CompletableFuture<ThreadsResponse.Body> threads();
@JsonRequest CompletableFuture<VariablesResponse.Body> variables(VariablesArguments variablesArguments);
@JsonRequest CompletableFuture<Void> next(NextArguments nextArguments);
@JsonRequest CompletableFuture<Void> stepIn(StepInArguments stepInArguments);
@JsonRequest CompletableFuture<Void> stepOut(StepOutArguments stepOutArguments);
@JsonRequest(value = "continue") CompletableFuture<ContinueResponse.Body> continue_(ContinueArguments arguments);
@JsonRequest CompletableFuture<StackTraceResponse.Body> stackTrace(StackTraceArguments stackTraceArguments);
@JsonRequest CompletableFuture<ScopesResponse.Body> scopes(ScopesArguments scopesArguments);
@JsonRequest CompletableFuture<MyParam> askServer(MyParam param);
@JsonRequest CompletableFuture<MyParam> askClient(MyParam param);
/** * The workspace/applyEdit request is sent from the server to the client to modify resource on the client side. */ @JsonRequest("workspace/applyEdit") default CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEditParams params) { throw new UnsupportedOperationException(); }
/** * The client/unregisterCapability request is sent from the server to the client * to unregister a previously register capability. */ @JsonRequest("client/unregisterCapability") default CompletableFuture<Void> unregisterCapability(UnregistrationParams params) { throw new UnsupportedOperationException(); }
/** * The document link resolve request is sent from the client to the server to resolve the target of a given document link. */ @JsonRequest(value="documentLink/resolve", useSegment = false) default CompletableFuture<DocumentLink> documentLinkResolve(DocumentLink params) { throw new UnsupportedOperationException(); }
@JsonRequest CompletableFuture<String> classFileContents(TextDocumentIdentifier documentUri);
@JsonRequest CompletableFuture<BuildWorkspaceStatus> buildWorkspace(boolean forceReBuild);
@JsonRequest public abstract CompletableFuture<TestLangLSPExtension.TextOfLineResult> getTextOfLine(final TestLangLSPExtension.TextOfLineParam param);
@JsonRequest public CompletableFuture<String> doStuff(String arg);
@JsonRequest public CompletableFuture<String> doStuff(String arg, Integer arg2);
@JsonRequest CompletableFuture<Void> renameFile(RenameFileParams params);
/** * The hover request is sent from the client to the server to request hover * information at a given text document position. * * Registration Options: TextDocumentRegistrationOptions */ @JsonRequest CompletableFuture<Hover> hover(TextDocumentPositionParams position);
/** * The initialize request is sent as the first request from the client to * the server. * * If the server receives request or notification before the initialize request it should act as follows: * - for a request the respond should be errored with code: -32001. The message can be picked by the server. * - notifications should be dropped, except for the exit notification. This will allow the exit a server without an initialize request. * * Until the server has responded to the initialize request with an InitializeResult * the client must not sent any additional requests or notifications to the server. * * During the initialize request the server is allowed to sent the notifications window/showMessage, * window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client. */ @JsonRequest CompletableFuture<InitializeResult> initialize(InitializeParams params);
/** * The client/registerCapability request is sent from the server to the client * to register for a new capability on the client side. * Not all clients need to support dynamic capability registration. * A client opts in via the ClientCapabilities.dynamicRegistration property */ @JsonRequest("client/registerCapability") default CompletableFuture<Void> registerCapability(RegistrationParams params) { throw new UnsupportedOperationException(); }
/** * The show message request is sent from a server to a client to ask the * client to display a particular message in the user interface. In addition * to the show message notification the request allows to pass actions and * to wait for an answer from the client. */ @JsonRequest("window/showMessageRequest") CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams);
/** * The workspace/workspaceFolders request is sent from the server to the client * to fetch the current open list of workspace folders. * * This API is a <b>proposal</b> from LSP and may change. * * @return null in the response if only a single file is open in the tool, * an empty array if a workspace is open but no folders are configured, * the workspace folders otherwise. */ @Beta @JsonRequest("workspace/workspaceFolders") default CompletableFuture<List<WorkspaceFolder>> workspaceFolders() { return CompletableFuture.completedFuture(Collections.emptyList()); }
/** * The shutdown request is sent from the client to the server. It asks the * server to shutdown, but to not exit (otherwise the response might not be * delivered correctly to the client). There is a separate exit notification * that asks the server to exit. */ @JsonRequest CompletableFuture<Object> shutdown();