codeconsole opened a new pull request, #3311: URL: https://github.com/apache/groovy/pull/3311
https://issues.apache.org/jira/browse/GROOVY-12786 Completing a dotted name whose receiver is not a known variable or class, such as `foo.`, `[1..2].` or `import com.`, looks for `.groovy` sources of that package. It did so with `Files.walk(Paths.get("."))`, matching every path below the working directory, so each Tab froze groovysh for as long as that walk took. `sourcesForPackage` now walks only the directory the package's complete segments name (`demo.app.` walks `./demo/app`, `demo.ap` walks `./demo`). A segment that is not a Java identifier (`[1..2].`) or a directory that does not exist leaves nothing to walk. The sources found, and so the candidates offered, are unchanged. Started from a checkout with about 990,000 files: | Tab after | 6.0.0 | `GROOVY_6_0_X` with this change | |---|---|---| | `[1..2].` | 22.8 s | 0.18 s | | `import com.` | 24.9 s | 0.02 s | | `foo.` | 22.6 s | 0.17 s | | `java.util.` | 0.21 s | 0.17 s | Groovy 6.0.0's groovysh always completes through this path; on master it is the fallback when syntax checking is off, so please backport to `GROOVY_6_0_X`, where the change applies cleanly. -- 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]
