Reduce number of project reconcile requests
This commit is contained in:
@@ -220,13 +220,14 @@ public class BootLanguageServerInitializer implements InitializingBean {
|
||||
|
||||
doNotValidateProject(project, true);
|
||||
|
||||
projectReconcileRequests.put(uri, Mono.delay(Duration.ofMillis(100))
|
||||
projectReconcileRequests.put(uri, Mono.delay(Duration.ofMillis(500))
|
||||
.publishOn(projectReconcileScheduler)
|
||||
.doOnSuccess(l -> {
|
||||
projectReconcileRequests.remove(uri);
|
||||
projectFinder.find(new TextDocumentIdentifier(uri.toString())).ifPresent(p -> {
|
||||
projectReconciler.reconcile(p, doc -> server.createProblemCollector(doc));
|
||||
});
|
||||
if (projectReconcileRequests.remove(uri) != null) {
|
||||
projectFinder.find(new TextDocumentIdentifier(uri.toString())).ifPresent(p -> {
|
||||
projectReconciler.reconcile(p, doc -> server.createProblemCollector(doc));
|
||||
});
|
||||
}
|
||||
})
|
||||
.subscribe());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BootVersionValidator {
|
||||
|
||||
public void validate(IJavaProject project) {
|
||||
if (config.isBootVersionValidationEnabled()) {
|
||||
log.info("Validating Spring Boot version on project: " + project.getElementName());
|
||||
log.debug("Validating Spring Boot version on project: " + project.getElementName());
|
||||
|
||||
VersionValidationPreferences preferences = new VersionValidationPreferences();
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ public class RewriteReconciler implements JavaReconciler {
|
||||
@Override
|
||||
public Map<IDocument, Collection<ReconcileProblem>> reconcile(IJavaProject project, List<TextDocument> docs,
|
||||
Function<TextDocument, IProblemCollector> problemCollectorFactory) {
|
||||
log.info("Validating project " + project.getElementName());
|
||||
Map<IDocument, Collection<ReconcileProblem>> allProblems = new HashMap<>();
|
||||
List<Path> testSourceFolders = IClasspathUtil.getProjectTestJavaSources(project.getClasspath()).map(f -> f.toPath()).collect(Collectors.toList());
|
||||
List<TextDocument> testSources = new ArrayList<>(docs.size());
|
||||
@@ -233,7 +234,6 @@ public class RewriteReconciler implements JavaReconciler {
|
||||
private Map<IDocument, Collection<ReconcileProblem>> doReconcile(IJavaProject project, List<TextDocument> docs,
|
||||
Function<TextDocument, IProblemCollector> problemCollectorFactory, JavaParser javaParser) {
|
||||
Map<IDocument, Collection<ReconcileProblem>> allProblems = new HashMap<>();
|
||||
|
||||
if (javaParser != null && config.isRewriteReconcileEnabled()) {
|
||||
try {
|
||||
List<RecipeCodeActionDescriptor> descriptors = getProblemRecipeDescriptors(project);
|
||||
|
||||
Reference in New Issue
Block a user