Copilot commented on code in PR #3717:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3717#discussion_r3806682933


##########
packages/drools-lsp/drools-lsp-server/src/main/java/org/drools/lsp/server/DroolsLspServer.java:
##########
@@ -214,8 +224,31 @@ public CompletableFuture<InitializeResult> 
initialize(InitializeParams params) {
                 new DiagnosticRegistrationOptions(false, false));
         initializeResult.getCapabilities().setTypeHierarchyProvider(true);
 
-        String rootUri = params.getRootUri();
+        final String rootUri = params.getRootUri();
         if (rootUri != null) {
+            String groupingSettings = 
groupingSettingsOf(params.getInitializationOptions());
+            List<Path> workspaceFiles = 
workspaceFilesOf(params.getInitializationOptions());
+            CompletableFuture.runAsync(() -> {
+                try {
+                    // Let the grouping resolver read the workspace's 
configuration
+                    // before the classpath work below, which is the slow part.
+                    WorkspaceSiblingResolver resolver = 
WorkspaceSiblingResolvers.active();

Review Comment:
   The initialization task is detached from the `initialize` future, so 
post-initialize notifications can race it. A newer 
`setGroupingConfig`/`setWorkspaceFiles` value can be overwritten by these 
captured startup values, and a restored file-group pin can be cleared when the 
delayed `setWorkspaceRoot` runs. Ensure initial resolver state is ordered 
before subsequent grouping notifications, or guard these writes with a 
generation.



-- 
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