Skip to content

Commit

Permalink
Modified to prevent `Cannot allocate class org.eclipse.lsp4j.Semantic…
Browse files Browse the repository at this point in the history
…TokensCapabilities` exceptions.
  • Loading branch information
dbalek committed Nov 4, 2021
1 parent 83923af commit 648d722
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -42,6 +42,7 @@
import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.google.gson.InstanceCreator;
import org.eclipse.lsp4j.CodeActionKind;
import org.eclipse.lsp4j.CodeActionOptions;
import org.eclipse.lsp4j.CodeLensOptions;
Expand All @@ -55,6 +56,7 @@
import org.eclipse.lsp4j.MessageType;
import org.eclipse.lsp4j.PublishDiagnosticsParams;
import org.eclipse.lsp4j.RenameOptions;
import org.eclipse.lsp4j.SemanticTokensCapabilities;
import org.eclipse.lsp4j.ServerCapabilities;
import org.eclipse.lsp4j.ShowMessageRequestParams;
import org.eclipse.lsp4j.TextDocumentSyncKind;
Expand Down Expand Up @@ -137,6 +139,7 @@ public static NbLspServer launchServer(Pair<InputStream, OutputStream> io, LspSe
private static Launcher<NbCodeLanguageClient> createLauncher(LanguageServerImpl server, Pair<InputStream, OutputStream> io,
Function<MessageConsumer, MessageConsumer> processor) {
return new LSPLauncher.Builder<NbCodeLanguageClient>()
.configureGson(gb -> gb.registerTypeAdapter(SemanticTokensCapabilities.class, (InstanceCreator<SemanticTokensCapabilities>) type -> new SemanticTokensCapabilities(false)))

This comment has been minimized.

Copy link
@jtulach

jtulach Nov 4, 2021

Contributor

Good, but report LSP4J maintainers a bug anyway.

.setLocalService(server)
.setRemoteInterface(NbCodeLanguageClient.class)
.setInput(io.first())
Expand Down

0 comments on commit 648d722

Please sign in to comment.