下面列出了怎么用org.eclipse.lsp4j.jsonrpc.services.JsonNotification的API类实例代码及写法,或者点击链接到github查看源代码。
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("process")
void process(ActionMessage message);
@JsonNotification("process")
void process(ActionMessage message);
@JsonNotification("exit")
void exit(String clientId);
@JsonNotification("build/initialized")
void onBuildInitialized();
@JsonNotification("build/exit")
void onBuildExit();
@JsonNotification("build/showMessage")
void onBuildShowMessage(ShowMessageParams params);
@JsonNotification("build/logMessage")
void onBuildLogMessage(LogMessageParams params);
@JsonNotification("build/taskStart")
void onBuildTaskStart(TaskStartParams params);
@JsonNotification("build/taskProgress")
void onBuildTaskProgress(TaskProgressParams params);
@JsonNotification("build/taskFinish")
void onBuildTaskFinish(TaskFinishParams params);
@JsonNotification("build/publishDiagnostics")
void onBuildPublishDiagnostics(PublishDiagnosticsParams params);
@JsonNotification("buildTarget/didChange")
void onBuildTargetDidChange(DidChangeBuildTarget params);
@JsonNotification("language/status")
public void languageStatus(Map<Object, Object> data) {
LOGGER.info("[{}] {}", data.get("type"), data.get("message"));
}
@JsonNotification("java/didChangeWorkspaceFolders")
public void didChangeWorkspaceFolders(Object object) {
LOGGER.info("[didChangeWorkspaceFolders] {}", object);
}
@JsonNotification("workspace/notify")
void sendNotification(ExecuteCommandParams params);
@JsonNotification("as3mxml/clearCompilerShellOutput")
void clearCompilerShellOutput();
@JsonNotification("as3mxml/logCompilerShellOutput")
void logCompilerShellOutput(String message);
@JsonNotification("$/setTraceNotification")
public void setTraceNotification(Object params)
{
//this may be ignored. see: eclipse/lsp4j#22
}
@JsonNotification
void buildHappened(BuildNotification notification);
@JsonNotification("client/notify")
void notify(String arg);
@JsonNotification("server/notify")
void notify(String arg);
@JsonNotification
void myNotification();
/**
* The event indicates that the debuggee has exited and returns its exit code.
*/
@JsonNotification
default void exited(ExitedEventArguments args) {
}
/**
* The event indicates that a thread has started or exited.
*/
@JsonNotification
default void thread(ThreadEventArguments args) {
}
/**
* The event indicates that the target has produced some output.
*/
@JsonNotification
default void output(OutputEventArguments args) {
}
/**
* The event indicates that some information about a breakpoint has changed.
*/
@JsonNotification
default void breakpoint(BreakpointEventArguments args) {
}
/**
* The event indicates that some information about a module has changed.
*/
@JsonNotification
default void module(ModuleEventArguments args) {
}
@JsonNotification
void myNotification();
@JsonNotification
public void say(Param p);