├── Extension ├── Configuration │ ├── Extension-Debug.xcconfig │ ├── Extension-Release.xcconfig │ └── Extension-Shared.xcconfig ├── Supporting Files │ ├── Extension.entitlements │ └── Info.plist └── Sources │ ├── CommandErrors.swift │ ├── SourceEditorExtension.swift │ ├── FormatEntireFileCommand.swift │ └── FormatSelectedSourceCommand.swift ├── Application ├── Configuration │ ├── Application-Debug.xcconfig │ ├── Application-Release.xcconfig │ └── Application-Shared.xcconfig ├── Resources │ └── Assets.xcassets │ │ └── Contents.json ├── Sources │ ├── AppDelegate.swift │ ├── ViewController.swift │ └── Base.lproj │ │ └── Main.storyboard └── Supporting Files │ ├── Application.entitlements │ └── Info.plist ├── Shared ├── Sources │ ├── UserDefaults.swift │ ├── Configuration.swift │ └── Security.swift └── Configuration │ ├── Project-Release.xcconfig │ ├── Project-Debug.xcconfig │ └── Project-Shared.xcconfig ├── SwiftFormatter.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ └── Package.resolved ├── xcshareddata │ └── xcschemes │ │ ├── SwiftFormatter Settings.xcscheme │ │ └── SwiftFormatter Extension.xcscheme └── project.pbxproj ├── .gitignore └── LICENSE /Extension/Configuration/Extension-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Extension-Shared.xcconfig" 2 | -------------------------------------------------------------------------------- /Extension/Configuration/Extension-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Extension-Shared.xcconfig" 2 | -------------------------------------------------------------------------------- /Application/Configuration/Application-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Application-Shared.xcconfig" 2 | -------------------------------------------------------------------------------- /Application/Configuration/Application-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Application-Shared.xcconfig" 2 | -------------------------------------------------------------------------------- /Application/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Application/Sources/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | 3 | @NSApplicationMain 4 | class AppDelegate: NSObject, NSApplicationDelegate {} 5 | -------------------------------------------------------------------------------- /Shared/Sources/UserDefaults.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension UserDefaults { 4 | public static let applicationGroupDefaults = UserDefaults(suiteName: try! SecCode.applicationGroups().first!)! 5 | } 6 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Shared/Configuration/Project-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Project-Shared.xcconfig" 2 | 3 | // Build Options 4 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 5 | 6 | // Swift Compiler - Code Generation 7 | SWIFT_COMPILATION_MODE = wholemodule 8 | SWIFT_OPTIMIZATION_LEVEL = -O 9 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Shared/Configuration/Project-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Project-Shared.xcconfig" 2 | 3 | // Architectures 4 | ONLY_ACTIVE_ARCH = YES 5 | 6 | // Build Options 7 | DEBUG_INFORMATION_FORMAT = dwarf 8 | ENABLE_TESTABILITY = YES 9 | 10 | // Clang - Code Generation 11 | GCC_OPTIMIZATION_LEVEL = 0 12 | 13 | // Swift Compiler - Code Generation 14 | SWIFT_OPTIMIZATION_LEVEL = -Onone 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | 21 | ## Playgrounds 22 | timeline.xctimeline 23 | playground.xcworkspace 24 | 25 | # Swift Package Manager 26 | .build/ 27 | -------------------------------------------------------------------------------- /Extension/Supporting Files/Extension.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | $(TeamIdentifierPrefix)$(PROJECT_NAME:rfc1034identifier) 8 | 9 | com.apple.security.app-sandbox 10 | 11 | com.apple.security.files.user-selected.read-only 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Application/Supporting Files/Application.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | $(TeamIdentifierPrefix)$(PROJECT_NAME:rfc1034identifier) 8 | 9 | com.apple.security.app-sandbox 10 | 11 | com.apple.security.files.user-selected.read-only 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Application/Configuration/Application-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // Deployment 2 | COMBINE_HIDPI_IMAGES = YES 3 | 4 | // Linking 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks 6 | 7 | // Packaging 8 | INFOPLIST_FILE = Application/Supporting Files/Info.plist 9 | PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER) 10 | PRODUCT_NAME = $(PROJECT_NAME) Settings 11 | 12 | // Signing 13 | CODE_SIGN_ENTITLEMENTS = Application/Supporting Files/Application.entitlements 14 | CODE_SIGN_STYLE = Automatic 15 | DEVELOPMENT_TEAM = HJKFVK94J4 16 | ENABLE_HARDENED_RUNTIME = YES 17 | 18 | // Asset Catalog Compiler - Options 19 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon 20 | -------------------------------------------------------------------------------- /Extension/Configuration/Extension-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // Build Options 2 | APPLICATION_EXTENSION_API_ONLY = YES 3 | 4 | // Deployment 5 | COMBINE_HIDPI_IMAGES = YES 6 | SKIP_INSTALL = YES 7 | 8 | // Linking 9 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks 10 | 11 | // Packaging 12 | INFOPLIST_FILE = Extension/Supporting Files/Info.plist 13 | PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).XcodeSourceEditorExtension 14 | PRODUCT_NAME = $(PROJECT_NAME) 15 | 16 | // Signing 17 | CODE_SIGN_ENTITLEMENTS = Extension/Supporting Files/Extension.entitlements 18 | CODE_SIGN_STYLE = Automatic 19 | DEVELOPMENT_TEAM = HJKFVK94J4 20 | ENABLE_HARDENED_RUNTIME = YES 21 | -------------------------------------------------------------------------------- /Extension/Sources/CommandErrors.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum FormatCommandError: Error, LocalizedError, CustomNSError { 4 | case notSwiftLanguage(String) 5 | case noSelection 6 | case invalidSelection 7 | 8 | var localizedDescription: String { 9 | switch self { 10 | case let .notSwiftLanguage(contentUTI): 11 | return "Error: not a Swift source file. Current file is \(contentUTI)." 12 | case .noSelection: 13 | return "Error: no text selected." 14 | case .invalidSelection: 15 | return "Error: invalid selection." 16 | } 17 | } 18 | 19 | var errorUserInfo: [String: Any] { 20 | return [NSLocalizedDescriptionKey: localizedDescription] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Tony Arnold 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Shared/Sources/Configuration.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2019 The CocoaBots. All rights reserved. 2 | 3 | import Foundation 4 | import SwiftFormatConfiguration 5 | 6 | extension SwiftFormatConfiguration.Configuration { 7 | /// Loads and returns a `Configuration` from the given JSON file if it is found and is valid. If the file does not exist or there was an error decoding it, the program exits with a non-zero exit code. 8 | public static func decodedConfiguration(fromFileAtPath path: String) throws -> SwiftFormatConfiguration.Configuration { 9 | let url = URL(fileURLWithPath: path) 10 | return try decodedConfiguration(fromFileURL: url) 11 | } 12 | 13 | /// Loads and returns a `Configuration` from the given JSON file if it is found and is valid. If the file does not exist or there was an error decoding it, the program exits with a non-zero exit code. 14 | public static func decodedConfiguration(fromFileURL fileURL: URL) throws -> SwiftFormatConfiguration.Configuration { 15 | let data = try Data(contentsOf: fileURL) 16 | return try JSONDecoder().decode(SwiftFormatConfiguration.Configuration.self, from: data) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift-argument-parser", 6 | "repositoryURL": "https://github.com/apple/swift-argument-parser.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "35b76bf577d3cc74820f8991894ce3bcdf024ddc", 10 | "version": "0.0.2" 11 | } 12 | }, 13 | { 14 | "package": "swift-format", 15 | "repositoryURL": "https://github.com/apple/swift-format.git", 16 | "state": { 17 | "branch": "master", 18 | "revision": "5e7ef93b6b93381c6805fea57b3ccfb05f718846", 19 | "version": null 20 | } 21 | }, 22 | { 23 | "package": "SwiftSyntax", 24 | "repositoryURL": "https://github.com/apple/swift-syntax", 25 | "state": { 26 | "branch": "swift-DEVELOPMENT-SNAPSHOT-2020-01-29-a", 27 | "revision": "16f6af54d9ad3cfcb35cd557288783dded1107fd", 28 | "version": null 29 | } 30 | }, 31 | { 32 | "package": "swift-tools-support-core", 33 | "repositoryURL": "https://github.com/apple/swift-tools-support-core.git", 34 | "state": { 35 | "branch": null, 36 | "revision": "693aba4c4c9dcc4767cc853a0dd38bf90ad8c258", 37 | "version": "0.0.1" 38 | } 39 | } 40 | ] 41 | }, 42 | "version": 1 43 | } 44 | -------------------------------------------------------------------------------- /Application/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | swift-format 13 | 14 | CFBundleTypeName 15 | swift-format 16 | CFBundleTypeRole 17 | Editor 18 | LSHandlerRank 19 | Default 20 | 21 | 22 | CFBundleExecutable 23 | $(EXECUTABLE_NAME) 24 | CFBundleIdentifier 25 | $(PRODUCT_BUNDLE_IDENTIFIER) 26 | CFBundleInfoDictionaryVersion 27 | 6.0 28 | CFBundleName 29 | $(PRODUCT_NAME) 30 | CFBundlePackageType 31 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 32 | CFBundleShortVersionString 33 | $(MARKETING_VERSION) 34 | CFBundleVersion 35 | $(CURRENT_PROJECT_VERSION) 36 | LSMinimumSystemVersion 37 | $(MACOSX_DEPLOYMENT_TARGET) 38 | NSHumanReadableCopyright 39 | Copyright © 2019 $(BASE_ORGANIZATION_NAME). All rights reserved. 40 | NSMainStoryboardFile 41 | Main 42 | NSPrincipalClass 43 | NSApplication 44 | NSSupportsAutomaticTermination 45 | 46 | NSSupportsSuddenTermination 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Extension/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | $(PRODUCT_NAME) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSExtension 26 | 27 | NSExtensionAttributes 28 | 29 | XCSourceEditorCommandDefinitions 30 | 31 | 32 | XCSourceEditorCommandClassName 33 | $(PRODUCT_MODULE_NAME).FormatSelectedSourceCommand 34 | XCSourceEditorCommandIdentifier 35 | $(PRODUCT_BUNDLE_IDENTIFIER).FormatSelectedSourceCommand 36 | XCSourceEditorCommandName 37 | Format Selected Source 38 | 39 | 40 | XCSourceEditorCommandClassName 41 | $(PRODUCT_MODULE_NAME).FormatEntireFileCommand 42 | XCSourceEditorCommandIdentifier 43 | $(PRODUCT_BUNDLE_IDENTIFIER).FormatEntireFileCommand 44 | XCSourceEditorCommandName 45 | Format Entire File 46 | 47 | 48 | XCSourceEditorExtensionPrincipalClass 49 | $(PRODUCT_MODULE_NAME).SourceEditorExtension 50 | 51 | NSExtensionPointIdentifier 52 | com.apple.dt.Xcode.extension.source-editor 53 | 54 | NSHumanReadableCopyright 55 | Copyright © 2019 $(BASE_ORGANIZATION_NAME). All rights reserved. 56 | 57 | 58 | -------------------------------------------------------------------------------- /Shared/Sources/Security.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Security 3 | 4 | extension SecCode { 5 | public static func applicationGroups() throws -> [String] { 6 | let signingInformation = try hostCode().staticCode().signingInformation(with: [.signingInformation]) 7 | let entitlementsDictionary = signingInformation[String(kSecCodeInfoEntitlementsDict)] as? [String: Any] 8 | 9 | return entitlementsDictionary?["com.apple.security.application-groups"] as? [String] ?? [] 10 | } 11 | 12 | private static func hostCode(with flags: SecCSFlags = []) throws -> SecCode { 13 | var code: SecCode? 14 | let result = SecCodeCopySelf(flags, &code) 15 | if let code = code, result == noErr { 16 | return code 17 | } else { 18 | throw NSError.error(from: result) 19 | } 20 | } 21 | 22 | private func staticCode(with flags: SecCSFlags = []) throws -> SecStaticCode { 23 | var staticCode: SecStaticCode? 24 | let result = SecCodeCopyStaticCode(self, flags, &staticCode) 25 | if let staticCode = staticCode, result == noErr { 26 | return staticCode 27 | } else { 28 | throw NSError.error(from: result) 29 | } 30 | } 31 | } 32 | 33 | extension SecCSFlags { 34 | fileprivate static var signingInformation: SecCSFlags { 35 | return SecCSFlags(rawValue: kSecCSSigningInformation) 36 | } 37 | } 38 | 39 | extension SecStaticCode { 40 | /// Returns the code signing information. By default only returns "generic" information. Pass additional flags to retrieve more information. 41 | /// See "Signing Information Flags" in Apple documentation for more detail. See also the SecCode header in the SDK. 42 | fileprivate func signingInformation(with flags: SecCSFlags = []) throws -> [String: Any] { 43 | var signingInformation: CFDictionary? 44 | let result = SecCodeCopySigningInformation(self, flags, &signingInformation) 45 | if let signingInformation = (signingInformation as NSDictionary?) as? [String: Any], result == noErr { 46 | return signingInformation 47 | } else { 48 | throw NSError.error(from: result) 49 | } 50 | } 51 | } 52 | 53 | extension NSError { 54 | /// Creates an NSError instance for the specified `OSStatus` `status`. 55 | /// - parameter status: The OSStatus to convert to an NSError 56 | fileprivate static func error(from status: OSStatus) -> Self { 57 | return self.init(domain: NSOSStatusErrorDomain, code: Int(status), userInfo: nil) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Extension/Sources/SourceEditorExtension.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2019 The CocoaBots. All rights reserved. 2 | 3 | import Foundation 4 | import SwiftFormatConfiguration 5 | import XcodeKit 6 | 7 | class SourceEditorExtension: NSObject, XCSourceEditorExtension { 8 | static func loadConfiguration() -> SwiftFormatConfiguration.Configuration { 9 | guard 10 | let fileURL = try? configurationFileURL(), 11 | let loadedConfig = try? SwiftFormatConfiguration.Configuration.decodedConfiguration(fromFileURL: fileURL) 12 | else { 13 | return SwiftFormatConfiguration.Configuration() 14 | } 15 | 16 | return loadedConfig 17 | } 18 | 19 | private static func configurationFileURL() throws -> URL? { 20 | // First, read the regular bookmark because it could've been changed by the wrapper app. 21 | guard 22 | let regularBookmark = UserDefaults.applicationGroupDefaults.data(forKey: "RegularBookmark"), 23 | let securityScopedBookmark = UserDefaults.applicationGroupDefaults.data(forKey: "SecurityBookmark") 24 | else { 25 | return nil 26 | } 27 | 28 | // First, read the regular bookmark because it could've been changed by the wrapper app. 29 | var regularBookmarkIsStale = false 30 | let regularURL = try URL(resolvingBookmarkData: regularBookmark, options: [.withoutUI], relativeTo: nil, bookmarkDataIsStale: ®ularBookmarkIsStale) 31 | 32 | // Then read the security URL, which is the URL we're actually going to use to access the file. 33 | var securityScopedBookmarkIsStale = false 34 | 35 | // Clear out the security URL if it's no longer matching the regular URL. 36 | guard 37 | regularBookmarkIsStale == false, 38 | let securityScopedURL = try? URL(resolvingBookmarkData: securityScopedBookmark, options: [.withSecurityScope, .withoutUI], relativeTo: nil, bookmarkDataIsStale: &securityScopedBookmarkIsStale), 39 | securityScopedBookmarkIsStale == false, 40 | securityScopedURL.path == regularURL.path 41 | else { 42 | // Attempt to create new security URL from the regular URL to persist across system reboots. 43 | let newSecurityScopedBookmark = try regularURL.bookmarkData(options: [.withSecurityScope, .securityScopeAllowOnlyReadAccess], includingResourceValuesForKeys: nil, relativeTo: nil) 44 | UserDefaults.applicationGroupDefaults.set(newSecurityScopedBookmark, forKey: "SecurityBookmark") 45 | return regularURL 46 | } 47 | 48 | return securityScopedURL 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Extension/Sources/FormatEntireFileCommand.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2019 The CocoaBots. All rights reserved. 2 | 3 | import Foundation 4 | import SwiftFormat 5 | import SwiftFormatConfiguration 6 | import SwiftFormatCore 7 | import SwiftSyntax 8 | import TSCBasic 9 | import XcodeKit 10 | 11 | class FormatEntireFileCommand: NSObject, XCSourceEditorCommand { 12 | func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) { 13 | guard ["public.swift-source", "com.apple.dt.playground", "com.apple.dt.playgroundpage"].contains(invocation.buffer.contentUTI) else { 14 | return completionHandler(FormatCommandError.notSwiftLanguage(invocation.buffer.contentUTI)) 15 | } 16 | 17 | // Grab the entire file's contents 18 | let sourceToFormat = invocation.buffer.completeBuffer 19 | 20 | do { 21 | let configuration = SourceEditorExtension.loadConfiguration() 22 | let formatter = SwiftFormatter(configuration: configuration) 23 | let syntax = try SyntaxParser.parse(source: sourceToFormat) 24 | var buffer = BufferedOutputByteStream() 25 | // This isn't great - but Xcode doesn't give us the path to the currently edited file 26 | let dummyFileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString + ".swift") 27 | try formatter.format(syntax: syntax, assumingFileURL: dummyFileURL, to: &buffer) 28 | buffer.flush() 29 | 30 | guard 31 | let formattedSource = buffer.bytes.validDescription, 32 | formattedSource != sourceToFormat 33 | else { 34 | // No changes needed 35 | return completionHandler(nil) 36 | } 37 | 38 | // Remove all selections to avoid a crash when changing the contents of the buffer. 39 | invocation.buffer.selections.removeAllObjects() 40 | 41 | // Update buffer 42 | invocation.buffer.completeBuffer = formattedSource 43 | 44 | // For the time being, set the selection back to the last character of the buffer 45 | guard let lastLine = invocation.buffer.lines.lastObject as? String else { 46 | return completionHandler(FormatCommandError.invalidSelection) 47 | } 48 | let position = XCSourceTextPosition(line: invocation.buffer.lines.count - 1, column: lastLine.count) 49 | let updatedSelectionRange = XCSourceTextRange(start: position, end: position) 50 | invocation.buffer.selections.add(updatedSelectionRange) 51 | 52 | return completionHandler(nil) 53 | } catch { 54 | return completionHandler(error) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Shared/Configuration/Project-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // Architectures 2 | SDKROOT = macosx 3 | 4 | // Deployment 5 | COPY_PHASE_STRIP = NO 6 | MACOSX_DEPLOYMENT_TARGET = 10.14.4 7 | 8 | // Packaging 9 | PRODUCT_BUNDLE_IDENTIFIER = $(BASE_ORGANIZATION_IDENTIFIER).$(TARGET_NAME:rfc1034identifier) 10 | PRODUCT_NAME = $(PROJECT_NAME) 11 | 12 | // Search Paths 13 | ALWAYS_SEARCH_USER_PATHS = NO 14 | 15 | // Versioning 16 | CURRENT_PROJECT_VERSION = 5 17 | MARKETING_VERSION = 1.1.0 18 | VERSIONING_SYSTEM = apple-generic 19 | 20 | // Clang - Code Generation 21 | GCC_NO_COMMON_BLOCKS = YES 22 | GCC_DYNAMIC_NO_PIC = NO 23 | 24 | // Clang - Language - Modules 25 | CLANG_ENABLE_MODULES = YES 26 | 27 | // Clang - Language - Objective-C 28 | CLANG_ENABLE_OBJC_ARC = YES 29 | CLANG_ENABLE_OBJC_WEAK = YES 30 | 31 | // Clang - Preprocessing 32 | ENABLE_NS_ASSERTIONS = YES 33 | ENABLE_STRICT_OBJC_MSGSEND = YES 34 | GCC_PREPROCESSOR_DEFINITIONS = $(CONFIGURATION:upper:identifier)=1 $(inherited) 35 | 36 | // Clang - Warnings 37 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES 38 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES 39 | CLANG_WARN_EMPTY_BODY = YES 40 | CLANG_WARN_BOOL_CONVERSION = YES 41 | CLANG_WARN_CONSTANT_CONVERSION = YES 42 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 43 | CLANG_WARN_ENUM_CONVERSION = YES 44 | CLANG_WARN_INT_CONVERSION = YES 45 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES 46 | CLANG_WARN_INFINITE_RECURSION = YES 47 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 48 | CLANG_WARN_STRICT_PROTOTYPES = YES 49 | CLANG_WARN_COMMA = YES 50 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 51 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 52 | CLANG_WARN_UNREACHABLE_CODE = YES 53 | GCC_WARN_UNUSED_FUNCTION = YES 54 | GCC_WARN_UNUSED_VARIABLE = YES 55 | 56 | // Clang - Warnings - C++ 57 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES 58 | CLANG_WARN_SUSPICIOUS_MOVE = YES 59 | 60 | // Clang - Warnings - Objective-C 61 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 62 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 63 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES 64 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 65 | GCC_WARN_UNDECLARED_SELECTOR = YES 66 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 67 | 68 | // Clang - Warnings - Objective-C & ARC 69 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 70 | 71 | // Static Analyzer - Generic Issues 72 | CLANG_ANALYZER_NONNULL = YES 73 | 74 | // Static Analyzer - Issues - Apple APIs 75 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES 76 | CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES 77 | CLANG_ANALYZER_GCD_PERFORMANCE = YES 78 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE 79 | 80 | // Swift Compiler - Custom Flags 81 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(CONFIGURATION:upper:identifier) 82 | 83 | // Swift Compiler - Language 84 | SWIFT_VERSION = 5.1 85 | 86 | // User-Defined 87 | BASE_BUNDLE_IDENTIFIER = $(BASE_ORGANIZATION_IDENTIFIER).$(PROJECT_NAME:rfc1034identifier) 88 | BASE_ORGANIZATION_IDENTIFIER = com.thecocoabots 89 | BASE_ORGANIZATION_NAME = The CocoaBots 90 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/xcshareddata/xcschemes/SwiftFormatter Settings.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/xcshareddata/xcschemes/SwiftFormatter Extension.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | 46 | 50 | 51 | 52 | 58 | 59 | 60 | 61 | 68 | 69 | 75 | 76 | 77 | 78 | 80 | 81 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Application/Sources/ViewController.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | 3 | class ViewController: NSViewController { 4 | @IBOutlet var configurationFilePathControl: NSPathControl! 5 | 6 | override func viewDidLoad() { 7 | super.viewDidLoad() 8 | 9 | var isStale = false 10 | 11 | guard 12 | let bookmark = UserDefaults.applicationGroupDefaults.data(forKey: "SecurityBookmark"), 13 | let url = try? URL(resolvingBookmarkData: bookmark, options: [.withSecurityScope, .withoutUI], relativeTo: nil, bookmarkDataIsStale: &isStale), 14 | url.startAccessingSecurityScopedResource() 15 | else { 16 | // Remove the bookmark value from the storage 17 | UserDefaults.applicationGroupDefaults.removeObject(forKey: "RegularBookmark") 18 | return 19 | } 20 | 21 | // Regenerate the bookmark, so that the extension can read a valid bookmark after a system restart. 22 | let regularBookmark = try? url.bookmarkData() 23 | url.stopAccessingSecurityScopedResource() 24 | UserDefaults.applicationGroupDefaults.set(regularBookmark, forKey: "RegularBookmark") 25 | configurationFilePathControl.url = url 26 | } 27 | 28 | @IBAction func selectConfiguration(_ sender: NSPathControl) { 29 | guard 30 | let url = sender.url, 31 | let configurationFileURL = findConfigurationFile(from: url) 32 | else { 33 | return 34 | } 35 | 36 | selectURL(configurationFileURL) 37 | } 38 | 39 | // MARK: - Private Implementation - 40 | 41 | fileprivate func createBookmark(from url: URL) throws -> Data { 42 | // Create a bookmark and store into defaults. 43 | return try url.bookmarkData(options: [.withSecurityScope, .securityScopeAllowOnlyReadAccess], includingResourceValuesForKeys: nil, relativeTo: nil) 44 | } 45 | 46 | @discardableResult 47 | private func selectURL(_ url: URL) -> Bool { 48 | guard let bookmark = try? createBookmark(from: url) else { 49 | return false 50 | } 51 | 52 | configurationFilePathControl.url = url 53 | UserDefaults.applicationGroupDefaults.set(bookmark, forKey: "SecurityBookmark") 54 | UserDefaults.applicationGroupDefaults.set(try? url.bookmarkData(), forKey: "RegularBookmark") 55 | 56 | return true 57 | } 58 | 59 | fileprivate func findConfigurationFile(from url: URL) -> URL? { 60 | guard 61 | let resourceValues = try? url.resourceValues(forKeys: [.isDirectoryKey]), 62 | resourceValues.isDirectory ?? false 63 | else { 64 | return url 65 | } 66 | 67 | return url.appendingPathComponent(".swift-format") 68 | } 69 | } 70 | 71 | extension ViewController: NSPathControlDelegate { 72 | func pathControl(_ pathControl: NSPathControl, willDisplay openPanel: NSOpenPanel) { 73 | openPanel.title = NSLocalizedString("Choose a custom Swift Format JSON configuration file", comment: "Title for open panel when selecting a custom configuration file") 74 | openPanel.canChooseFiles = true 75 | openPanel.canChooseDirectories = true 76 | openPanel.showsHiddenFiles = true 77 | openPanel.treatsFilePackagesAsDirectories = true 78 | openPanel.allowsMultipleSelection = false 79 | } 80 | 81 | func pathControl(_ pathControl: NSPathControl, validateDrop info: NSDraggingInfo) -> NSDragOperation { 82 | guard 83 | let url = NSURL(from: info.draggingPasteboard), 84 | let configurationFileURL = findConfigurationFile(from: url as URL), 85 | let _ = try? createBookmark(from: configurationFileURL) 86 | else { 87 | return [] 88 | } 89 | 90 | return .copy 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Extension/Sources/FormatSelectedSourceCommand.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2019 The CocoaBots. All rights reserved. 2 | 3 | import Foundation 4 | import SwiftFormat 5 | import SwiftFormatConfiguration 6 | import SwiftFormatCore 7 | import SwiftSyntax 8 | import TSCBasic 9 | import XcodeKit 10 | 11 | class FormatSelectedSourceCommand: NSObject, XCSourceEditorCommand { 12 | func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) { 13 | guard ["public.swift-source", "com.apple.dt.playground", "com.apple.dt.playgroundpage"].contains(invocation.buffer.contentUTI) else { 14 | return completionHandler(FormatCommandError.notSwiftLanguage(invocation.buffer.contentUTI)) 15 | } 16 | 17 | guard let selection = invocation.buffer.selections.firstObject as? XCSourceTextRange else { 18 | return completionHandler(FormatCommandError.noSelection) 19 | } 20 | 21 | // Grab the selected source to format using entire lines of text 22 | let selectionRange = selection.start.line...min(selection.end.line, invocation.buffer.lines.count - 1) 23 | let sourceToFormat = selectionRange.flatMap { 24 | (invocation.buffer.lines[$0] as? String).map { [$0] } ?? [] 25 | }.joined() 26 | 27 | do { 28 | let configuration = SourceEditorExtension.loadConfiguration() 29 | let formatter = SwiftFormatter(configuration: configuration) 30 | let syntax = try SyntaxParser.parse(source: sourceToFormat) 31 | var buffer = BufferedOutputByteStream() 32 | // This isn't great - but Xcode doesn't give us the path to the currently edited file 33 | let dummyFileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString + ".swift") 34 | try formatter.format(syntax: syntax, assumingFileURL: dummyFileURL, to: &buffer) 35 | buffer.flush() 36 | 37 | guard 38 | let formattedSource = buffer.bytes.validDescription, 39 | formattedSource != sourceToFormat 40 | else { 41 | // No changes needed 42 | return completionHandler(nil) 43 | } 44 | 45 | // Remove all selections to avoid a crash when changing the contents of the buffer. 46 | invocation.buffer.selections.removeAllObjects() 47 | invocation.buffer.lines.removeObjects(in: NSMakeRange(selection.start.line, selectionRange.count)) 48 | invocation.buffer.lines.insert(formattedSource, at: selection.start.line) 49 | 50 | let updatedSelectionRange = rangeForDifferences( 51 | in: selection, between: sourceToFormat, and: formattedSource 52 | ) 53 | 54 | invocation.buffer.selections.add(updatedSelectionRange) 55 | 56 | return completionHandler(nil) 57 | } catch { 58 | return completionHandler(error) 59 | } 60 | } 61 | 62 | /// Given a source text range, an original source string and a modified target string this 63 | /// method will calculate the differences, and return a usable XCSourceTextRange based upon the original. 64 | /// 65 | /// - Parameters: 66 | /// - textRange: Existing source text range 67 | /// - sourceText: Original text 68 | /// - targetText: Modified text 69 | /// - Returns: Source text range that should be usable with the passed modified text 70 | private func rangeForDifferences( 71 | in textRange: XCSourceTextRange, 72 | between _: String, and targetText: String 73 | ) -> XCSourceTextRange { 74 | // Ensure that we're not greedy about end selections — this can cause empty lines to be removed 75 | let lineCountOfTarget = targetText.components(separatedBy: CharacterSet.newlines).count 76 | let finalLine = (textRange.end.column > 0) ? textRange.end.line : textRange.end.line - 1 77 | let range = textRange.start.line...finalLine 78 | let difference = range.count - lineCountOfTarget 79 | let start = XCSourceTextPosition(line: textRange.start.line, column: 0) 80 | let end = XCSourceTextPosition(line: finalLine - difference, column: 0) 81 | 82 | return XCSourceTextRange(start: start, end: end) 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /SwiftFormatter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 52; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 90D40CE52418C87000E993C2 /* SwiftToolsSupport-auto in Frameworks */ = {isa = PBXBuildFile; productRef = 90D40CE42418C87000E993C2 /* SwiftToolsSupport-auto */; }; 11 | 90D40CE72418C92400E993C2 /* SwiftFormatConfiguration in Frameworks */ = {isa = PBXBuildFile; productRef = 90D40CE62418C92400E993C2 /* SwiftFormatConfiguration */; }; 12 | EA44E31E22E323AA009E9B3D /* CommandErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA44E31D22E323AA009E9B3D /* CommandErrors.swift */; }; 13 | EA44E32522E32A06009E9B3D /* SwiftFormat in Frameworks */ = {isa = PBXBuildFile; productRef = EA44E32422E32A06009E9B3D /* SwiftFormat */; }; 14 | EA963AF822E36117007F124E /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC38C3822E2F403001995F0 /* Configuration.swift */; }; 15 | EA963AF922E36117007F124E /* Security.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F21722E2BDE600BFD9A8 /* Security.swift */; }; 16 | EA963AFA22E36117007F124E /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F21922E2BDF700BFD9A8 /* UserDefaults.swift */; }; 17 | EA963AFB22E36117007F124E /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC38C3822E2F403001995F0 /* Configuration.swift */; }; 18 | EA963AFC22E36117007F124E /* Security.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F21722E2BDE600BFD9A8 /* Security.swift */; }; 19 | EA963AFD22E36117007F124E /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F21922E2BDF700BFD9A8 /* UserDefaults.swift */; }; 20 | EA963B0222E3612A007F124E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5F1A222E2B31800BFD9A8 /* Cocoa.framework */; }; 21 | EAABE65022E468F10015128B /* FormatEntireFileCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAABE64F22E468F10015128B /* FormatEntireFileCommand.swift */; }; 22 | EAABE65122E481B70015128B /* lib_InternalSwiftSyntaxParser.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EA45FEA622E466F700F9DB05 /* lib_InternalSwiftSyntaxParser.dylib */; }; 23 | EAABE65222E481B70015128B /* lib_InternalSwiftSyntaxParser.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = EA45FEA622E466F700F9DB05 /* lib_InternalSwiftSyntaxParser.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 24 | EAC5F1BB22E2B3B400BFD9A8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5F1A222E2B31800BFD9A8 /* Cocoa.framework */; }; 25 | EAC5F1BE22E2B3B400BFD9A8 /* SourceEditorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F1BD22E2B3B400BFD9A8 /* SourceEditorExtension.swift */; }; 26 | EAC5F1C022E2B3B400BFD9A8 /* FormatSelectedSourceCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F1BF22E2B3B400BFD9A8 /* FormatSelectedSourceCommand.swift */; }; 27 | EAC5F1C622E2B3C400BFD9A8 /* XcodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5F1B222E2B33600BFD9A8 /* XcodeKit.framework */; }; 28 | EAC5F1D022E2B3EA00BFD9A8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F1CF22E2B3EA00BFD9A8 /* AppDelegate.swift */; }; 29 | EAC5F1D222E2B3EA00BFD9A8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC5F1D122E2B3EA00BFD9A8 /* ViewController.swift */; }; 30 | EAC5F1D422E2B3EA00BFD9A8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAC5F1D322E2B3EA00BFD9A8 /* Assets.xcassets */; }; 31 | EAC5F1D722E2B3EA00BFD9A8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAC5F1D522E2B3EA00BFD9A8 /* Main.storyboard */; }; 32 | EAC5F20822E2BD6000BFD9A8 /* SwiftFormatter.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = EAC5F1BA22E2B3B400BFD9A8 /* SwiftFormatter.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXContainerItemProxy section */ 36 | EAC5F20922E2BD6000BFD9A8 /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = EAC5F17E22E2B27B00BFD9A8 /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = EAC5F1B922E2B3B400BFD9A8; 41 | remoteInfo = "Swift Format"; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXCopyFilesBuildPhase section */ 46 | EAABE65322E481B70015128B /* Embed Libraries */ = { 47 | isa = PBXCopyFilesBuildPhase; 48 | buildActionMask = 2147483647; 49 | dstPath = ""; 50 | dstSubfolderSpec = 10; 51 | files = ( 52 | EAABE65222E481B70015128B /* lib_InternalSwiftSyntaxParser.dylib in Embed Libraries */, 53 | ); 54 | name = "Embed Libraries"; 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | EAC5F20F22E2BD6000BFD9A8 /* Embed App Extensions */ = { 58 | isa = PBXCopyFilesBuildPhase; 59 | buildActionMask = 2147483647; 60 | dstPath = ""; 61 | dstSubfolderSpec = 13; 62 | files = ( 63 | EAC5F20822E2BD6000BFD9A8 /* SwiftFormatter.appex in Embed App Extensions */, 64 | ); 65 | name = "Embed App Extensions"; 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXCopyFilesBuildPhase section */ 69 | 70 | /* Begin PBXFileReference section */ 71 | EA44E31D22E323AA009E9B3D /* CommandErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandErrors.swift; sourceTree = ""; }; 72 | EA45FEA622E466F700F9DB05 /* lib_InternalSwiftSyntaxParser.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = lib_InternalSwiftSyntaxParser.dylib; path = Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib; sourceTree = DEVELOPER_DIR; }; 73 | EAABE64F22E468F10015128B /* FormatEntireFileCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatEntireFileCommand.swift; sourceTree = ""; }; 74 | EAC38C3822E2F403001995F0 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; 75 | EAC5F1A222E2B31800BFD9A8 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 76 | EAC5F1B222E2B33600BFD9A8 /* XcodeKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XcodeKit.framework; path = Library/Frameworks/XcodeKit.framework; sourceTree = DEVELOPER_DIR; }; 77 | EAC5F1BA22E2B3B400BFD9A8 /* SwiftFormatter.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SwiftFormatter.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | EAC5F1BD22E2B3B400BFD9A8 /* SourceEditorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorExtension.swift; sourceTree = ""; }; 79 | EAC5F1BF22E2B3B400BFD9A8 /* FormatSelectedSourceCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatSelectedSourceCommand.swift; sourceTree = ""; }; 80 | EAC5F1C122E2B3B400BFD9A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 81 | EAC5F1C222E2B3B400BFD9A8 /* Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Extension.entitlements; sourceTree = ""; }; 82 | EAC5F1CD22E2B3EA00BFD9A8 /* SwiftFormatter Settings.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftFormatter Settings.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | EAC5F1CF22E2B3EA00BFD9A8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 84 | EAC5F1D122E2B3EA00BFD9A8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 85 | EAC5F1D322E2B3EA00BFD9A8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 86 | EAC5F1D622E2B3EA00BFD9A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 87 | EAC5F1D822E2B3EA00BFD9A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 88 | EAC5F1D922E2B3EA00BFD9A8 /* Application.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Application.entitlements; sourceTree = ""; }; 89 | EAC5F1EA22E2B51400BFD9A8 /* Extension-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Extension-Shared.xcconfig"; sourceTree = ""; }; 90 | EAC5F1EB22E2B51400BFD9A8 /* Extension-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Extension-Debug.xcconfig"; sourceTree = ""; }; 91 | EAC5F1EC22E2B51400BFD9A8 /* Extension-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Extension-Release.xcconfig"; sourceTree = ""; }; 92 | EAC5F1ED22E2B51A00BFD9A8 /* Application-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Application-Shared.xcconfig"; sourceTree = ""; }; 93 | EAC5F1EE22E2B51A00BFD9A8 /* Application-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Application-Debug.xcconfig"; sourceTree = ""; }; 94 | EAC5F1EF22E2B51A00BFD9A8 /* Application-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Application-Release.xcconfig"; sourceTree = ""; }; 95 | EAC5F1F022E2B52A00BFD9A8 /* Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Debug.xcconfig"; sourceTree = ""; }; 96 | EAC5F1F122E2B52A00BFD9A8 /* Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Release.xcconfig"; sourceTree = ""; }; 97 | EAC5F1F222E2B52A00BFD9A8 /* Project-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Shared.xcconfig"; sourceTree = ""; }; 98 | EAC5F21722E2BDE600BFD9A8 /* Security.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Security.swift; sourceTree = ""; }; 99 | EAC5F21922E2BDF700BFD9A8 /* UserDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaults.swift; sourceTree = ""; }; 100 | /* End PBXFileReference section */ 101 | 102 | /* Begin PBXFrameworksBuildPhase section */ 103 | EAC5F1B722E2B3B400BFD9A8 /* Frameworks */ = { 104 | isa = PBXFrameworksBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | EAC5F1BB22E2B3B400BFD9A8 /* Cocoa.framework in Frameworks */, 108 | EAC5F1C622E2B3C400BFD9A8 /* XcodeKit.framework in Frameworks */, 109 | EAABE65122E481B70015128B /* lib_InternalSwiftSyntaxParser.dylib in Frameworks */, 110 | EA44E32522E32A06009E9B3D /* SwiftFormat in Frameworks */, 111 | 90D40CE52418C87000E993C2 /* SwiftToolsSupport-auto in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | EAC5F21022E2BD6000BFD9A8 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | 90D40CE72418C92400E993C2 /* SwiftFormatConfiguration in Frameworks */, 120 | EA963B0222E3612A007F124E /* Cocoa.framework in Frameworks */, 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | /* End PBXFrameworksBuildPhase section */ 125 | 126 | /* Begin PBXGroup section */ 127 | EAC5F17D22E2B27B00BFD9A8 = { 128 | isa = PBXGroup; 129 | children = ( 130 | EAC5F1CE22E2B3EA00BFD9A8 /* Application */, 131 | EAC5F1BC22E2B3B400BFD9A8 /* Extension */, 132 | EAC5F1E522E2B4C000BFD9A8 /* Shared */, 133 | EAC5F1A122E2B31800BFD9A8 /* Frameworks */, 134 | EAC5F18722E2B27B00BFD9A8 /* Products */, 135 | ); 136 | sourceTree = ""; 137 | }; 138 | EAC5F18722E2B27B00BFD9A8 /* Products */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | EAC5F1BA22E2B3B400BFD9A8 /* SwiftFormatter.appex */, 142 | EAC5F1CD22E2B3EA00BFD9A8 /* SwiftFormatter Settings.app */, 143 | ); 144 | name = Products; 145 | sourceTree = ""; 146 | }; 147 | EAC5F1A122E2B31800BFD9A8 /* Frameworks */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | EAC5F1A222E2B31800BFD9A8 /* Cocoa.framework */, 151 | EA45FEA622E466F700F9DB05 /* lib_InternalSwiftSyntaxParser.dylib */, 152 | EAC5F1B222E2B33600BFD9A8 /* XcodeKit.framework */, 153 | ); 154 | name = Frameworks; 155 | sourceTree = ""; 156 | }; 157 | EAC5F1BC22E2B3B400BFD9A8 /* Extension */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | EAC5F1E922E2B4CB00BFD9A8 /* Configuration */, 161 | EAC5F1E322E2B45700BFD9A8 /* Resources */, 162 | EAC5F1E222E2B45700BFD9A8 /* Sources */, 163 | EAC5F1E422E2B45700BFD9A8 /* Supporting Files */, 164 | ); 165 | path = Extension; 166 | sourceTree = ""; 167 | }; 168 | EAC5F1CE22E2B3EA00BFD9A8 /* Application */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | EAC5F1E822E2B4C700BFD9A8 /* Configuration */, 172 | EAC5F1DF22E2B44D00BFD9A8 /* Resources */, 173 | EAC5F1E122E2B44D00BFD9A8 /* Sources */, 174 | EAC5F1E022E2B44D00BFD9A8 /* Supporting Files */, 175 | ); 176 | path = Application; 177 | sourceTree = ""; 178 | }; 179 | EAC5F1DF22E2B44D00BFD9A8 /* Resources */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | EAC5F1D322E2B3EA00BFD9A8 /* Assets.xcassets */, 183 | ); 184 | path = Resources; 185 | sourceTree = ""; 186 | }; 187 | EAC5F1E022E2B44D00BFD9A8 /* Supporting Files */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | EAC5F1D922E2B3EA00BFD9A8 /* Application.entitlements */, 191 | EAC5F1D822E2B3EA00BFD9A8 /* Info.plist */, 192 | ); 193 | path = "Supporting Files"; 194 | sourceTree = ""; 195 | }; 196 | EAC5F1E122E2B44D00BFD9A8 /* Sources */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | EAC5F1CF22E2B3EA00BFD9A8 /* AppDelegate.swift */, 200 | EAC5F1D522E2B3EA00BFD9A8 /* Main.storyboard */, 201 | EAC5F1D122E2B3EA00BFD9A8 /* ViewController.swift */, 202 | ); 203 | path = Sources; 204 | sourceTree = ""; 205 | }; 206 | EAC5F1E222E2B45700BFD9A8 /* Sources */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | EA44E31D22E323AA009E9B3D /* CommandErrors.swift */, 210 | EAABE64F22E468F10015128B /* FormatEntireFileCommand.swift */, 211 | EAC5F1BF22E2B3B400BFD9A8 /* FormatSelectedSourceCommand.swift */, 212 | EAC5F1BD22E2B3B400BFD9A8 /* SourceEditorExtension.swift */, 213 | ); 214 | path = Sources; 215 | sourceTree = ""; 216 | }; 217 | EAC5F1E322E2B45700BFD9A8 /* Resources */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | ); 221 | path = Resources; 222 | sourceTree = ""; 223 | }; 224 | EAC5F1E422E2B45700BFD9A8 /* Supporting Files */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | EAC5F1C122E2B3B400BFD9A8 /* Info.plist */, 228 | EAC5F1C222E2B3B400BFD9A8 /* Extension.entitlements */, 229 | ); 230 | path = "Supporting Files"; 231 | sourceTree = ""; 232 | }; 233 | EAC5F1E522E2B4C000BFD9A8 /* Shared */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | EAC5F1E622E2B4C000BFD9A8 /* Configuration */, 237 | EAC5F1E722E2B4C000BFD9A8 /* Sources */, 238 | ); 239 | path = Shared; 240 | sourceTree = ""; 241 | }; 242 | EAC5F1E622E2B4C000BFD9A8 /* Configuration */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | EAC5F1F022E2B52A00BFD9A8 /* Project-Debug.xcconfig */, 246 | EAC5F1F122E2B52A00BFD9A8 /* Project-Release.xcconfig */, 247 | EAC5F1F222E2B52A00BFD9A8 /* Project-Shared.xcconfig */, 248 | ); 249 | path = Configuration; 250 | sourceTree = ""; 251 | }; 252 | EAC5F1E722E2B4C000BFD9A8 /* Sources */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | EAC38C3822E2F403001995F0 /* Configuration.swift */, 256 | EAC5F21722E2BDE600BFD9A8 /* Security.swift */, 257 | EAC5F21922E2BDF700BFD9A8 /* UserDefaults.swift */, 258 | ); 259 | path = Sources; 260 | sourceTree = ""; 261 | }; 262 | EAC5F1E822E2B4C700BFD9A8 /* Configuration */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | EAC5F1EE22E2B51A00BFD9A8 /* Application-Debug.xcconfig */, 266 | EAC5F1EF22E2B51A00BFD9A8 /* Application-Release.xcconfig */, 267 | EAC5F1ED22E2B51A00BFD9A8 /* Application-Shared.xcconfig */, 268 | ); 269 | path = Configuration; 270 | sourceTree = ""; 271 | }; 272 | EAC5F1E922E2B4CB00BFD9A8 /* Configuration */ = { 273 | isa = PBXGroup; 274 | children = ( 275 | EAC5F1EB22E2B51400BFD9A8 /* Extension-Debug.xcconfig */, 276 | EAC5F1EC22E2B51400BFD9A8 /* Extension-Release.xcconfig */, 277 | EAC5F1EA22E2B51400BFD9A8 /* Extension-Shared.xcconfig */, 278 | ); 279 | path = Configuration; 280 | sourceTree = ""; 281 | }; 282 | /* End PBXGroup section */ 283 | 284 | /* Begin PBXNativeTarget section */ 285 | EAC5F1B922E2B3B400BFD9A8 /* Extension */ = { 286 | isa = PBXNativeTarget; 287 | buildConfigurationList = EAC5F1C322E2B3B400BFD9A8 /* Build configuration list for PBXNativeTarget "Extension" */; 288 | buildPhases = ( 289 | EAC5F1B622E2B3B400BFD9A8 /* Sources */, 290 | EAC5F1B722E2B3B400BFD9A8 /* Frameworks */, 291 | EAABE65322E481B70015128B /* Embed Libraries */, 292 | ); 293 | buildRules = ( 294 | ); 295 | dependencies = ( 296 | ); 297 | name = Extension; 298 | packageProductDependencies = ( 299 | EA44E32422E32A06009E9B3D /* SwiftFormat */, 300 | 90D40CE42418C87000E993C2 /* SwiftToolsSupport-auto */, 301 | ); 302 | productName = "Swift Format"; 303 | productReference = EAC5F1BA22E2B3B400BFD9A8 /* SwiftFormatter.appex */; 304 | productType = "com.apple.product-type.xcode-extension"; 305 | }; 306 | EAC5F1CC22E2B3EA00BFD9A8 /* Settings */ = { 307 | isa = PBXNativeTarget; 308 | buildConfigurationList = EAC5F1DA22E2B3EA00BFD9A8 /* Build configuration list for PBXNativeTarget "Settings" */; 309 | buildPhases = ( 310 | EAC5F1C922E2B3EA00BFD9A8 /* Sources */, 311 | EAC5F1CB22E2B3EA00BFD9A8 /* Resources */, 312 | EAC5F20F22E2BD6000BFD9A8 /* Embed App Extensions */, 313 | EAC5F21022E2BD6000BFD9A8 /* Frameworks */, 314 | ); 315 | buildRules = ( 316 | ); 317 | dependencies = ( 318 | EAC5F20A22E2BD6000BFD9A8 /* PBXTargetDependency */, 319 | ); 320 | name = Settings; 321 | packageProductDependencies = ( 322 | 90D40CE62418C92400E993C2 /* SwiftFormatConfiguration */, 323 | ); 324 | productName = "Swift Format Settings"; 325 | productReference = EAC5F1CD22E2B3EA00BFD9A8 /* SwiftFormatter Settings.app */; 326 | productType = "com.apple.product-type.application"; 327 | }; 328 | /* End PBXNativeTarget section */ 329 | 330 | /* Begin PBXProject section */ 331 | EAC5F17E22E2B27B00BFD9A8 /* Project object */ = { 332 | isa = PBXProject; 333 | attributes = { 334 | LastSwiftUpdateCheck = 1100; 335 | LastUpgradeCheck = 1120; 336 | ORGANIZATIONNAME = "The CocoaBots"; 337 | TargetAttributes = { 338 | EAC5F1B922E2B3B400BFD9A8 = { 339 | CreatedOnToolsVersion = 11.0; 340 | }; 341 | EAC5F1CC22E2B3EA00BFD9A8 = { 342 | CreatedOnToolsVersion = 11.0; 343 | }; 344 | }; 345 | }; 346 | buildConfigurationList = EAC5F18122E2B27B00BFD9A8 /* Build configuration list for PBXProject "SwiftFormatter" */; 347 | compatibilityVersion = "Xcode 11.0"; 348 | developmentRegion = en; 349 | hasScannedForEncodings = 0; 350 | knownRegions = ( 351 | en, 352 | Base, 353 | ); 354 | mainGroup = EAC5F17D22E2B27B00BFD9A8; 355 | packageReferences = ( 356 | EAC38C3222E2F323001995F0 /* XCRemoteSwiftPackageReference "swift-format" */, 357 | 90D40CE32418C87000E993C2 /* XCRemoteSwiftPackageReference "swift-tools-support-core" */, 358 | ); 359 | productRefGroup = EAC5F18722E2B27B00BFD9A8 /* Products */; 360 | projectDirPath = ""; 361 | projectRoot = ""; 362 | targets = ( 363 | EAC5F1CC22E2B3EA00BFD9A8 /* Settings */, 364 | EAC5F1B922E2B3B400BFD9A8 /* Extension */, 365 | ); 366 | }; 367 | /* End PBXProject section */ 368 | 369 | /* Begin PBXResourcesBuildPhase section */ 370 | EAC5F1CB22E2B3EA00BFD9A8 /* Resources */ = { 371 | isa = PBXResourcesBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | EAC5F1D422E2B3EA00BFD9A8 /* Assets.xcassets in Resources */, 375 | EAC5F1D722E2B3EA00BFD9A8 /* Main.storyboard in Resources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | /* End PBXResourcesBuildPhase section */ 380 | 381 | /* Begin PBXSourcesBuildPhase section */ 382 | EAC5F1B622E2B3B400BFD9A8 /* Sources */ = { 383 | isa = PBXSourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | EAC5F1BE22E2B3B400BFD9A8 /* SourceEditorExtension.swift in Sources */, 387 | EAC5F1C022E2B3B400BFD9A8 /* FormatSelectedSourceCommand.swift in Sources */, 388 | EA963AFD22E36117007F124E /* UserDefaults.swift in Sources */, 389 | EA963AFB22E36117007F124E /* Configuration.swift in Sources */, 390 | EA963AFC22E36117007F124E /* Security.swift in Sources */, 391 | EAABE65022E468F10015128B /* FormatEntireFileCommand.swift in Sources */, 392 | EA44E31E22E323AA009E9B3D /* CommandErrors.swift in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | EAC5F1C922E2B3EA00BFD9A8 /* Sources */ = { 397 | isa = PBXSourcesBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | EA963AF822E36117007F124E /* Configuration.swift in Sources */, 401 | EA963AFA22E36117007F124E /* UserDefaults.swift in Sources */, 402 | EA963AF922E36117007F124E /* Security.swift in Sources */, 403 | EAC5F1D222E2B3EA00BFD9A8 /* ViewController.swift in Sources */, 404 | EAC5F1D022E2B3EA00BFD9A8 /* AppDelegate.swift in Sources */, 405 | ); 406 | runOnlyForDeploymentPostprocessing = 0; 407 | }; 408 | /* End PBXSourcesBuildPhase section */ 409 | 410 | /* Begin PBXTargetDependency section */ 411 | EAC5F20A22E2BD6000BFD9A8 /* PBXTargetDependency */ = { 412 | isa = PBXTargetDependency; 413 | target = EAC5F1B922E2B3B400BFD9A8 /* Extension */; 414 | targetProxy = EAC5F20922E2BD6000BFD9A8 /* PBXContainerItemProxy */; 415 | }; 416 | /* End PBXTargetDependency section */ 417 | 418 | /* Begin PBXVariantGroup section */ 419 | EAC5F1D522E2B3EA00BFD9A8 /* Main.storyboard */ = { 420 | isa = PBXVariantGroup; 421 | children = ( 422 | EAC5F1D622E2B3EA00BFD9A8 /* Base */, 423 | ); 424 | name = Main.storyboard; 425 | sourceTree = ""; 426 | }; 427 | /* End PBXVariantGroup section */ 428 | 429 | /* Begin XCBuildConfiguration section */ 430 | EAC5F19422E2B27C00BFD9A8 /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | baseConfigurationReference = EAC5F1F022E2B52A00BFD9A8 /* Project-Debug.xcconfig */; 433 | buildSettings = { 434 | MACOSX_DEPLOYMENT_TARGET = 10.14.5; 435 | }; 436 | name = Debug; 437 | }; 438 | EAC5F19522E2B27C00BFD9A8 /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = EAC5F1F122E2B52A00BFD9A8 /* Project-Release.xcconfig */; 441 | buildSettings = { 442 | MACOSX_DEPLOYMENT_TARGET = 10.14.5; 443 | }; 444 | name = Release; 445 | }; 446 | EAC5F1C422E2B3B400BFD9A8 /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | baseConfigurationReference = EAC5F1EB22E2B51400BFD9A8 /* Extension-Debug.xcconfig */; 449 | buildSettings = { 450 | CODE_SIGN_ENTITLEMENTS = "Extension/Supporting Files/Extension.entitlements"; 451 | }; 452 | name = Debug; 453 | }; 454 | EAC5F1C522E2B3B400BFD9A8 /* Release */ = { 455 | isa = XCBuildConfiguration; 456 | baseConfigurationReference = EAC5F1EC22E2B51400BFD9A8 /* Extension-Release.xcconfig */; 457 | buildSettings = { 458 | CODE_SIGN_ENTITLEMENTS = "Extension/Supporting Files/Extension.entitlements"; 459 | }; 460 | name = Release; 461 | }; 462 | EAC5F1DB22E2B3EA00BFD9A8 /* Debug */ = { 463 | isa = XCBuildConfiguration; 464 | baseConfigurationReference = EAC5F1EE22E2B51A00BFD9A8 /* Application-Debug.xcconfig */; 465 | buildSettings = { 466 | CODE_SIGN_ENTITLEMENTS = "Application/Supporting Files/Application.entitlements"; 467 | LD_RUNPATH_SEARCH_PATHS = ( 468 | "$(inherited)", 469 | "@executable_path/../Frameworks", 470 | ); 471 | }; 472 | name = Debug; 473 | }; 474 | EAC5F1DC22E2B3EA00BFD9A8 /* Release */ = { 475 | isa = XCBuildConfiguration; 476 | baseConfigurationReference = EAC5F1EF22E2B51A00BFD9A8 /* Application-Release.xcconfig */; 477 | buildSettings = { 478 | CODE_SIGN_ENTITLEMENTS = "Application/Supporting Files/Application.entitlements"; 479 | LD_RUNPATH_SEARCH_PATHS = ( 480 | "$(inherited)", 481 | "@executable_path/../Frameworks", 482 | ); 483 | }; 484 | name = Release; 485 | }; 486 | /* End XCBuildConfiguration section */ 487 | 488 | /* Begin XCConfigurationList section */ 489 | EAC5F18122E2B27B00BFD9A8 /* Build configuration list for PBXProject "SwiftFormatter" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | EAC5F19422E2B27C00BFD9A8 /* Debug */, 493 | EAC5F19522E2B27C00BFD9A8 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | EAC5F1C322E2B3B400BFD9A8 /* Build configuration list for PBXNativeTarget "Extension" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | EAC5F1C422E2B3B400BFD9A8 /* Debug */, 502 | EAC5F1C522E2B3B400BFD9A8 /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | EAC5F1DA22E2B3EA00BFD9A8 /* Build configuration list for PBXNativeTarget "Settings" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | EAC5F1DB22E2B3EA00BFD9A8 /* Debug */, 511 | EAC5F1DC22E2B3EA00BFD9A8 /* Release */, 512 | ); 513 | defaultConfigurationIsVisible = 0; 514 | defaultConfigurationName = Release; 515 | }; 516 | /* End XCConfigurationList section */ 517 | 518 | /* Begin XCRemoteSwiftPackageReference section */ 519 | 90D40CE32418C87000E993C2 /* XCRemoteSwiftPackageReference "swift-tools-support-core" */ = { 520 | isa = XCRemoteSwiftPackageReference; 521 | repositoryURL = "https://github.com/apple/swift-tools-support-core.git"; 522 | requirement = { 523 | kind = upToNextMajorVersion; 524 | minimumVersion = 0.0.1; 525 | }; 526 | }; 527 | EAC38C3222E2F323001995F0 /* XCRemoteSwiftPackageReference "swift-format" */ = { 528 | isa = XCRemoteSwiftPackageReference; 529 | repositoryURL = "https://github.com/apple/swift-format.git"; 530 | requirement = { 531 | branch = master; 532 | kind = branch; 533 | }; 534 | }; 535 | /* End XCRemoteSwiftPackageReference section */ 536 | 537 | /* Begin XCSwiftPackageProductDependency section */ 538 | 90D40CE42418C87000E993C2 /* SwiftToolsSupport-auto */ = { 539 | isa = XCSwiftPackageProductDependency; 540 | package = 90D40CE32418C87000E993C2 /* XCRemoteSwiftPackageReference "swift-tools-support-core" */; 541 | productName = "SwiftToolsSupport-auto"; 542 | }; 543 | 90D40CE62418C92400E993C2 /* SwiftFormatConfiguration */ = { 544 | isa = XCSwiftPackageProductDependency; 545 | package = EAC38C3222E2F323001995F0 /* XCRemoteSwiftPackageReference "swift-format" */; 546 | productName = SwiftFormatConfiguration; 547 | }; 548 | EA44E32422E32A06009E9B3D /* SwiftFormat */ = { 549 | isa = XCSwiftPackageProductDependency; 550 | package = EAC38C3222E2F323001995F0 /* XCRemoteSwiftPackageReference "swift-format" */; 551 | productName = SwiftFormat; 552 | }; 553 | /* End XCSwiftPackageProductDependency section */ 554 | }; 555 | rootObject = EAC5F17E22E2B27B00BFD9A8 /* Project object */; 556 | } 557 | -------------------------------------------------------------------------------- /Application/Sources/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | Default 531 | 532 | 533 | 534 | 535 | 536 | 537 | Left to Right 538 | 539 | 540 | 541 | 542 | 543 | 544 | Right to Left 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | Default 556 | 557 | 558 | 559 | 560 | 561 | 562 | Left to Right 563 | 564 | 565 | 566 | 567 | 568 | 569 | Right to Left 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | --------------------------------------------------------------------------------