protected void testZeroParams(Object params, 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() { @JsonNotification public void myNotification() { } }); endpoint.notify("myNotification", params); if (predicate != null) { logMessages.await(r -> Level.WARNING == r.getLevel() && predicate.test(r.getMessage())); } } finally { if (logMessages != null) { logMessages.unregister(); } } }
@JsonNotification default void initialized() { System.out.println("initialized"); }
@JsonNotification default void output(OutputEvent.Body body) { System.out.println("output body" + body.output); }
@JsonNotification void myNotification();
@JsonNotification public abstract void buildHappened(final TestLangLSPExtension.BuildNotification notification);
@JsonNotification public void myNotification(String someArg);
@JsonNotification("hubba") public void myNotification(String someArg);
@JsonNotification public void myNotification(String someArg, Integer someArg2);
@JsonNotification("hubba") public void myNotification(String someArg, Integer someArg2);
@JsonNotification @Override void accept(String message);
@JsonNotification public void myNotification();
@JsonNotification(value = "json/schemaAssociations", useSegment = false) void yamlSchemaAssociation(Map<String, String[]> associations);
@JsonNotification(value = "json/schemaAssociations", useSegment = false) void jsonSchemaAssociation(Map<String, String[]> associations);
@JsonNotification("workspace/didChangeWatchedFiles") void didChangeWatchedFiles(DidChangeWatchedFilesParams params);
/** * Called by the debug adapter when a stopped event is issued. * * @param body * contains the reason for the stopped event */ @JsonNotification default void stopped(StoppedEvent.Body body) { System.out.println("stopped: " + body); }
/** * Called by the debug adapter when a continued event is issued. * * @param body * contains the thread id of the continued thread */ @JsonNotification default void continued(ContinuedEvent.Body body) { System.out.println("continued: " + body); }
/** * Called by the debug adapter when a terminate event is issued. * * @param body * contains the restart flag */ @JsonNotification default void terminated(TerminatedEvent.Body body) { System.out.println("terminated: " + body); }
/** * The telemetry notification is sent from the server to the client to ask * the client to log a telemetry event. */ @JsonNotification("telemetry/event") void telemetryEvent(Object object);
/** * Diagnostics notifications are sent from the server to the client to * signal results of validation runs. */ @JsonNotification("textDocument/publishDiagnostics") void publishDiagnostics(PublishDiagnosticsParams diagnostics);
/** * The show message notification is sent from a server to a client to ask * the client to display a particular message in the user interface. */ @JsonNotification("window/showMessage") void showMessage(MessageParams messageParams);
/** * The log message notification is send from the server to the client to ask * the client to log a particular message. */ @JsonNotification("window/logMessage") void logMessage(MessageParams message);
/** * The initialized notification is sent from the client to the server after * the client received the result of the initialize request but before the * client is sending any other request or notification to the server. The * server can use the initialized notification for example to dynamically * register capabilities. */ @JsonNotification default void initialized(InitializedParams params) { initialized(); }
/** * A notification to ask the server to exit its process. */ @JsonNotification void exit();
/** * The document open notification is sent from the client to the server to * signal newly opened text documents. The document's truth is now managed * by the client and the server must not try to read the document's truth * using the document's uri. * * Registration Options: TextDocumentRegistrationOptions */ @JsonNotification void didOpen(DidOpenTextDocumentParams params);
/** * The document change notification is sent from the client to the server to * signal changes to a text document. * * Registration Options: TextDocumentChangeRegistrationOptions */ @JsonNotification void didChange(DidChangeTextDocumentParams params);
/** * The document close notification is sent from the client to the server * when the document got closed in the client. The document's truth now * exists where the document's uri points to (e.g. if the document's uri is * a file uri the truth now exists on disk). * * Registration Options: TextDocumentRegistrationOptions */ @JsonNotification void didClose(DidCloseTextDocumentParams params);
/** * The document save notification is sent from the client to the server when * the document for saved in the client. * * Registration Options: TextDocumentSaveRegistrationOptions */ @JsonNotification void didSave(DidSaveTextDocumentParams params);
/** * The document will save notification is sent from the client to the server before the document is actually saved. * * Registration Options: TextDocumentRegistrationOptions */ @JsonNotification default void willSave(WillSaveTextDocumentParams params) { }
/** * Pushes the {@link ColoringParams coloring parameter} to the client. * * @param params * the information that should be pushed to the client side for * coloring purposes. Must not be {@code null}. */ @JsonNotification("textDocument/updateColoring") void updateColoring(ColoringParams params);
/** * A notification sent from the client to the server to signal the change of * configuration settings. */ @JsonNotification void didChangeConfiguration(DidChangeConfigurationParams params);
/** * The watched files notification is sent from the client to the server when * the client detects changes to file watched by the language client. */ @JsonNotification void didChangeWatchedFiles(DidChangeWatchedFilesParams params);
/** * The workspace/didChangeWorkspaceFolders notification is sent from the client * to the server to inform the server about workspace folder configuration changes. * The notification is sent by default if both ServerCapabilities/workspaceFolders * and ClientCapabilities/workspace/workspaceFolders are true; or if the server has * registered to receive this notification it first. * * This API is a <b>proposal</b> from LSP and may change. */ @JsonNotification @Beta default void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {}
/** * Request a project configuration update * @param documentUri the document from which the project configuration will be updated */ @JsonNotification void projectConfigurationUpdate(TextDocumentIdentifier documentUri);
/** * The workspace/didChangeWorkspaceFolders notification is sent from the client * to the server to inform the client about workspace folder configuration * changes. * * @param documentUri * the document from which the project configuration will be updated */ @JsonNotification void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params);
/** * The show message notification is sent from a server to a client to ask * the client to display a particular message in the user interface. */ @JsonNotification("language/status") void sendStatusReport(StatusReport report);
/** * The actionable notification is sent from a server to a client to ask * the client to display a particular message in the user interface, and possible * commands to execute. The commands must be implemented on the client side. */ @JsonNotification("language/actionableNotification") void sendActionableNotification(ActionableNotification notification);