drccrd commented on code in PR #3965:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3965#discussion_r3842243717


##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspServer.java:
##########
@@ -116,6 +136,48 @@ public void rebuildClassIndex() {
         }
     }
 
+    /**
+     * Recomputes {@link #javaSourceIndex} from {@code root} using the
+     * current {@link #javaSourcePathsSetting}/{@link 
#javaPackageFiltersSetting}.
+     * The single choke point for the discover+build pair — every site that
+     * (re)builds the source index (initialize's fast path,
+     * {@link #rebuildClassIndex}, the test hook) calls this rather than
+     * repeating it inline.
+     */
+    private void refreshJavaSourceIndex(Path root) {
+        List<Path> roots = JavaSourceRoots.discover(root, 
javaSourcePathsSetting);
+        javaSourceIndex = JavaSourceTypeIndex.build(new 
LinkedHashSet<>(roots), javaPackageFiltersSetting);
+    }
+
+    /**
+     * Publishes the merged class index — compiled classpath classes, this
+     * workspace's own build output, and Java-source-derived type names —
+     * to the document service. The single choke point for every publish
+     * site (initialize's fast/post-mvn phases, {@link #rebuildClassIndex}),
+     * so source names are never missing from one path but not another.
+     * Nudges the client to re-pull diagnostics afterward (same pull-model
+     * nudge the build-diagnostics tier uses) so unknown-type squiggles
+     * against a type this publish just resolved clear promptly rather than
+     * waiting for the next edit/save.
+     */
+    private void publishClassIndex() {
+        ClassIndex outputIndex = ClassIndex.build(buildOutputDirs);
+        ClassIndex merged = ClassIndex.merge(ClassIndex.merge(jarClassIndex, 
outputIndex),
+                ClassIndex.of(javaSourceIndex.classNames()));

Review Comment:
   resolved in a22f4a787db5bbb2ed7d92b0fd5668d562e46129 - 
`setResolvedClasspath` now actually waits for the classpath to be resolved 
(flagging unknown types before this doesn't make sense)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to