branch: elpa/geiser-kawa
commit 0d86c7b14a92440e06c32d51dbe00d0c50f53131
Author: spellcard199 <spellcard...@protonmail.com>
Commit: spellcard199 <spellcard...@protonmail.com>

    Add java package completion caching at module load time
---
 src/main/java/kawageiser/Geiser.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/java/kawageiser/Geiser.java 
b/src/main/java/kawageiser/Geiser.java
index 0599b9c..2573a24 100644
--- a/src/main/java/kawageiser/Geiser.java
+++ b/src/main/java/kawageiser/Geiser.java
@@ -6,6 +6,7 @@
 package kawageiser;
 
 import gnu.expr.Language;
+import kawadevutil.complete.CompletionDataForJavaPackage;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -59,6 +60,12 @@ public class Geiser implements Runnable {
 
         try {
             if (lang.lookup("geiser:eval") == null) {
+                // Tell kawadevutil to build package cache, which takes a 
couple of seconds,
+                // in a separate thread, so user doesn't have to wait later.
+                new Thread(
+                        () -> 
CompletionDataForJavaPackage.getChildrenNamesOfRoot(true)
+                ).start();
+
                 // The reason for this if block is that if someone re-imported 
this module
                 // and the following code was executed, this exception would 
happen:
                 // java.lang.IllegalStateException:

Reply via email to