From e242c7359b7c789bc98c6bf58959d37c625f67df Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 27 Oct 2025 10:42:16 +0100 Subject: [PATCH] [AppKit] Update bindings for NSTextView. Fixes #24098. * Add missing nullability. * Implement missing APIs. * Remove useless xml docs. * Remove outdated comments. * Teach xtro that pointers don't have nullability. Fixes https://github.com/dotnet/macios/issues/24098. --- src/appkit.cs | 181 ++++++------------ .../Documentation.KnownFailures.txt | 17 ++ .../macOS-AppKit.ignore | 57 ------ .../xtro-sharpie/NullabilityCheck.cs | 4 + 4 files changed, 83 insertions(+), 176 deletions(-) diff --git a/src/appkit.cs b/src/appkit.cs index 17236aa6351f..e082f175566c 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -22925,7 +22925,7 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide { [DesignatedInitializer] [Export ("initWithFrame:textContainer:")] - NativeHandle Constructor (CGRect frameRect, NSTextContainer container); + NativeHandle Constructor (CGRect frameRect, [NullAllowed] NSTextContainer container); [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frameRect); @@ -22939,9 +22939,11 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("invalidateTextContainerOrigin")] void InvalidateTextContainerOrigin (); + [NullAllowed] [Export ("layoutManager")] NSLayoutManager LayoutManager { get; } + [NullAllowed] [Export ("textStorage")] NSTextStorage TextStorage { get; } @@ -22963,62 +22965,62 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide void SetBaseWritingDirection (NSWritingDirection writingDirection, NSRange range); [Export ("turnOffKerning:")] - void TurnOffKerning (NSObject sender); + void TurnOffKerning ([NullAllowed] NSObject sender); [Export ("tightenKerning:")] - void TightenKerning (NSObject sender); + void TightenKerning ([NullAllowed] NSObject sender); [Export ("loosenKerning:")] - void LoosenKerning (NSObject sender); + void LoosenKerning ([NullAllowed] NSObject sender); [Export ("useStandardKerning:")] - void UseStandardKerning (NSObject sender); + void UseStandardKerning ([NullAllowed] NSObject sender); [Export ("turnOffLigatures:")] - void TurnOffLigatures (NSObject sender); + void TurnOffLigatures ([NullAllowed] NSObject sender); [Export ("useStandardLigatures:")] - void UseStandardLigatures (NSObject sender); + void UseStandardLigatures ([NullAllowed] NSObject sender); [Export ("useAllLigatures:")] - void UseAllLigatures (NSObject sender); + void UseAllLigatures ([NullAllowed] NSObject sender); [Export ("raiseBaseline:")] - void RaiseBaseline (NSObject sender); + void RaiseBaseline ([NullAllowed] NSObject sender); [Export ("lowerBaseline:")] - void LowerBaseline (NSObject sender); + void LowerBaseline ([NullAllowed] NSObject sender); [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use unicode characters via the character palette.")] [Export ("toggleTraditionalCharacterShape:")] void ToggleTraditionalCharacterShape (NSObject sender); [Export ("outline:")] - void Outline (NSObject sender); + void Outline ([NullAllowed] NSObject sender); [Export ("performFindPanelAction:")] - void PerformFindPanelAction (NSObject sender); + void PerformFindPanelAction ([NullAllowed] NSObject sender); [Export ("alignJustified:")] - void AlignJustified (NSObject sender); + void AlignJustified ([NullAllowed] NSObject sender); [Export ("changeAttributes:")] - void ChangeAttributes (NSObject sender); + void ChangeAttributes ([NullAllowed] NSObject sender); [Export ("changeDocumentBackgroundColor:")] - void ChangeDocumentBackgroundColor (NSObject sender); + void ChangeDocumentBackgroundColor ([NullAllowed] NSObject sender); [Export ("orderFrontSpacingPanel:")] - void OrderFrontSpacingPanel (NSObject sender); + void OrderFrontSpacingPanel ([NullAllowed] NSObject sender); [Export ("orderFrontLinkPanel:")] - void OrderFrontLinkPanel (NSObject sender); + void OrderFrontLinkPanel ([NullAllowed] NSObject sender); [Export ("orderFrontListPanel:")] - void OrderFrontListPanel (NSObject sender); + void OrderFrontListPanel ([NullAllowed] NSObject sender); [Export ("orderFrontTablePanel:")] - void OrderFrontTablePanel (NSObject sender); + void OrderFrontTablePanel ([NullAllowed] NSObject sender); [Export ("rulerView:didMoveMarker:")] void RulerViewDidMoveMarker (NSRulerView ruler, NSRulerMarker marker); @@ -23075,15 +23077,15 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide void ClickedOnLink (NSObject link, nuint charIndex); [Export ("startSpeaking:")] - void StartSpeaking (NSObject sender); + void StartSpeaking ([NullAllowed] NSObject sender); [Export ("stopSpeaking:")] - void StopSpeaking (NSObject sender); + void StopSpeaking ([NullAllowed] NSObject sender); [Export ("characterIndexForInsertionAtPoint:")] nuint CharacterIndex (CGPoint point); - //Detected properties + [NullAllowed] [Export ("textContainer")] NSTextContainer TextContainer { get; set; } @@ -23099,6 +23101,7 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("rangeForUserCompletion")] NSRange RangeForUserCompletion (); + [return: NullAllowed] [Export ("completionsForPartialWordRange:indexOfSelectedItem:")] string [] CompletionsForPartialWord (NSRange charRange, out nint index); @@ -23118,8 +23121,9 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("readablePasteboardTypes")] string [] ReadablePasteboardTypes (); + [return: NullAllowed] [Export ("preferredPasteboardTypeFromArray:restrictedToTypesFromArray:")] - string GetPreferredPasteboardType (string [] availableTypes, string [] allowedTypes); + string GetPreferredPasteboardType (string [] availableTypes, [NullAllowed] string [] allowedTypes); [Export ("readSelectionFromPasteboard:type:")] bool ReadSelectionFromPasteboard (NSPasteboard pboard, string type); @@ -23131,8 +23135,9 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("registerForServices")] void RegisterForServices (); + [return: NullAllowed] [Export ("validRequestorForSendType:returnType:")] - NSObject ValidRequestorForSendType (string sendType, string returnType); + NSObject ValidRequestorForSendType ([NullAllowed] string sendType, [NullAllowed] string returnType); [Export ("pasteAsPlainText:")] void PasteAsPlainText ([NullAllowed] NSObject sender); @@ -23144,9 +23149,12 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide // Dragging support // - // FIXME: Binding - //[Export ("dragImageForSelectionWithEvent:origin:")] - //NSImage DragImageForSelection (NSEvent theEvent, NSPointPointer origin); + [return: NullAllowed] + [Export ("dragImageForSelectionWithEvent:origin:")] + unsafe NSImage DragImage (NSEvent @event, CGPoint* origin); + + [Export ("dragSelectionWithEvent:offset:slideBack:")] + bool DragSelection (NSEvent @event, CGSize mouseOffset, bool slideBack); [Export ("acceptableDragTypes")] string [] AcceptableDragTypes (); @@ -23170,32 +23178,32 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide void UpdateInsertionPointStateAndRestartTimer (bool restartFlag); [Export ("toggleContinuousSpellChecking:")] - void ToggleContinuousSpellChecking (NSObject sender); + void ToggleContinuousSpellChecking ([NullAllowed] NSObject sender); [Export ("spellCheckerDocumentTag")] nint SpellCheckerDocumentTag (); [Export ("toggleGrammarChecking:")] - void ToggleGrammarChecking (NSObject sender); + void ToggleGrammarChecking ([NullAllowed] NSObject sender); [Export ("setSpellingState:range:")] void SetSpellingState (nint value, NSRange charRange); [Export ("shouldChangeTextInRanges:replacementStrings:")] - bool ShouldChangeText (NSArray /* NSRange [] */ affectedRanges, string [] replacementStrings); + bool ShouldChangeText (NSArray /* NSRange [] */ affectedRanges, [NullAllowed] string [] replacementStrings); + [return: NullAllowed] [Export ("rangesForUserTextChange")] NSArray /* NSRange [] */ RangesForUserTextChange (); + [return: NullAllowed] [Export ("rangesForUserCharacterAttributeChange")] NSArray /* NSRange [] */ RangesForUserCharacterAttributeChange (); + [return: NullAllowed] [Export ("rangesForUserParagraphAttributeChange")] NSArray /* NSRange [] */ RangesForUserParagraphAttributeChange (); - //[Export ("shouldChangeTextInRange:replacementString:")] - //bool ShouldChangeText (NSRange affectedCharRange, string replacementString); - [Export ("rangeForUserTextChange")] NSRange RangeForUserTextChange (); @@ -23208,9 +23216,6 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("breakUndoCoalescing")] void BreakUndoCoalescing (); - /// To be added. - /// To be added. - /// To be added. [Export ("isCoalescingUndo")] bool IsCoalescingUndo (); @@ -23230,9 +23235,11 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("insertionPointColor")] NSColor InsertionPointColor { get; set; } + [NullAllowed] [Export ("markedTextAttributes")] NSDictionary MarkedTextAttributes { get; set; } + [NullAllowed] [Export ("linkTextAttributes")] NSDictionary LinkTextAttributes { get; set; } @@ -23242,24 +23249,15 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("acceptsGlyphInfo")] bool AcceptsGlyphInfo { get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("rulerVisible")] bool RulerVisible { [Bind ("isRulerVisible")] get; set; } [Export ("usesRuler")] bool UsesRuler { get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("continuousSpellCheckingEnabled")] bool ContinuousSpellCheckingEnabled { [Bind ("isContinuousSpellCheckingEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("grammarCheckingEnabled")] bool GrammarCheckingEnabled { [Bind ("isGrammarCheckingEnabled")] get; set; } @@ -23272,6 +23270,7 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("allowsDocumentBackgroundColorChange")] bool AllowsDocumentBackgroundColorChange { get; set; } + [NullAllowed] [Export ("defaultParagraphStyle")] NSParagraphStyle DefaultParagraphStyle { get; set; } @@ -23281,31 +23280,15 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("allowsImageEditing")] bool AllowsImageEditing { get; set; } - /// To be added. - /// To be added. - /// To be added. [Wrap ("WeakDelegate")] INSTextViewDelegate Delegate { get; set; } -#pragma warning disable 0109 // warning CS0109: The member 'NSTextView.Editable' does not hide an accessible member. The new keyword is not required. - /// To be added. - /// To be added. - /// To be added. [Export ("editable")] - new bool Editable { [Bind ("isEditable")] get; set; } -#pragma warning restore + bool Editable { [Bind ("isEditable")] get; set; } -#pragma warning disable 0109 // warning CS0109: The member 'NSTextView.Selectable' does not hide an accessible member. The new keyword is not required. - /// To be added. - /// To be added. - /// To be added. [Export ("selectable")] - new bool Selectable { [Bind ("isSelectable")] get; set; } -#pragma warning restore + bool Selectable { [Bind ("isSelectable")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("richText")] bool RichText { [Bind ("isRichText")] get; set; } @@ -23318,36 +23301,18 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Export ("backgroundColor")] NSColor BackgroundColor { get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("fieldEditor")] bool FieldEditor { [Bind ("isFieldEditor")] get; set; } [Export ("usesFontPanel")] bool UsesFontPanel { get; set; } + [NullAllowed] [Export ("allowedInputSourceLocales")] string [] AllowedInputSourceLocales { get; set; } - // FIXME: binding - //[Export ("shouldChangeTextInRanges:replacementStrings:")] - //bool ShouldChangeTextInRanges (NSArray affectedRanges, NSArray replacementStrings); - - // FIXME: binding - //[Export ("rangesForUserTextChange")] - //NSArray RangesForUserTextChange (); - - // FIXME: binding - //[Export ("rangesForUserCharacterAttributeChange")] - //NSArray RangesForUserCharacterAttributeChange (); - - // FIXME: binding - //[Export ("rangesForUserParagraphAttributeChange")] - //NSArray RangesForUserParagraphAttributeChange (); - [Export ("shouldChangeTextInRange:replacementString:")] - bool ShouldChangeText (NSRange affectedCharRange, string replacementString); + bool ShouldChangeText (NSRange affectedCharRange, [NullAllowed] string replacementString); [Export ("didChangeText")] void DidChangeText (); @@ -23362,34 +23327,36 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide NSRange SmartDeleteRangeForProposedRange (NSRange proposedCharRange); [Export ("toggleSmartInsertDelete:")] - void ToggleSmartInsertDelete (NSObject sender); + void ToggleSmartInsertDelete ([NullAllowed] NSObject sender); [Export ("smartInsertForString:replacingRange:beforeString:afterString:")] void SmartInsert (string pasteString, NSRange charRangeToReplace, [NullAllowed] out string beforeString, [NullAllowed] out string afterString); + [return: NullAllowed] [Export ("smartInsertBeforeStringForString:replacingRange:")] string SmartInsertBefore (string pasteString, NSRange charRangeToReplace); + [return: NullAllowed] [Export ("smartInsertAfterStringForString:replacingRange:")] string SmartInsertAfter (string pasteString, NSRange charRangeToReplace); [Export ("toggleAutomaticQuoteSubstitution:")] - void ToggleAutomaticQuoteSubstitution (NSObject sender); + void ToggleAutomaticQuoteSubstitution ([NullAllowed] NSObject sender); [Export ("toggleAutomaticLinkDetection:")] - void ToggleAutomaticLinkDetection (NSObject sender); + void ToggleAutomaticLinkDetection ([NullAllowed] NSObject sender); [Export ("toggleAutomaticDataDetection:")] - void ToggleAutomaticDataDetection (NSObject sender); + void ToggleAutomaticDataDetection ([NullAllowed] NSObject sender); [Export ("toggleAutomaticDashSubstitution:")] - void ToggleAutomaticDashSubstitution (NSObject sender); + void ToggleAutomaticDashSubstitution ([NullAllowed] NSObject sender); [Export ("toggleAutomaticTextReplacement:")] - void ToggleAutomaticTextReplacement (NSObject sender); + void ToggleAutomaticTextReplacement ([NullAllowed] NSObject sender); [Export ("toggleAutomaticSpellingCorrection:")] - void ToggleAutomaticSpellingCorrection (NSObject sender); + void ToggleAutomaticSpellingCorrection ([NullAllowed] NSObject sender); [Export ("checkTextInRange:types:options:")] void CheckText (NSRange range, NSTextCheckingTypes checkingTypes, NSDictionary options); @@ -23398,51 +23365,33 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide void HandleTextChecking (NSTextCheckingResult [] results, NSRange range, NSTextCheckingTypes checkingTypes, NSDictionary options, NSOrthography orthography, nint wordCount); [Export ("orderFrontSubstitutionsPanel:")] - void OrderFrontSubstitutionsPanel (NSObject sender); + void OrderFrontSubstitutionsPanel ([NullAllowed] NSObject sender); [Export ("checkTextInSelection:")] - void CheckTextInSelection (NSObject sender); + void CheckTextInSelection ([NullAllowed] NSObject sender); [Export ("checkTextInDocument:")] - void CheckTextInDocument (NSObject sender); + void CheckTextInDocument ([NullAllowed] NSObject sender); //Detected properties [Export ("smartInsertDeleteEnabled")] bool SmartInsertDeleteEnabled { get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticQuoteSubstitutionEnabled")] bool AutomaticQuoteSubstitutionEnabled { [Bind ("isAutomaticQuoteSubstitutionEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticLinkDetectionEnabled")] bool AutomaticLinkDetectionEnabled { [Bind ("isAutomaticLinkDetectionEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticDataDetectionEnabled")] bool AutomaticDataDetectionEnabled { [Bind ("isAutomaticDataDetectionEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticDashSubstitutionEnabled")] bool AutomaticDashSubstitutionEnabled { [Bind ("isAutomaticDashSubstitutionEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticTextReplacementEnabled")] bool AutomaticTextReplacementEnabled { [Bind ("isAutomaticTextReplacementEnabled")] get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticSpellingCorrectionEnabled")] bool AutomaticSpellingCorrectionEnabled { [Bind ("isAutomaticSpellingCorrectionEnabled")] get; set; } @@ -23453,15 +23402,12 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide bool UsesRolloverButtonForSelection { get; set; } [Export ("toggleQuickLookPreviewPanel:")] - void ToggleQuickLookPreviewPanel (NSObject sender); + void ToggleQuickLookPreviewPanel ([NullAllowed] NSObject sender); [Static] [Export ("stronglyReferencesTextStorage")] bool StronglyReferencesTextStorage { get; } - /// To be added. - /// To be added. - /// To be added. [Export ("automaticTextCompletionEnabled")] bool AutomaticTextCompletionEnabled { [Bind ("isAutomaticTextCompletionEnabled")] get; set; } @@ -28781,7 +28727,7 @@ partial interface NSTextView : NSTextLayoutOrientationProvider { void SetLayoutOrientation (NSTextLayoutOrientation theOrientation); [Export ("changeLayoutOrientation:")] - void ChangeLayoutOrientation (NSObject sender); + void ChangeLayoutOrientation ([NullAllowed] NSObject sender); [Export ("usesInspectorBar")] bool UsesInspectorBar { get; set; } @@ -28789,9 +28735,6 @@ partial interface NSTextView : NSTextLayoutOrientationProvider { [Export ("usesFindBar")] bool UsesFindBar { get; set; } - /// To be added. - /// To be added. - /// To be added. [Export ("incrementalSearchingEnabled")] bool IsIncrementalSearchingEnabled { [Bind ("isIncrementalSearchingEnabled")] get; set; } diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index c9fd3e7f88ae..42767cc9b990 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -8840,6 +8840,7 @@ M:AppKit.NSTextView.add_DraggedCell(System.EventHandler{AppKit.NSTextViewDragged M:AppKit.NSTextView.add_WritingToolsDidEnd(System.EventHandler) M:AppKit.NSTextView.add_WritingToolsWillBegin(System.EventHandler) M:AppKit.NSTextView.Dispose(System.Boolean) +M:AppKit.NSTextView.IsCoalescingUndo M:AppKit.NSTextView.remove_CellClicked(System.EventHandler{AppKit.NSTextViewClickedEventArgs}) M:AppKit.NSTextView.remove_CellDoubleClicked(System.EventHandler{AppKit.NSTextViewDoubleClickEventArgs}) M:AppKit.NSTextView.remove_DidChangeSelection(System.EventHandler) @@ -18478,8 +18479,24 @@ P:AppKit.NSTextSelectionNavigation.TextSelectionDataSource P:AppKit.NSTextStorageEventArgs.Delta P:AppKit.NSTextStorageEventArgs.EditedMask P:AppKit.NSTextStorageEventArgs.EditedRange +P:AppKit.NSTextView.AutomaticDashSubstitutionEnabled +P:AppKit.NSTextView.AutomaticDataDetectionEnabled +P:AppKit.NSTextView.AutomaticLinkDetectionEnabled +P:AppKit.NSTextView.AutomaticQuoteSubstitutionEnabled +P:AppKit.NSTextView.AutomaticSpellingCorrectionEnabled +P:AppKit.NSTextView.AutomaticTextCompletionEnabled +P:AppKit.NSTextView.AutomaticTextReplacementEnabled P:AppKit.NSTextView.ContentType +P:AppKit.NSTextView.ContinuousSpellCheckingEnabled +P:AppKit.NSTextView.Delegate +P:AppKit.NSTextView.Editable +P:AppKit.NSTextView.FieldEditor P:AppKit.NSTextView.GetWritingToolsIgnoredRangesInEnclosingRange +P:AppKit.NSTextView.GrammarCheckingEnabled +P:AppKit.NSTextView.IsIncrementalSearchingEnabled +P:AppKit.NSTextView.RichText +P:AppKit.NSTextView.RulerVisible +P:AppKit.NSTextView.Selectable P:AppKit.NSTextView.WritingToolsActive P:AppKit.NSTextViewClickedEventArgs.Cell P:AppKit.NSTextViewClickedEventArgs.CellFrame diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore index 59e98c25f898..3eeb0eb2f481 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore @@ -299,7 +299,6 @@ !missing-null-allowed! 'AppKit.NSImageRep[] AppKit.NSImageRep::ImageRepsFromFile(System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSImageRep[] AppKit.NSImageRep::ImageRepsFromPasteboard(AppKit.NSPasteboard)' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSImageRep[] AppKit.NSImageRep::ImageRepsFromUrl(Foundation.NSUrl)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'AppKit.NSLayoutManager AppKit.NSTextView::get_LayoutManager()' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSLayoutManager AppKit.NSTypesetter::get_LayoutManager()' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSMenu AppKit.NSApplicationDelegate::ApplicationDockMenu(AppKit.NSApplication)' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSMenu AppKit.NSCell::MenuForEvent(AppKit.NSEvent,CoreGraphics.CGRect,AppKit.NSView)' is missing an [NullAllowed] on return type @@ -367,7 +366,6 @@ !missing-null-allowed! 'AppKit.NSTextContainer AppKit.NSTypesetter::get_CurrentTextContainer()' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSTextContainer[] AppKit.NSTypesetter::get_TextContainers()' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSTextInputContext AppKit.NSTextInputContext::get_CurrentInputContext()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'AppKit.NSTextStorage AppKit.NSTextView::get_TextStorage()' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSTextTab AppKit.NSTypesetter::GetTextTab(System.Runtime.InteropServices.NFloat,Foundation.NSWritingDirection,System.Runtime.InteropServices.NFloat)' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSTextView AppKit.NSCell::FieldEditorForView(AppKit.NSView)' is missing an [NullAllowed] on return type !missing-null-allowed! 'AppKit.NSTouchBar AppKit.NSResponder_NSTouchBarProvider::MakeTouchBar(AppKit.NSResponder)' is missing an [NullAllowed] on return type @@ -414,9 +412,6 @@ !missing-null-allowed! 'CoreGraphics.CGRect AppKit.NSPageControllerDelegate::GetFrame(AppKit.NSPageController,Foundation.NSObject)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'CoreImage.CIContext AppKit.NSGraphicsContext::get_CIContext()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAffineTransform AppKit.NSFontDescriptor::get_Matrix()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSArray AppKit.NSTextView::RangesForUserCharacterAttributeChange()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSArray AppKit.NSTextView::RangesForUserParagraphAttributeChange()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSArray AppKit.NSTextView::RangesForUserTextChange()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray AppKit.NSWindow::WindowNumbersWithOptions(AppKit.NSWindowNumberListOptions)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray[] AppKit.NSFontManager::AvailableMembersOfFontFamily(System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAttributedString AppKit.NSHelpManager::Context(Foundation.NSObject)' is missing an [NullAllowed] on return type @@ -488,9 +483,6 @@ !missing-null-allowed! 'Foundation.NSObject AppKit.NSStoryboard::InstantiateInitialController()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSObject AppKit.NSTableViewDataSource::GetObjectValue(AppKit.NSTableView,AppKit.NSTableColumn,System.IntPtr)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'Foundation.NSObject AppKit.NSTableViewDataSource::GetObjectValue(AppKit.NSTableView,AppKit.NSTableColumn,System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'Foundation.NSObject AppKit.NSTextView::ValidRequestorForSendType(System.String,System.String)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'Foundation.NSObject AppKit.NSTextView::ValidRequestorForSendType(System.String,System.String)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'Foundation.NSObject AppKit.NSTextView::ValidRequestorForSendType(System.String,System.String)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSObject AppKit.NSTouch::get_Device()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSObject AppKit.NSTrackingArea::get_Owner()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSObject AppKit.NSTreeNode::get_RepresentedObject()' is missing an [NullAllowed] on return type @@ -549,7 +541,6 @@ !missing-null-allowed! 'System.Boolean AppKit.NSTableViewDelegate::ShouldTypeSelect(AppKit.NSTableView,AppKit.NSEvent,System.String)' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.Boolean AppKit.NSTabViewController::ShouldSelectTabViewItem(AppKit.NSTabView,AppKit.NSTabViewItem)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean AppKit.NSTabViewDelegate::ShouldSelectTabViewItem(AppKit.NSTabView,AppKit.NSTabViewItem)' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'System.Boolean AppKit.NSTextView::ShouldChangeText(Foundation.NSArray,System.String[])' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean AppKit.NSTextViewDelegate::ShouldChangeTextInRanges(AppKit.NSTextView,Foundation.NSValue[],System.String[])' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.Boolean AppKit.NSTreeController::SetSelectionIndexPath(Foundation.NSIndexPath)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Boolean AppKit.NSWindow::TryToPerform(ObjCRuntime.Selector,Foundation.NSObject)' is missing an [NullAllowed] on parameter #1 @@ -608,10 +599,6 @@ !missing-null-allowed! 'System.String AppKit.NSTableViewDelegate::GetSelectString(AppKit.NSTableView,AppKit.NSTableColumn,System.IntPtr)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.String AppKit.NSTableViewDelegate::GetSelectString(AppKit.NSTableView,AppKit.NSTableColumn,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String AppKit.NSTextInputContext::LocalizedNameForInputSource(System.String)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String AppKit.NSTextView::GetPreferredPasteboardType(System.String[],System.String[])' is missing an [NullAllowed] on parameter #1 -!missing-null-allowed! 'System.String AppKit.NSTextView::GetPreferredPasteboardType(System.String[],System.String[])' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String AppKit.NSTextView::SmartInsertAfter(System.String,Foundation.NSRange)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String AppKit.NSTextView::SmartInsertBefore(System.String,Foundation.NSRange)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String AppKit.NSTokenFieldCellDelegate::GetDisplayString(AppKit.NSTokenFieldCell,Foundation.NSObject)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String AppKit.NSTokenFieldCellDelegate::GetEditingString(AppKit.NSTokenFieldCell,Foundation.NSObject)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String AppKit.NSTokenFieldDelegate::GetDisplayString(AppKit.NSTokenField,Foundation.NSObject)' is missing an [NullAllowed] on return type @@ -629,7 +616,6 @@ !missing-null-allowed! 'System.String[] AppKit.NSSpellChecker::CompletionsForPartialWordRange(Foundation.NSRange,System.String,System.String,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String[] AppKit.NSSpellChecker::GuessesForWordRange(Foundation.NSRange,System.String,System.String,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String[] AppKit.NSSpellChecker::IgnoredWords(System.IntPtr)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'System.String[] AppKit.NSTextView::CompletionsForPartialWord(Foundation.NSRange,System.IntPtr&)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.String[] AppKit.NSTokenFieldDelegate::GetCompletionStrings(AppKit.NSTokenField,System.String,System.IntPtr,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'System.Void AppKit.NSAlert::set_HelpAnchor(System.String)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSAlert::set_Icon(AppKit.NSImage)' is missing an [NullAllowed] on parameter #0 @@ -920,45 +906,6 @@ !missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_Client(AppKit.INSTextFinderClient)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_FindBarContainer(AppKit.INSTextFinderBarContainer)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextFinderBarContainer::set_FindBarView(AppKit.NSView)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::AlignJustified(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ChangeAttributes(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ChangeDocumentBackgroundColor(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ChangeLayoutOrientation(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::CheckTextInDocument(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::CheckTextInSelection(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::LoosenKerning(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::LowerBaseline(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::OrderFrontLinkPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::OrderFrontListPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::OrderFrontSpacingPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::OrderFrontSubstitutionsPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::OrderFrontTablePanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::Outline(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::PerformFindPanelAction(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::RaiseBaseline(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::set_AllowedInputSourceLocales(System.String[])' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::set_DefaultParagraphStyle(AppKit.NSParagraphStyle)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::set_LinkTextAttributes(Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::set_MarkedTextAttributes(Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::set_TextContainer(AppKit.NSTextContainer)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::StartSpeaking(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::StopSpeaking(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::TightenKerning(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticDashSubstitution(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticDataDetection(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticLinkDetection(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticQuoteSubstitution(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticSpellingCorrection(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleAutomaticTextReplacement(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleContinuousSpellChecking(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleGrammarChecking(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleQuickLookPreviewPanel(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::ToggleSmartInsertDelete(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::TurnOffKerning(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::TurnOffLigatures(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::UseAllLigatures(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::UseStandardKerning(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextView::UseStandardLigatures(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextView_SharingService::OrderFrontSharingServicePicker(AppKit.NSTextView,Foundation.NSObject)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Void AppKit.NSTokenField::set_CharacterSet(Foundation.NSCharacterSet)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSToolbarItem::set_MenuFormRepresentation(AppKit.NSMenuItem)' is missing an [NullAllowed] on parameter #0 @@ -1032,7 +979,6 @@ !missing-null-allowed! 'System.Boolean AppKit.NSTextAttachmentCell::TrackMouse(AppKit.NSEvent,CoreGraphics.CGRect,AppKit.NSView,System.Boolean)' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.Boolean AppKit.NSTextAttachmentCell::TrackMouse(AppKit.NSEvent,CoreGraphics.CGRect,AppKit.NSView,System.UIntPtr,System.Boolean)' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.Boolean AppKit.NSTextAttachmentCell::WantsToTrackMouse(AppKit.NSEvent,CoreGraphics.CGRect,AppKit.NSView,System.UIntPtr)' is missing an [NullAllowed] on parameter #2 -!missing-null-allowed! 'System.Boolean AppKit.NSTextView::ShouldChangeText(Foundation.NSRange,System.String)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Boolean AppKit.NSTextViewDelegate::ShouldChangeTextInRange(AppKit.NSTextView,Foundation.NSRange,System.String)' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.IntPtr AppKit.NSBrowserDelegate::NextTypeSelectMatch(AppKit.NSBrowser,System.IntPtr,System.IntPtr,System.IntPtr,System.String)' is missing an [NullAllowed] on parameter #4 !missing-null-allowed! 'System.IntPtr AppKit.NSSpellChecker::RequestChecking(System.String,Foundation.NSRange,Foundation.NSTextCheckingTypes,Foundation.NSDictionary,System.IntPtr,System.Action`4)' is missing an [NullAllowed] on parameter #5 @@ -1052,7 +998,6 @@ !missing-null-allowed! 'System.Void AppKit.NSSpellChecker::RecordResponse(AppKit.NSCorrectionResponse,System.String,System.String,System.String,System.IntPtr)' is missing an [NullAllowed] on parameter #3 !missing-null-allowed! 'System.Void AppKit.NSSpellChecker::ShowCorrectionIndicatorOfType(AppKit.NSCorrectionIndicatorType,System.String,System.String[],CoreGraphics.CGRect,AppKit.NSRulerView,AppKit.NSSpellCheckerShowCorrectionIndicatorOfTypeHandler)' is missing an [NullAllowed] on parameter #5 !missing-null-allowed! 'System.Void AppKit.NSTextAttachmentCell::Highlight(System.Boolean,CoreGraphics.CGRect,AppKit.NSView)' is missing an [NullAllowed] on parameter #2 -!missing-null-allowed! 'System.Void AppKit.NSTextView::.ctor(CoreGraphics.CGRect,AppKit.NSTextContainer)' is missing an [NullAllowed] on parameter #1 !missing-null-allowed! 'System.Void AppKit.NSTrackingArea::.ctor(CoreGraphics.CGRect,AppKit.NSTrackingAreaOptions,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #2 !missing-null-allowed! 'System.Void AppKit.NSViewController::TransitionFromViewController(AppKit.NSViewController,AppKit.NSViewController,AppKit.NSViewControllerTransitionOptions,System.Action)' is missing an [NullAllowed] on parameter #3 !missing-null-allowed! 'System.Void AppKit.NSWindow::.ctor(CoreGraphics.CGRect,AppKit.NSWindowStyle,AppKit.NSBackingStore,System.Boolean,AppKit.NSScreen)' is missing an [NullAllowed] on parameter #4 @@ -1535,8 +1480,6 @@ !missing-selector! NSTextFinder::findBarContainer not bound !missing-selector! NSTextFinder::incrementalSearchingShouldDimContentView not bound !missing-selector! NSTextFinder::setIncrementalSearchingShouldDimContentView: not bound -!missing-selector! NSTextView::dragImageForSelectionWithEvent:origin: not bound -!missing-selector! NSTextView::dragSelectionWithEvent:offset:slideBack: not bound !missing-selector! NSTreeController::selectedObjects not bound !missing-selector! NSTreeNode::mutableChildNodes not bound !missing-selector! NSView::enclosingMenuItem not bound diff --git a/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs b/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs index 2048bee1f737..72b7c73cd2e0 100644 --- a/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs +++ b/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs @@ -151,6 +151,10 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl, VisitKind visitKi if (pt.IsByReference) continue; + // if we used a pointer to a type, nullability won't be present + if (pt.IsPointer) + continue; + Null parameter_nullable; // if we used a nullable type (e.g. `[BindAs]`)