From 1470d748e556476369dfaf6a77cb32efddb764be Mon Sep 17 00:00:00 2001 From: Vladimir Piskarev Date: Mon, 12 Apr 2021 17:01:33 +0300 Subject: [PATCH] Move LanguageClient.setTrace method to LanguageServer (#545) Fixes #544 --- CHANGELOG.md | 5 +++++ .../org/eclipse/lsp4j/services/LanguageClient.java | 11 ----------- .../org/eclipse/lsp4j/services/LanguageServer.java | 12 +++++++++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e640af..716c9657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Fixed issues: +Breaking API changes: + + * Method `LanguageClient.setTrace` moved to `LanguageServer`, where it should + have been according to the specification + ### v0.12.0 (Apr. 2021) * Restored `org.eclipse.lsp4j.websocket` which will be included along with `org.eclipse.lsp4j.websocket.jakarta`. This will allow use of LSP4J diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageClient.java b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageClient.java index c06c213a..2d0d5d73 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageClient.java +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageClient.java @@ -23,7 +23,6 @@ import org.eclipse.lsp4j.ProgressParams; import org.eclipse.lsp4j.PublishDiagnosticsParams; import org.eclipse.lsp4j.RegistrationParams; -import org.eclipse.lsp4j.SetTraceParams; import org.eclipse.lsp4j.ShowDocumentParams; import org.eclipse.lsp4j.ShowDocumentResult; import org.eclipse.lsp4j.ShowMessageRequestParams; @@ -178,16 +177,6 @@ default void logTrace(LogTraceParams params) { throw new UnsupportedOperationException(); } - /** - * A notification that should be used by the client to modify the trace setting of the server. - * - * Since 3.16.0 - */ - @JsonNotification("$/setTrace") - default void setTrace(SetTraceParams params) { - throw new UnsupportedOperationException(); - } - /** * The `workspace/semanticTokens/refresh` request is sent from the server to the client. * Servers can use it to ask clients to refresh the editors for which this server diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageServer.java b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageServer.java index b484f6c6..76486fd3 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageServer.java +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/services/LanguageServer.java @@ -16,6 +16,7 @@ import org.eclipse.lsp4j.InitializeParams; import org.eclipse.lsp4j.InitializeResult; import org.eclipse.lsp4j.InitializedParams; +import org.eclipse.lsp4j.SetTraceParams; import org.eclipse.lsp4j.WorkDoneProgressCancelParams; import org.eclipse.lsp4j.jsonrpc.services.JsonDelegate; import org.eclipse.lsp4j.jsonrpc.services.JsonNotification; @@ -95,5 +96,14 @@ default void initialized() { default void cancelProgress(WorkDoneProgressCancelParams params) { throw new UnsupportedOperationException(); } - + + /** + * A notification that should be used by the client to modify the trace setting of the server. + * + * Since 3.16.0 + */ + @JsonNotification("$/setTrace") + default void setTrace(SetTraceParams params) { + throw new UnsupportedOperationException(); + } }