File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
shared/src/main/kotlin/org/javacs/kt/classpath Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -19,21 +19,12 @@ private fun workspaceResolvers(workspaceRoot: Path): Sequence<ClassPathResolver>
19
19
}
20
20
21
21
/* * Searches the folder for all build-files. */
22
- private fun folderResolvers (root : Path , ignored : List <PathMatcher >): Collection <ClassPathResolver > {
23
- val resolvers = mutableListOf<ClassPathResolver >()
24
-
25
- for (file in Files .walk(root)) {
26
- // Only test whether non-ignored file is a build-file
27
- if (ignored.none { it.matches(root.relativize(file)) }) {
28
- val resolver = asClassPathProvider(file)
29
- if (resolver != null ) {
30
- resolvers.add(resolver)
31
- }
32
- }
33
- }
34
-
35
- return resolvers
36
- }
22
+ private fun folderResolvers (root : Path , ignored : List <PathMatcher >): Collection <ClassPathResolver > =
23
+ root.toFile()
24
+ .walk()
25
+ .onEnter { file -> ignored.none { it.matches(root.relativize(file.toPath())) } }
26
+ .mapNotNull { asClassPathProvider(it.toPath()) }
27
+ .toList()
37
28
38
29
/* * Tries to read glob patterns from a gitignore. */
39
30
private fun ignoredPathPatterns (path : Path ): List <PathMatcher > =
You can’t perform that action at this time.
0 commit comments