From 9c1a61e5f25e97b1425833c5d4a013e080622927 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Wed, 8 Jul 2026 18:17:20 -0400 Subject: [PATCH] [AppKit] Update bindings up to Xcode 27 Beta 3 Bind the two macOS-only AppKit APIs introduced in the Xcode 27 SDK: * NSSpellChecker.ignoreGrammarRange:inSentence:inSpellDocumentWithTag: * NSTextCheckingWaitForAllGrammarCheckingResultsKey (an NSTextCheckingOptionKey) Both are available on macOS 27.0 only (NSSpellChecker is [NoMacCatalyst]), so they carry [Mac (27, 0)] and inherit the type's Mac Catalyst exclusion. This resolves the two entries in tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo (deleting the now-empty file) and adds the cecil documentation known-failure entry for the new IgnoreGrammarRange method. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/appkit.cs | 8 ++++++++ tests/cecil-tests/Documentation.KnownFailures.txt | 1 + .../xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo | 2 -- 3 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo diff --git a/src/appkit.cs b/src/appkit.cs index 97a151e286d..6c06323fe01 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -17635,6 +17635,10 @@ partial interface NSSpellChecker { [Export ("setIgnoredWords:inSpellDocumentWithTag:")] void SetIgnoredWords (string [] words, nint documentTag); + [Mac (27, 0)] + [Export ("ignoreGrammarRange:inSentence:inSpellDocumentWithTag:")] + void IgnoreGrammarRange (NSRange grammarRange, string sentence, nint documentTag); + [Export ("guessesForWordRange:inString:language:inSpellDocumentWithTag:")] string [] GuessesForWordRange (NSRange range, string theString, string language, nint documentTag); @@ -28972,6 +28976,10 @@ void ShowCorrectionIndicatorOfType (NSCorrectionIndicatorType type, string prima [Mac (26, 0)] [Field ("NSTextCheckingAutomaticCapitalizationEnabledKey")] NSString TextCheckingAutomaticCapitalizationEnabledKey { get; } + + [Mac (27, 0)] + [Field ("NSTextCheckingWaitForAllGrammarCheckingResultsKey")] + NSString TextCheckingWaitForAllGrammarCheckingResultsKey { get; } } partial interface NSTextViewDidChangeSelectionEventArgs { diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index b5d89de53bd..4827afaf28f 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -11047,6 +11047,7 @@ M:AppKit.NSSpellChecker.GetLanguage(Foundation.NSRange,System.String,Foundation. M:AppKit.NSSpellChecker.GuessesForWordRange(Foundation.NSRange,System.String,System.String,System.IntPtr) M:AppKit.NSSpellChecker.HasLearnedWord(System.String) M:AppKit.NSSpellChecker.IgnoredWords(System.IntPtr) +M:AppKit.NSSpellChecker.IgnoreGrammarRange(Foundation.NSRange,System.String,System.IntPtr) M:AppKit.NSSpellChecker.IgnoreWord(System.String,System.IntPtr) M:AppKit.NSSpellChecker.LearnWord(System.String) M:AppKit.NSSpellChecker.MenuForResults(Foundation.NSTextCheckingResult,System.String,Foundation.NSDictionary,CoreGraphics.CGPoint,AppKit.NSView) diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo deleted file mode 100644 index ae91f1480e7..00000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-field! NSTextCheckingWaitForAllGrammarCheckingResultsKey not bound -!missing-selector! NSSpellChecker::ignoreGrammarRange:inSentence:inSpellDocumentWithTag: not bound