Skip to content

Commit a2b5b97

Browse files
committed
Bring out the preprocSketch
1 parent 274664c commit a2b5b97

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

java/src/processing/mode/java/lsp/PdeAdapter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.Arrays;
77
import java.util.Collections;
88
import java.util.concurrent.CompletableFuture;
9+
import java.util.concurrent.ExecutionException;
910
import java.util.HashSet;
1011
import java.util.List;
1112
import java.util.Map;
@@ -58,6 +59,7 @@ class PdeAdapter {
5859
CompletableFuture<PreprocSketch> cps;
5960
CompletionGenerator suggestionGenerator;
6061
Set<URI> prevDiagnosticReportUris = new HashSet<>();
62+
PreprocSketch ps;
6163

6264

6365
PdeAdapter(File rootPath, LanguageClient client) {
@@ -155,6 +157,10 @@ void notifySketchChanged() {
155157
preprocService.notifySketchChanged();
156158
errorChecker.notifySketchChanged();
157159
preprocService.whenDone(cps::complete);
160+
try { ps = cps.get();
161+
} catch (InterruptedException | ExecutionException e) {
162+
throw new RuntimeException(e);
163+
}
158164
}
159165

160166
Optional<SketchCode> findCodeByUri(URI uri) {

0 commit comments

Comments
 (0)