Explanation: Currently, any new header file causes a package reload. This means that while background indexing is writing header files into the index build directory, the package will get reloaded, which is unnecessary.
Scope: isolated to known clients using this function, primarily SourceKit-LSP
Risk: low, the function itself is not used in SwiftPM
Testing: added a new unit test
Issue: rdar://128573306
Reviewer: @ahoppen @bnbarham
Cherry-pick of https://github.com/apple/swift-package-manager/pull/7691.
Explanation: Currently, any new header file causes a package reload. This means that while background indexing is writing header files into the index build directory, the package will get reloaded, which is unnecessary. Scope: isolated to known clients using this function, primarily SourceKit-LSP Risk: low, the function itself is not used in SwiftPM Testing: added a new unit test Issue: rdar://128573306 Reviewer: @ahoppen @bnbarham