You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "thurka (via GitHub)" <gi...@apache.org> on 2023/03/29 11:25:03 UTC

[GitHub] [netbeans] thurka opened a new pull request, #5737: Use wait node in VSCode for long running computation of children

thurka opened a new pull request, #5737:
URL: https://github.com/apache/netbeans/pull/5737

   This PR tries to fix the issue, which manifest itself as VSCode error "Element with id xxx is already registered" when expanding nodes in Database view in VSCode. 
   It turns out that the error was caused by asynchronous computation of children used netbeans database module and usage of `node.getChildren().getNodes(true)` in LSP server. This implementation causes that VSCode does not see `wait node` which is normally displayed in NetBeans, because `getNodes(true)` waits for all nodes and efectively invalides the asynchronous computation of children for the VSCode. However property change events and other changes for newly created nodes are fired from netbeans code and translated via LSP to VSCode - I believe that this causes mismatch between VSCode and LSP server. 
   The fix changes `node.getChildren().getNodes(true)` to `node.getChildren().getNodes()` so that VSCode sees `wait node` and asynchronously computed nodes the same way as are presented in NetBeans. It is also not necessary to wrap `node.getChildren().getNodes()` in `CompletableFuture.supplyAsync()`, since `getNodes()` is designed not to block. Finally `wait node` icon was changed to use `watch` VCSode icon so that the UI of `wait node` match the VSCode LAF.
   `java.lsp.server` unit tests were updated to wait for full children computation before accessing them via LSP API.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a diff in pull request #5737: Use wait node in VSCode for long running computation of children

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on code in PR #5737:
URL: https://github.com/apache/netbeans/pull/5737#discussion_r1152333874


##########
java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/explorer/ProjectViewTest.java:
##########
@@ -428,6 +428,8 @@ private TreeItem findChild(TreeItem parent, String... labelPath) throws Exceptio
     }
     
     private TreeItem findChild(TreeItem parent, String childLabel) throws Exception {
+        TreeNodeRegistry reg = serverLookup.lookup(TreeNodeRegistry.class);
+        reg.findNode(parent.id).getChildren().getNodes(true);

Review Comment:
   OK, this should avoid the async computation (if implemented by Children)...



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on pull request #5737: Use wait node in VSCode for long running computation of children

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #5737:
URL: https://github.com/apache/netbeans/pull/5737#issuecomment-1488447516

   Added labels as previous PR and re-triggered tests.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #5737: Use wait node in VSCode for long running computation of children

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #5737:
URL: https://github.com/apache/netbeans/pull/5737#issuecomment-1490223866

   all green


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic merged pull request #5737: Use wait node in VSCode for long running computation of children

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic merged PR #5737:
URL: https://github.com/apache/netbeans/pull/5737


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists