From 93ef23fca0c053f1deeff660e66f93746d287f8e Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 10 Feb 2023 15:46:07 -0800 Subject: [PATCH] [macOS] Add XCode marks for TextInputPlugin (flutter/engine#39550) Adds marks to cleanly separate the sections of TextInputPlugin when viewing in XCode and other IDEs that recognise #pragma mark. This file is getting pretty long. No tests since this is a cleanup with no functional changes. --- .../macos/framework/Source/FlutterTextInputPlugin.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm index 09b7f7a7c2..a583bc3edd 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm @@ -20,7 +20,7 @@ static NSString* const kTextInputChannel = @"flutter/textinput"; -#pragma mark - Textinput channel method names +#pragma mark - TextInput channel method names // See https://api.flutter.dev/flutter/services/SystemChannels/textInput-constant.html static NSString* const kSetClientMethod = @"TextInput.setClient"; static NSString* const kShowMethod = @"TextInput.show"; @@ -62,6 +62,7 @@ static NSString* const kAutofillHints = @"hints"; static NSString* const kTextAffinityDownstream = @"TextAffinity.downstream"; static NSString* const kTextAffinityUpstream = @"TextAffinity.upstream"; +#pragma mark - Enums /** * The affinity of the current cursor position. If the cursor is at a position representing * a line break, the cursor may be drawn either at the end of the current line (upstream) @@ -72,6 +73,8 @@ typedef NS_ENUM(NSUInteger, FlutterTextAffinity) { kFlutterTextAffinityDownstream }; +#pragma mark - Static functions + /* * Updates a range given base and extent fields. */ @@ -135,6 +138,8 @@ static BOOL EnableAutocomplete(NSDictionary* configuration) { return EnableAutocompleteForTextInputConfiguration(configuration); } +#pragma mark - NSEvent (KeyEquivalentMarker) protocol + @interface NSEvent (KeyEquivalentMarker) // Internally marks that the event was received through performKeyEquivalent:. @@ -164,6 +169,8 @@ static char markerKey; @end +#pragma mark - FlutterTextInputPlugin private interface + /** * Private properties of FlutterTextInputPlugin. */ @@ -285,6 +292,8 @@ static char markerKey; @end +#pragma mark - FlutterTextInputPlugin + @implementation FlutterTextInputPlugin { /** * The currently active text input model.