Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2019-2024 EclipseSource and others.
* Copyright (c) 2019-2025 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020-2021 EclipseSource and others.
* Copyright (c) 2020-2025 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -43,5 +43,6 @@ public void remove(final IDisposable disposable) {
@Override
protected void doDispose() {
disposables.forEach(IDisposable::dispose);
disposables.clear();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2020 EclipseSource and others.
* Copyright (c) 2019-2025 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2019-2024 EclipseSource and others.
* Copyright (c) 2019-2025 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -30,6 +30,7 @@
import org.eclipse.glsp.server.actions.ActionMessage;
import org.eclipse.glsp.server.actions.ActionRegistry;
import org.eclipse.glsp.server.session.ClientSession;
import org.eclipse.glsp.server.session.ClientSessionListener;
import org.eclipse.glsp.server.session.ClientSessionManager;
import org.eclipse.glsp.server.types.GLSPServerException;
import org.eclipse.lsp4j.jsonrpc.ResponseErrorException;
Expand All @@ -38,7 +39,7 @@

import com.google.inject.Inject;

public class DefaultGLSPServer implements GLSPServer {
public class DefaultGLSPServer implements GLSPServer, ClientSessionListener {
protected static Logger LOGGER = LogManager.getLogger(DefaultGLSPServer.class);
public static final String PROTOCOL_VERSION = "1.0.0";

Expand All @@ -62,6 +63,11 @@ public DefaultGLSPServer() {
clientSessions = new HashMap<>();
}

@Inject()
public void setup() {
sessionManager.addListener(this);
}

@Override
@SuppressWarnings("checkstyle:IllegalCatch")
public CompletableFuture<InitializeResult> initialize(final InitializeParameters params) {
Expand Down Expand Up @@ -209,4 +215,9 @@ public boolean addListener(final GLSPServerListener listener) {
public boolean remove(final GLSPServerListener listener) {
return serverConnectionListeners.remove(listener);
}

@Override
public void sessionDisposed(final ClientSession clientSession) {
clientSessions.remove(clientSession.getId());
}
}