-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignoring failures when checking for hyperlinks #1186
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,6 +12,16 @@ | |||||
*******************************************************************************/ | ||||||
package org.eclipse.lsp4e; | ||||||
|
||||||
import org.eclipse.core.resources.IProject; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like organize imports is configured different than by default. Could you change it so that the PR does not change the order of the import in all the modified files? |
||||||
import org.eclipse.core.runtime.Assert; | ||||||
import org.eclipse.jdt.annotation.Nullable; | ||||||
import org.eclipse.jface.text.IDocument; | ||||||
import org.eclipse.lsp4e.LanguageServersRegistry.LanguageServerDefinition; | ||||||
import org.eclipse.lsp4e.internal.ArrayUtil; | ||||||
import org.eclipse.lsp4j.ServerCapabilities; | ||||||
import org.eclipse.lsp4j.jsonrpc.messages.Either; | ||||||
import org.eclipse.lsp4j.services.LanguageServer; | ||||||
|
||||||
import java.util.ArrayList; | ||||||
import java.util.Collection; | ||||||
import java.util.Collections; | ||||||
|
@@ -27,16 +37,6 @@ | |||||
import java.util.function.Predicate; | ||||||
import java.util.stream.Stream; | ||||||
|
||||||
import org.eclipse.core.resources.IProject; | ||||||
import org.eclipse.core.runtime.Assert; | ||||||
import org.eclipse.jdt.annotation.Nullable; | ||||||
import org.eclipse.jface.text.IDocument; | ||||||
import org.eclipse.lsp4e.LanguageServersRegistry.LanguageServerDefinition; | ||||||
import org.eclipse.lsp4e.internal.ArrayUtil; | ||||||
import org.eclipse.lsp4j.ServerCapabilities; | ||||||
import org.eclipse.lsp4j.jsonrpc.messages.Either; | ||||||
import org.eclipse.lsp4j.services.LanguageServer; | ||||||
|
||||||
/** | ||||||
* Main entry point for accessors to run requests on the language servers, and some utilities | ||||||
* for manipulating the asynchronous response objects in streams | ||||||
|
@@ -410,6 +410,30 @@ public static <T> CompletableFuture<List<T>> addAll(CompletableFuture<List<T>> a | |||||
return res; | ||||||
} | ||||||
|
||||||
/** | ||||||
* Combines two async lists of results into a single list by adding all the elements of the second list to the first one, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* ignoring abnormal results and only including succeses. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* | ||||||
* @param <T> Result type | ||||||
* @param futures Async results | ||||||
* @return Async combined result | ||||||
*/ | ||||||
public static <T> CompletableFuture<List<T>> addAllSuccessful(CompletableFuture<List<T>>... futures) { | ||||||
CompletableFuture<List<T>> res = CompletableFuture.allOf(futures) | ||||||
.thenApply( v -> { | ||||||
List<T> results = new ArrayList<>(futures.length); | ||||||
for(CompletableFuture<List<T>> f : futures) { | ||||||
if (!f.isCompletedExceptionally()) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of just ignoring exceptions, I think we should log them using |
||||||
results.addAll(f.join()); | ||||||
} | ||||||
} | ||||||
return results; | ||||||
}); | ||||||
forwardCancellation(res, futures); | ||||||
return res; | ||||||
} | ||||||
|
||||||
|
||||||
/** | ||||||
* Retrieves the initialized servers and apply the given query. | ||||||
* <p>The query must ideally be a direct query to the language server | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks unrelated to the ticket you are resolving. Could you move the change to a new PR so that it can be looked at independently?