Skip to content

Commit 5fffb0a

Browse files
committed
Watch for changes to source files
We used to only watch for file creation and deletion because that might modify build settings but for background indexing, we also need to watch for changes to the files, so we can invalidate the up-to-date status of the target.
1 parent ed7a1d2 commit 5fffb0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ extension SourceKitLSPServer {
14701470
// dynamic registration of watch patterns.
14711471
// This must be a superset of the files that return true for SwiftPM's `Workspace.fileAffectsSwiftOrClangBuildSettings`.
14721472
var watchers = FileRuleDescription.builtinRules.flatMap({ $0.fileTypes }).map { fileExtension in
1473-
return FileSystemWatcher(globPattern: "**/*.\(fileExtension)", kind: [.create, .delete])
1473+
return FileSystemWatcher(globPattern: "**/*.\(fileExtension)", kind: [.create, .change, .delete])
14741474
}
14751475
watchers.append(FileSystemWatcher(globPattern: "**/Package.swift", kind: [.change]))
14761476
watchers.append(FileSystemWatcher(globPattern: "**/compile_commands.json", kind: [.create, .change, .delete]))

0 commit comments

Comments
 (0)