lahodaj opened a new pull request, #8255: URL: https://github.com/apache/netbeans/pull/8255
While looking into: https://github.com/oracle/javavscode/issues/375 it turned out there's this problem with `ClassIndex`: when the `ClassIndex` is created for a `ClasspathInfo`, it sets up delegate queries, one per (translated) root included in the `ClasspathInfo`. If a delegate query does not exist for a given root, it is ignored. The delegate may not exist if the root has not been indexed yet. The problem is, this given instance of `ClassIndex` is not refreshed when the root is indexed, and the delegate exists. Which may mean the index won't reply with answers for the root, basically forever. I think this does not manifest much in the NetBeans IDE, as: a) the `ClassIndex` is usually not queried before indexing is finished b) the `ClasspathInfo`s are thrown away relatively commonly. Inside the VS Code extension(s), the index query may happen much sooner, and the `ClasspathInfo` is apparently not throw away so easily. We could workaround by refreshing the `ClasspathInfo`s at the end of an indexing, or something like that, but it feels like a hack to me. The proposal here is to add a listener to `ClassIndexManager` when a delegate does not exist for a root, and the existing code should then ensure the `ClassIndex` is refreshed when indexing finishes. The listener is weak, and I did some experiments, and it seems it is being freed reasonably. -- 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
