Instead of having FileHandlingCapability for a source file, check if it belongs to any targets

This commit is contained in:
Alex Hoppen
2024-08-24 13:18:48 -07:00
parent bf8ff8b3d1
commit 236f566977
12 changed files with 34 additions and 116 deletions

View File

@@ -489,10 +489,7 @@ extension SwiftPMBuildSystem {
targets[targetIdentifier] = (buildTarget, depth)
}
if let delegate = self.delegate {
await delegate.fileHandlingCapabilityChanged()
await messageHandler?.sendNotificationToSourceKitLSP(DidChangeBuildTargetNotification(changes: nil))
}
await messageHandler?.sendNotificationToSourceKitLSP(DidChangeBuildTargetNotification(changes: nil))
for testFilesDidChangeCallback in testFilesDidChangeCallbacks {
await testFilesDidChangeCallback()
}
@@ -851,13 +848,6 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuiltInBuildSystem {
await self.fileDependenciesUpdatedDebouncer.scheduleCall(filesWithUpdatedDependencies)
}
package func fileHandlingCapability(for uri: DocumentURI) -> FileHandlingCapability {
if targets(for: uri).isEmpty {
return .unhandled
}
return .handled
}
package func sourceFiles() -> [SourceFileInfo] {
var sourceFiles: [DocumentURI: SourceFileInfo] = [:]
for (buildTarget, depth) in self.targets.values {