junichi11 opened a new pull request #2241: URL: https://github.com/apache/netbeans/pull/2241
https://issues.apache.org/jira/browse/NETBEANS-4503 #### 1st commit Nested functions are in a Method/FunctionScope. However, they are added as elements of a NamespaceScope. i.e. Method/FunctionScope doesn't have nested FunctionScopes. NamespaceScope has them. So, (not return the child result simply,) check whether the child result contains the parent result in the `VariableScopeFinder.findWrapper()`. #### 2nd commit Unit test(testNb4503_01()) failed on GitHub Actions after I pushed the first commit. However, It passed on my local pc. After I've tried some things, I've somehow reproduced it. ```java public void testNb4503_01() throws Exception { Thread.sleep(1000); // added this, then reproduced testNb4503(" $e->^test(); // test1"); } ``` The cause: A cached `Source` instance may be removed after elements are indexed. So, the test file is scanned again when the test is run. If there are elements for LazyBuild, we may not be able to get the correct result. To avoiding that, after elements are scanned lazily, find the scope again. ---------------------------------------------------------------- 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. 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
