Skip to content

Commit 7140ca3

Browse files
committed
Remove assertion that we can't register for change notifications twice in SwiftPMWorkspace
There’s no harm in registering for change notifications for the same file twice. Currently, this can happen if you open two files that have the same main file. `BuildSystemManager` checks that there are no more files referencing a main file before calling `unregisterForChangeNotifications`, so this is where the “complicated” logic lives that checks if sourcekit-lsp really isn’t interested in a file anymore. rdar://117603105
1 parent 1021fb4 commit 7140ca3

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ extension SwiftPMWorkspace: SKCore.BuildSystem {
300300
}
301301

302302
public func registerForChangeNotifications(for uri: DocumentURI) async {
303-
assert(!self.watchedFiles.contains(uri), "Registered twice for change notifications of the same URI")
304303
self.watchedFiles.insert(uri)
305304
}
306305

0 commit comments

Comments
 (0)