Replace project sorter for initial classpath events...
Now uses FileBuffers instead of open editors. This avoid long blocking on ui thread syncExec.
This commit is contained in:
@@ -99,9 +99,12 @@ public class ReusableClasspathListenerHandler {
|
||||
|
||||
public void subscribe(String callbackCommandId, boolean isBatched) {
|
||||
// keep out of synchronized block to avoid workspace locks
|
||||
logger.log("Sorting projects...");
|
||||
IProject[] sortedProjects = getSortedProjects();
|
||||
logger.log("Sorting projects... DONE");
|
||||
|
||||
synchronized(this) {
|
||||
logger.log("inside synchronized Subscriptions");
|
||||
if (!subscribers.containsKey(callbackCommandId)) {
|
||||
logger.log("subscribing to classpath changes: " + callbackCommandId +" isBatched = "+isBatched);
|
||||
classpathListener = new ClasspathListenerManager(logger, new ClasspathListener() {
|
||||
|
||||
@@ -42,7 +42,9 @@ import org.springframework.ide.vscode.commons.util.FileObserver;
|
||||
import org.springframework.ide.vscode.commons.util.UriUtil;
|
||||
|
||||
import reactor.core.Disposable;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.util.context.Context;
|
||||
|
||||
public class JdtLsProjectCache implements InitializableJavaProjectsService {
|
||||
|
||||
@@ -269,14 +271,10 @@ public class JdtLsProjectCache implements InitializableJavaProjectsService {
|
||||
}
|
||||
})
|
||||
.timeout(INITIALIZE_TIMEOUT)
|
||||
.doOnSubscribe(x -> log.info("addClasspathListener ..."))
|
||||
.doOnSuccess(x -> log.info("addClasspathListener DONE"))
|
||||
.doOnError(t -> {
|
||||
if (isNoJdtError(t)) {
|
||||
log.info("JDT Language Server not available. Fallback classpath provider will be used instead.");
|
||||
} else if (isOldJdt(t)) {
|
||||
log.info("JDT Lanuage Server too old. Fallback classpath provider will be used instead.");
|
||||
} else {
|
||||
log.error("Unexpected error registering classpath listener with JDT. Fallback classpath provider will be used instead.", t);
|
||||
}
|
||||
log.error("Unexpected error registering classpath listener with JDT. Fallback classpath provider will be used instead.", t);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user