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
Expand Up @@ -356,7 +356,7 @@ public void documentSaved(IFileBuffer buffer) {

}

public CompletableFuture<@Nullable Void> documentClosed() {
public void documentClosed() {
final var identifier = LSPEclipseUtils.toTextDocumentIdentifier(fileUri);
WILL_SAVE_WAIT_UNTIL_TIMEOUT_MAP.remove(identifier.getUri());
// When LS is shut down all documents are being disconnected. No need to send
Expand All @@ -365,7 +365,6 @@ public void documentSaved(IFileBuffer buffer) {
final var params = new DidCloseTextDocumentParams(identifier);
languageServerWrapper.sendNotification(ls -> ls.getTextDocumentService().didClose(params));
}
return CompletableFuture.completedFuture(null);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably also have returned the future of languageServerWrapper.sendNotification(..) but I dont think this would add any value.

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,10 +876,9 @@ private boolean supportsWorkspaceFolderCapability() {
*/
public @Nullable CompletableFuture<@Nullable Void> disconnect(URI uri) {
DocumentContentSynchronizer documentListener = this.connectedDocuments.remove(uri);
CompletableFuture<@Nullable Void> documentClosedFuture = null;
if (documentListener != null) {
documentListener.getDocument().removePrenotifiedDocumentListener(documentListener);
documentClosedFuture = documentListener.documentClosed();
documentListener.documentClosed();
disconnectTextFileBuffer(uri);
}
if (this.connectedDocuments.isEmpty()) {
Expand All @@ -889,7 +888,7 @@ private boolean supportsWorkspaceFolderCapability() {
stop();
}
}
return documentClosedFuture;
return CompletableFuture.completedFuture(null);
}

private static void disconnectTextFileBuffer(URI uri) {
Expand Down
Loading