sourcekit-lsp icon indicating copy to clipboard operation
sourcekit-lsp copied to clipboard

Perf: Index only reachable products of package dependencies (#2427)

Open DPrakashhh opened this issue 10 months ago • 2 comments

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 .

DPrakashhh avatar Jan 09 '26 16:01 DPrakashhh

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.

ahoppen avatar Jan 09 '26 21:01 ahoppen

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 :)

DPrakashhh avatar Jan 10 '26 02:01 DPrakashhh