@@ -27,6 +27,22 @@ public enum FileHandlingCapability: Comparable, Sendable {
2727 case handled
2828}
2929
30+ public struct SourceFileInfo : Sendable {
31+ /// The URI of the source file.
32+ public let uri : DocumentURI
33+
34+ /// Whether the file might contain test cases. This property is an over-approximation. It might be true for files
35+ /// from non-test targets or files that don't actually contain any tests. Keeping this list of files with
36+ /// `mayContainTets` minimal as possible helps reduce the amount of work that the syntactic test indexer needs to
37+ /// perform.
38+ public let mayContainTests : Bool
39+
40+ public init ( uri: DocumentURI , mayContainTests: Bool ) {
41+ self . uri = uri
42+ self . mayContainTests = mayContainTests
43+ }
44+ }
45+
3046/// Provider of FileBuildSettings and other build-related information.
3147///
3248/// The primary role of the build system is to answer queries for
@@ -88,17 +104,13 @@ public protocol BuildSystem: AnyObject, Sendable {
88104
89105 func fileHandlingCapability( for uri: DocumentURI ) async -> FileHandlingCapability
90106
91- /// Returns the list of files that might contain test cases.
92- ///
93- /// The returned file list is an over-approximation. It might contain tests from non-test targets or files that don't
94- /// actually contain any tests. Keeping this list as minimal as possible helps reduce the amount of work that the
95- /// syntactic test indexer needs to perform.
96- func testFiles( ) async -> [ DocumentURI ]
107+ /// Returns the list of source files in the project.
108+ func sourceFiles( ) async -> [ SourceFileInfo ]
97109
98- /// Adds a callback that should be called when the value returned by `testFiles ()` changes.
110+ /// Adds a callback that should be called when the value returned by `sourceFiles ()` changes.
99111 ///
100- /// The callback might also be called without an actual change to `testFiles `.
101- func addTestFilesDidChangeCallback ( _ callback: @Sendable @escaping ( ) async -> Void ) async
112+ /// The callback might also be called without an actual change to `sourceFiles `.
113+ func addSourceFilesDidChangeCallback ( _ callback: @Sendable @escaping ( ) async -> Void ) async
102114}
103115
104116public let buildTargetsNotSupported =
0 commit comments