mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Fix background indexing behavior if a source file is included in two targets via a symlink
Consider the following scenario: A project has target A containing A.swift an target B containing B.swift. B.swift is a symlink to A.swift. When A.swift is modified, both the dependencies of A and B need to be marked as having an out-of-date preparation status, not just A.
This commit is contained in:
@@ -1033,11 +1033,11 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
|
||||
return response.items
|
||||
}
|
||||
|
||||
/// Returns all source files in the project that can be built.
|
||||
/// Returns all source files in the project.
|
||||
///
|
||||
/// - SeeAlso: Comment in `sourceFilesAndDirectories` for a definition of what `buildable` means.
|
||||
package func buildableSourceFiles() async throws -> [DocumentURI: SourceFileInfo] {
|
||||
return try await sourceFilesAndDirectories(includeNonBuildableFiles: false).files
|
||||
package func sourceFiles(includeNonBuildableFiles: Bool) async throws -> [DocumentURI: SourceFileInfo] {
|
||||
return try await sourceFilesAndDirectories(includeNonBuildableFiles: includeNonBuildableFiles).files
|
||||
}
|
||||
|
||||
/// Get all files and directories that are known to the build system, ie. that are returned by a `buildTarget/sources`
|
||||
@@ -1093,7 +1093,7 @@ package actor BuildSystemManager: QueueBasedMessageHandler {
|
||||
}
|
||||
|
||||
package func testFiles() async throws -> [DocumentURI] {
|
||||
return try await buildableSourceFiles().compactMap { (uri, info) -> DocumentURI? in
|
||||
return try await sourceFiles(includeNonBuildableFiles: false).compactMap { (uri, info) -> DocumentURI? in
|
||||
guard info.isPartOfRootProject, info.mayContainTests else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem {
|
||||
SourceItem(
|
||||
uri: DocumentURI($0),
|
||||
kind: $0.isDirectory ? .directory : .file,
|
||||
generated: false,
|
||||
generated: false
|
||||
)
|
||||
}
|
||||
result.append(SourcesItem(target: target, sources: sources))
|
||||
|
||||
Reference in New Issue
Block a user