From 9879e172a4f7692c99f88b636d1783b6f0e94587 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Fri, 17 Jul 2026 00:25:30 -0400 Subject: [PATCH] [FileProvider] Update bindings up to Xcode 27.0 Beta 3 Add NSFileProviderNamespacePolicy and the optional NSFileProviderItem.NamespacePolicy property for iOS and macOS 27.0. Document the new API, preserve availability metadata on the generated protocol extension accessor, and classify the Mac Catalyst enum report as an xtro false positive because the SDK marks the API unavailable there. Remove the resolved FileProvider todo files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fe80ca19-5b64-4a96-9795-67459b9ecbe7 --- src/fileprovider.cs | 21 +++++++++++++++++++ .../MacCatalyst-FileProvider.ignore | 3 ++- .../MacCatalyst-FileProvider.todo | 1 - .../iOS-FileProvider.todo | 2 -- .../macOS-FileProvider.todo | 2 -- 5 files changed, 23 insertions(+), 6 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-FileProvider.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-FileProvider.todo diff --git a/src/fileprovider.cs b/src/fileprovider.cs index 8f206ee3922f..60be01c382ce 100644 --- a/src/fileprovider.cs +++ b/src/fileprovider.cs @@ -304,6 +304,18 @@ public enum NSFileProviderContentPolicy : long { DownloadEagerlyAndKeepDownloaded, } + /// Specifies how the system materializes a file provider folder's namespace. + [Native] + [NoTV, NoMacCatalyst, Mac (27, 0), iOS (27, 0)] + public enum NSFileProviderNamespacePolicy : long { + /// Inherits the namespace policy from the parent folder. + Inherited, + /// Materializes a dataless folder's namespace when the folder is accessed. + MaterializeLazily, + /// Keeps the folder's namespace fully materialized and up to date. + MaterializeEagerly, + } + /// A batch of data to return from an enumerator. [NoMacCatalyst] [Static] @@ -758,6 +770,15 @@ interface NSFileProviderItem { [NoTV, NoMacCatalyst, iOS (16, 0)] [Export ("contentPolicy")] NSFileProviderContentPolicy ContentPolicy { get; } + + /// Gets the policy that controls how the item's namespace is materialized. + [NoTV, NoMacCatalyst, Mac (27, 0), iOS (27, 0)] + [Export ("namespacePolicy")] + NSFileProviderNamespacePolicy NamespacePolicy { + // Keep the generated extension method's availability in sync. + [NoTV, NoMacCatalyst, Mac (27, 0), iOS (27, 0)] + get; + } } /// A shared object that is accessible from both the containing app and the extension. diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.ignore index 48e77adae063..01873d18c3dc 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.ignore @@ -1,5 +1,6 @@ # Documentation as of Xcode 13 as macOS only !missing-enum! NSFileProviderFileSystemFlags not bound !missing-enum! NSFileProviderDomainTestingModes not bound -# Header clearly says this enum is not available on Mac Catalyst, not sure why xtro thinks it is. +# Headers explicitly mark these enums unavailable on Mac Catalyst; xtro drops the enum typedef availability. !missing-enum! NSFileProviderContentPolicy not bound +!missing-enum! NSFileProviderNamespacePolicy not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo deleted file mode 100644 index 66a81419177b..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-enum! NSFileProviderNamespacePolicy not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-FileProvider.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-FileProvider.todo deleted file mode 100644 index 23e76739903e..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-FileProvider.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-enum! NSFileProviderNamespacePolicy not bound -!missing-protocol-member! NSFileProviderItem::namespacePolicy not found diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-FileProvider.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-FileProvider.todo deleted file mode 100644 index 23e76739903e..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-FileProvider.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-enum! NSFileProviderNamespacePolicy not bound -!missing-protocol-member! NSFileProviderItem::namespacePolicy not found