thurka opened a new pull request, #5709: URL: https://github.com/apache/netbeans/pull/5709
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. -- 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] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
