diff options
author | George Fraser <george@fivetran.com> | 2019-01-05 13:16:45 -0800 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2019-01-05 13:16:45 -0800 |
commit | 7c7202e0ad442dddac1a56890b34c3eb2f045f28 (patch) | |
tree | 6f0d5f51aaa3d018eb35bdda641f3aa92dc6eb34 /src/test/java/org/javacs/LanguageServerFixture.java | |
parent | 08b36f1358642b370b4a24be73bab7c29bdac39d (diff) | |
download | java-language-server-7c7202e0ad442dddac1a56890b34c3eb2f045f28.zip |
Detect unused variables
Diffstat (limited to 'src/test/java/org/javacs/LanguageServerFixture.java')
-rw-r--r-- | src/test/java/org/javacs/LanguageServerFixture.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/LanguageServerFixture.java b/src/test/java/org/javacs/LanguageServerFixture.java index f2da3b7..f9052a0 100644 --- a/src/test/java/org/javacs/LanguageServerFixture.java +++ b/src/test/java/org/javacs/LanguageServerFixture.java @@ -19,18 +19,26 @@ class LanguageServerFixture { return getJavaLanguageServer(DEFAULT_WORKSPACE_ROOT, diagnostic -> LOG.info(diagnostic.message)); } + static JavaLanguageServer getJavaLanguageServer(Consumer<Diagnostic> onError) { + return getJavaLanguageServer(DEFAULT_WORKSPACE_ROOT, onError); + } + static JavaLanguageServer getJavaLanguageServer(Path workspaceRoot, Consumer<Diagnostic> onError) { return getJavaLanguageServer( workspaceRoot, new LanguageClient() { + @Override public void publishDiagnostics(PublishDiagnosticsParams params) { params.diagnostics.forEach(onError); } + @Override public void showMessage(ShowMessageParams params) {} + @Override public void registerCapability(String method, JsonElement options) {} + @Override public void customNotification(String method, JsonElement params) {} }); } |