Perf: Index only reachable products of package dependencies (#2427)
Fixes #2427 Summary This PR optimizes background indexing by filtering out unreachable dependency products.
1-Logic: Uses ModulesGraph.reachableProducts to identify only the dependency modules required by the root package.
2-Safety: Always indexes all modules in the root package, regardless of reachability.
3-Implementation: Replaces the generic traverseModules in SwiftPMBuildServer.swift with a filtered traverseReachableModules wrapper.
4-Clean Code: Moves filtering logic to a new PackageGraph+Reachability.swift .
As mentioned in https://github.com/swiftlang/sourcekit-lsp/issues/2427, I’d like to hear @rintaro and @hamishknight’s opinion on this idea before deciding whether this is the right direction to go in.
yeah, sure i have done this so they can review this implementation quality and based on this they can decide whether to continue this or leave it :)