Skip to content

Commit 447120a

Browse files
committed
refactor: remove useless return value in documentClosed
1 parent a427ae3 commit 447120a

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

org.eclipse.lsp4e/src/org/eclipse/lsp4e/DocumentContentSynchronizer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public void documentSaved(IFileBuffer buffer) {
356356

357357
}
358358

359-
public CompletableFuture<@Nullable Void> documentClosed() {
359+
public void documentClosed() {
360360
final var identifier = LSPEclipseUtils.toTextDocumentIdentifier(fileUri);
361361
WILL_SAVE_WAIT_UNTIL_TIMEOUT_MAP.remove(identifier.getUri());
362362
// When LS is shut down all documents are being disconnected. No need to send
@@ -365,7 +365,6 @@ public void documentSaved(IFileBuffer buffer) {
365365
final var params = new DidCloseTextDocumentParams(identifier);
366366
languageServerWrapper.sendNotification(ls -> ls.getTextDocumentService().didClose(params));
367367
}
368-
return CompletableFuture.completedFuture(null);
369368
}
370369

371370
/**

org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,10 +876,9 @@ private boolean supportsWorkspaceFolderCapability() {
876876
*/
877877
public @Nullable CompletableFuture<@Nullable Void> disconnect(URI uri) {
878878
DocumentContentSynchronizer documentListener = this.connectedDocuments.remove(uri);
879-
CompletableFuture<@Nullable Void> documentClosedFuture = null;
880879
if (documentListener != null) {
881880
documentListener.getDocument().removePrenotifiedDocumentListener(documentListener);
882-
documentClosedFuture = documentListener.documentClosed();
881+
documentListener.documentClosed();
883882
disconnectTextFileBuffer(uri);
884883
}
885884
if (this.connectedDocuments.isEmpty()) {
@@ -889,7 +888,7 @@ private boolean supportsWorkspaceFolderCapability() {
889888
stop();
890889
}
891890
}
892-
return documentClosedFuture;
891+
return CompletableFuture.completedFuture(null);
893892
}
894893

895894
private static void disconnectTextFileBuffer(URI uri) {

0 commit comments

Comments
 (0)