diff --git a/SwiftFormat.xcodeproj/project.pbxproj b/SwiftFormat.xcodeproj/project.pbxproj index 90f00466..4793a334 100644 --- a/SwiftFormat.xcodeproj/project.pbxproj +++ b/SwiftFormat.xcodeproj/project.pbxproj @@ -22,6 +22,20 @@ 01B3987B1D763424009ADE61 /* FormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B3987A1D763424009ADE61 /* FormatterTests.swift */; }; 01B3987D1D763493009ADE61 /* Formatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B3987C1D763493009ADE61 /* Formatter.swift */; }; 01B3987F1D7634A0009ADE61 /* Formatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B3987C1D763493009ADE61 /* Formatter.swift */; }; + 9028F7831DA4B435009FE5B4 /* SwiftFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A0EAC41D5DB54A00A0A8E3 /* SwiftFormat.swift */; }; + 9028F7841DA4B435009FE5B4 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A0EABF1D5DB4F700A0A8E3 /* Tokenizer.swift */; }; + 9028F7851DA4B435009FE5B4 /* Formatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B3987C1D763493009ADE61 /* Formatter.swift */; }; + 9028F7861DA4B435009FE5B4 /* Rules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A0EABE1D5DB4F700A0A8E3 /* Rules.swift */; }; + 90C4B6CD1DA4B04A009EB000 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C4B6CC1DA4B04A009EB000 /* AppDelegate.swift */; }; + 90C4B6CF1DA4B04A009EB000 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C4B6CE1DA4B04A009EB000 /* ViewController.swift */; }; + 90C4B6D11DA4B04A009EB000 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90C4B6D01DA4B04A009EB000 /* Assets.xcassets */; }; + 90C4B6D41DA4B04A009EB000 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90C4B6D21DA4B04A009EB000 /* Main.storyboard */; }; + 90C4B6E01DA4B059009EB000 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90C4B6DF1DA4B059009EB000 /* Cocoa.framework */; }; + 90C4B6E51DA4B059009EB000 /* SourceEditorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C4B6E41DA4B059009EB000 /* SourceEditorExtension.swift */; }; + 90C4B6E71DA4B059009EB000 /* FormatSelectedSourceCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C4B6E61DA4B059009EB000 /* FormatSelectedSourceCommand.swift */; }; + 90C4B6EB1DA4B059009EB000 /* SwiftFormat.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 90C4B6DD1DA4B059009EB000 /* SwiftFormat.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 90F16AF81DA5EB4600EB4EA1 /* FormatEntireFileCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90F16AF71DA5EB4600EB4EA1 /* FormatEntireFileCommand.swift */; }; + 90F16AFB1DA5ED9A00EB4EA1 /* CommandErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90F16AFA1DA5ED9A00EB4EA1 /* CommandErrors.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -32,8 +46,29 @@ remoteGlobalIDString = 01A0EAA31D5DB4CF00A0A8E3; remoteInfo = SwiftFormat; }; + 90C4B6E91DA4B059009EB000 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 01A0EA9B1D5DB4CF00A0A8E3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 90C4B6DC1DA4B059009EB000; + remoteInfo = "Swift Formatter"; + }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 90C4B6EF1DA4B059009EB000 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 90C4B6EB1DA4B059009EB000 /* SwiftFormat.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 0142F06E1D72FE10007D66CC /* SwiftFormatTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftFormatTests.swift; sourceTree = ""; }; 018E82741D62E730008CA0F8 /* TokenizerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenizerTests.swift; sourceTree = ""; }; @@ -50,6 +85,21 @@ 01A0EACC1D5DB5F500A0A8E3 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 01B3987A1D763424009ADE61 /* FormatterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormatterTests.swift; sourceTree = ""; }; 01B3987C1D763493009ADE61 /* Formatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Formatter.swift; sourceTree = ""; }; + 90C4B6CA1DA4B04A009EB000 /* SwiftFormat for Xcode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftFormat for Xcode.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 90C4B6CC1DA4B04A009EB000 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 90C4B6CE1DA4B04A009EB000 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 90C4B6D01DA4B04A009EB000 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 90C4B6D31DA4B04A009EB000 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 90C4B6D51DA4B04A009EB000 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 90C4B6DD1DA4B059009EB000 /* SwiftFormat.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SwiftFormat.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 90C4B6DF1DA4B059009EB000 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 90C4B6E31DA4B059009EB000 /* SwiftFormatter.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SwiftFormatter.entitlements; sourceTree = ""; }; + 90C4B6E41DA4B059009EB000 /* SourceEditorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorExtension.swift; sourceTree = ""; }; + 90C4B6E61DA4B059009EB000 /* FormatSelectedSourceCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatSelectedSourceCommand.swift; sourceTree = ""; }; + 90C4B6E81DA4B059009EB000 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 90CB44D81DA4B56500F86C22 /* SwiftFormatter.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SwiftFormatter.entitlements; sourceTree = ""; }; + 90F16AF71DA5EB4600EB4EA1 /* FormatEntireFileCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormatEntireFileCommand.swift; sourceTree = ""; }; + 90F16AFA1DA5ED9A00EB4EA1 /* CommandErrors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandErrors.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,6 +125,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 90C4B6C71DA4B04A009EB000 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 90C4B6DA1DA4B059009EB000 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 90C4B6E01DA4B059009EB000 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -84,6 +149,8 @@ 01A0EACB1D5DB5F500A0A8E3 /* CommandLineTool */, 01A0EAA61D5DB4CF00A0A8E3 /* SwiftFormat */, 01A0EAB21D5DB4D000A0A8E3 /* SwiftFormatTests */, + 90C4B6F01DA4B0BF009EB000 /* Xcode Source Editor Extension */, + 90C4B6DE1DA4B059009EB000 /* Frameworks */, 01A0EAA51D5DB4CF00A0A8E3 /* Products */, ); sourceTree = ""; @@ -94,6 +161,8 @@ 01A0EAA41D5DB4CF00A0A8E3 /* SwiftFormat.framework */, 01A0EAAE1D5DB4D000A0A8E3 /* SwiftFormatTests.xctest */, 01A0EACA1D5DB5F500A0A8E3 /* swiftformat */, + 90C4B6CA1DA4B04A009EB000 /* SwiftFormat for Xcode.app */, + 90C4B6DD1DA4B059009EB000 /* SwiftFormat.appex */, ); name = Products; sourceTree = ""; @@ -131,6 +200,89 @@ path = CommandLineTool; sourceTree = ""; }; + 9016DEFD1DA5042E008A4E36 /* Resources */ = { + isa = PBXGroup; + children = ( + 90C4B6D01DA4B04A009EB000 /* Assets.xcassets */, + 90C4B6D21DA4B04A009EB000 /* Main.storyboard */, + ); + name = Resources; + sourceTree = ""; + }; + 9016DEFE1DA50433008A4E36 /* Source */ = { + isa = PBXGroup; + children = ( + 90C4B6CC1DA4B04A009EB000 /* AppDelegate.swift */, + 90C4B6CE1DA4B04A009EB000 /* ViewController.swift */, + ); + name = Source; + sourceTree = ""; + }; + 90C4B6CB1DA4B04A009EB000 /* Application */ = { + isa = PBXGroup; + children = ( + 9016DEFE1DA50433008A4E36 /* Source */, + 9016DEFD1DA5042E008A4E36 /* Resources */, + 90CB44D91DA4B56800F86C22 /* Supporting Files */, + ); + path = Application; + sourceTree = ""; + }; + 90C4B6DE1DA4B059009EB000 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 90C4B6DF1DA4B059009EB000 /* Cocoa.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 90C4B6E11DA4B059009EB000 /* Extension */ = { + isa = PBXGroup; + children = ( + 90F16AFA1DA5ED9A00EB4EA1 /* CommandErrors.swift */, + 90F16AF91DA5ECBA00EB4EA1 /* Commands */, + 90C4B6E41DA4B059009EB000 /* SourceEditorExtension.swift */, + 90C4B6E21DA4B059009EB000 /* Supporting Files */, + ); + path = Extension; + sourceTree = ""; + }; + 90C4B6E21DA4B059009EB000 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 90C4B6E81DA4B059009EB000 /* Info.plist */, + 90C4B6E31DA4B059009EB000 /* SwiftFormatter.entitlements */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 90C4B6F01DA4B0BF009EB000 /* Xcode Source Editor Extension */ = { + isa = PBXGroup; + children = ( + 90C4B6CB1DA4B04A009EB000 /* Application */, + 90C4B6E11DA4B059009EB000 /* Extension */, + ); + path = "Xcode Source Editor Extension"; + sourceTree = ""; + }; + 90CB44D91DA4B56800F86C22 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 90C4B6D51DA4B04A009EB000 /* Info.plist */, + 90CB44D81DA4B56500F86C22 /* SwiftFormatter.entitlements */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 90F16AF91DA5ECBA00EB4EA1 /* Commands */ = { + isa = PBXGroup; + children = ( + 90F16AF71DA5EB4600EB4EA1 /* FormatEntireFileCommand.swift */, + 90C4B6E61DA4B059009EB000 /* FormatSelectedSourceCommand.swift */, + ); + name = Commands; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -199,13 +351,49 @@ productReference = 01A0EACA1D5DB5F500A0A8E3 /* swiftformat */; productType = "com.apple.product-type.tool"; }; + 90C4B6C91DA4B04A009EB000 /* SwiftFormat for Xcode */ = { + isa = PBXNativeTarget; + buildConfigurationList = 90C4B6D81DA4B04A009EB000 /* Build configuration list for PBXNativeTarget "SwiftFormat for Xcode" */; + buildPhases = ( + 90C4B6C61DA4B04A009EB000 /* Sources */, + 90C4B6C71DA4B04A009EB000 /* Frameworks */, + 90C4B6C81DA4B04A009EB000 /* Resources */, + 90C4B6EF1DA4B059009EB000 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 90C4B6EA1DA4B059009EB000 /* PBXTargetDependency */, + ); + name = "SwiftFormat for Xcode"; + productName = "SwiftFormat for Xcode"; + productReference = 90C4B6CA1DA4B04A009EB000 /* SwiftFormat for Xcode.app */; + productType = "com.apple.product-type.application"; + }; + 90C4B6DC1DA4B059009EB000 /* Xcode Source Editor Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 90C4B6EC1DA4B059009EB000 /* Build configuration list for PBXNativeTarget "Xcode Source Editor Extension" */; + buildPhases = ( + 90C4B6D91DA4B059009EB000 /* Sources */, + 90C4B6DA1DA4B059009EB000 /* Frameworks */, + 90C4B6DB1DA4B059009EB000 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Xcode Source Editor Extension"; + productName = "Swift Formatter"; + productReference = 90C4B6DD1DA4B059009EB000 /* SwiftFormat.appex */; + productType = "com.apple.product-type.xcode-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 01A0EA9B1D5DB4CF00A0A8E3 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0810; LastUpgradeCheck = 0800; ORGANIZATIONNAME = "Nick Lockwood"; TargetAttributes = { @@ -222,6 +410,16 @@ DevelopmentTeam = 8VQKF583ED; LastSwiftMigration = 0800; }; + 90C4B6C91DA4B04A009EB000 = { + CreatedOnToolsVersion = 8.1; + DevelopmentTeam = HJKFVK94J4; + ProvisioningStyle = Automatic; + }; + 90C4B6DC1DA4B059009EB000 = { + CreatedOnToolsVersion = 8.1; + DevelopmentTeam = HJKFVK94J4; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 01A0EA9E1D5DB4CF00A0A8E3 /* Build configuration list for PBXProject "SwiftFormat" */; @@ -230,6 +428,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 01A0EA9A1D5DB4CF00A0A8E3; productRefGroup = 01A0EAA51D5DB4CF00A0A8E3 /* Products */; @@ -239,6 +438,8 @@ 01A0EAA31D5DB4CF00A0A8E3 /* SwiftFormat */, 01A0EAAD1D5DB4D000A0A8E3 /* SwiftFormatTests */, 01A0EAC91D5DB5F500A0A8E3 /* CommandLineTool */, + 90C4B6C91DA4B04A009EB000 /* SwiftFormat for Xcode */, + 90C4B6DC1DA4B059009EB000 /* Xcode Source Editor Extension */, ); }; /* End PBXProject section */ @@ -258,6 +459,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 90C4B6C81DA4B04A009EB000 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 90C4B6D11DA4B04A009EB000 /* Assets.xcassets in Resources */, + 90C4B6D41DA4B04A009EB000 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 90C4B6DB1DA4B059009EB000 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -325,6 +542,30 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 90C4B6C61DA4B04A009EB000 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 90C4B6CF1DA4B04A009EB000 /* ViewController.swift in Sources */, + 90C4B6CD1DA4B04A009EB000 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 90C4B6D91DA4B059009EB000 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 90C4B6E51DA4B059009EB000 /* SourceEditorExtension.swift in Sources */, + 9028F7841DA4B435009FE5B4 /* Tokenizer.swift in Sources */, + 90F16AFB1DA5ED9A00EB4EA1 /* CommandErrors.swift in Sources */, + 9028F7851DA4B435009FE5B4 /* Formatter.swift in Sources */, + 9028F7831DA4B435009FE5B4 /* SwiftFormat.swift in Sources */, + 90C4B6E71DA4B059009EB000 /* FormatSelectedSourceCommand.swift in Sources */, + 90F16AF81DA5EB4600EB4EA1 /* FormatEntireFileCommand.swift in Sources */, + 9028F7861DA4B435009FE5B4 /* Rules.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -333,8 +574,24 @@ target = 01A0EAA31D5DB4CF00A0A8E3 /* SwiftFormat */; targetProxy = 01A0EAB01D5DB4D000A0A8E3 /* PBXContainerItemProxy */; }; + 90C4B6EA1DA4B059009EB000 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 90C4B6DC1DA4B059009EB000 /* Xcode Source Editor Extension */; + targetProxy = 90C4B6E91DA4B059009EB000 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 90C4B6D21DA4B04A009EB000 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 90C4B6D31DA4B04A009EB000 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 01A0EAB61D5DB4D000A0A8E3 /* Debug */ = { isa = XCBuildConfiguration; @@ -382,7 +639,6 @@ SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; }; name = Debug; }; @@ -425,7 +681,6 @@ SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; }; name = Release; }; @@ -523,6 +778,84 @@ }; name = Release; }; + 90C4B6D61DA4B04A009EB000 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = "Xcode Source Editor Extension/Application/SwiftFormatter.entitlements"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = HJKFVK94J4; + INFOPLIST_FILE = "Xcode Source Editor Extension/Application/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; + PRODUCT_NAME = "SwiftFormat for Xcode"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 3.0.1; + }; + name = Debug; + }; + 90C4B6D71DA4B04A009EB000 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = "Xcode Source Editor Extension/Application/SwiftFormatter.entitlements"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = HJKFVK94J4; + INFOPLIST_FILE = "Xcode Source Editor Extension/Application/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; + PRODUCT_NAME = "SwiftFormat for Xcode"; + SWIFT_VERSION = 3.0.1; + }; + name = Release; + }; + 90C4B6ED1DA4B059009EB000 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = "Xcode Source Editor Extension/Extension/SwiftFormatter.entitlements"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = HJKFVK94J4; + INFOPLIST_FILE = "Xcode Source Editor Extension/Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; + PRODUCT_NAME = SwiftFormat; + STRIP_STYLE = all; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 3.0.1; + }; + name = Debug; + }; + 90C4B6EE1DA4B059009EB000 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = "Xcode Source Editor Extension/Extension/SwiftFormatter.entitlements"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = HJKFVK94J4; + INFOPLIST_FILE = "Xcode Source Editor Extension/Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; + PRODUCT_NAME = SwiftFormat; + STRIP_STYLE = all; + SWIFT_VERSION = 3.0.1; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -562,6 +895,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 90C4B6D81DA4B04A009EB000 /* Build configuration list for PBXNativeTarget "SwiftFormat for Xcode" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 90C4B6D61DA4B04A009EB000 /* Debug */, + 90C4B6D71DA4B04A009EB000 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 90C4B6EC1DA4B059009EB000 /* Build configuration list for PBXNativeTarget "Xcode Source Editor Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 90C4B6ED1DA4B059009EB000 /* Debug */, + 90C4B6EE1DA4B059009EB000 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 01A0EA9B1D5DB4CF00A0A8E3 /* Project object */; diff --git a/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat (Xcode Source Editor Extension).xcscheme b/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat (Xcode Source Editor Extension).xcscheme new file mode 100644 index 00000000..ff73f560 --- /dev/null +++ b/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat (Xcode Source Editor Extension).xcscheme @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat for Xcode.xcscheme b/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat for Xcode.xcscheme new file mode 100644 index 00000000..b234fdb2 --- /dev/null +++ b/SwiftFormat.xcodeproj/xcshareddata/xcschemes/SwiftFormat for Xcode.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftFormat/Info.plist b/SwiftFormat/Info.plist index a8b17a0b..4d637c6b 100644 --- a/SwiftFormat/Info.plist +++ b/SwiftFormat/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0 + 0.12 CFBundleSignature ???? CFBundleVersion diff --git a/SwiftFormatTests/Info.plist b/SwiftFormatTests/Info.plist index ba72822e..cf7e547c 100644 --- a/SwiftFormatTests/Info.plist +++ b/SwiftFormatTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 0.12 CFBundleSignature ???? CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) diff --git a/Xcode Source Editor Extension/Application/AppDelegate.swift b/Xcode Source Editor Extension/Application/AppDelegate.swift new file mode 100644 index 00000000..dc4d6248 --- /dev/null +++ b/Xcode Source Editor Extension/Application/AppDelegate.swift @@ -0,0 +1,35 @@ +// +// AppDelegate.swift +// SwiftFormat for Xcode +// +// Created by Tony Arnold on 5/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate {} diff --git a/Xcode Source Editor Extension/Application/Assets.xcassets/AppIcon.appiconset/Contents.json b/Xcode Source Editor Extension/Application/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..2db2b1c7 --- /dev/null +++ b/Xcode Source Editor Extension/Application/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Xcode Source Editor Extension/Application/Base.lproj/Main.storyboard b/Xcode Source Editor Extension/Application/Base.lproj/Main.storyboard new file mode 100644 index 00000000..af8f3f3e --- /dev/null +++ b/Xcode Source Editor Extension/Application/Base.lproj/Main.storyboard @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SwiftFormat for Xcode is an extension for Apple's IDE, Xcode that reformats swift code. It applies a set of rules to the whitespace around the code, leaving the meaning intact. + + + + + + + + + + + + + + + + + 1. Open System Preferences +2. Click on "Extensions" +3. Select "Xcode Source Editor" +4. Ensure the checkbox next to "SwiftFormat" is checked +5. Relaunch Xcode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Xcode Source Editor Extension/Application/Info.plist b/Xcode Source Editor Extension/Application/Info.plist new file mode 100644 index 00000000..df699338 --- /dev/null +++ b/Xcode Source Editor Extension/Application/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.12 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2016 Nick Lockwood. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/Xcode Source Editor Extension/Application/SwiftFormatter.entitlements b/Xcode Source Editor Extension/Application/SwiftFormatter.entitlements new file mode 100644 index 00000000..84fa7e33 --- /dev/null +++ b/Xcode Source Editor Extension/Application/SwiftFormatter.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.application-groups + + XcodeSwiftFormatter + + + diff --git a/Xcode Source Editor Extension/Application/ViewController.swift b/Xcode Source Editor Extension/Application/ViewController.swift new file mode 100644 index 00000000..2704f304 --- /dev/null +++ b/Xcode Source Editor Extension/Application/ViewController.swift @@ -0,0 +1,34 @@ +// +// ViewController.swift +// SwiftFormat for Xcode +// +// Created by Tony Arnold on 5/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +import Cocoa + +class ViewController: NSViewController {} diff --git a/Xcode Source Editor Extension/Extension/CommandErrors.swift b/Xcode Source Editor Extension/Extension/CommandErrors.swift new file mode 100644 index 00000000..ac46b984 --- /dev/null +++ b/Xcode Source Editor Extension/Extension/CommandErrors.swift @@ -0,0 +1,38 @@ +// +// CommandErrors.swift +// Swift Formatter +// +// Created by Tony Arnold on 6/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +enum FormatCommandError: Error { + case notSwiftLanguage + case noSelection + case invalidSelection + case invalidLineContent + case cannotRestoreSelection +} diff --git a/Xcode Source Editor Extension/Extension/FormatEntireFileCommand.swift b/Xcode Source Editor Extension/Extension/FormatEntireFileCommand.swift new file mode 100644 index 00000000..d34e7978 --- /dev/null +++ b/Xcode Source Editor Extension/Extension/FormatEntireFileCommand.swift @@ -0,0 +1,72 @@ +// +// FormatEntireFileCommand.swift +// Swift Formatter +// +// Created by Tony Arnold on 5/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +import Foundation +import XcodeKit + +class FormatEntireFileCommand: NSObject, XCSourceEditorCommand { + + func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping(Error?) -> Void) -> Void { + guard invocation.buffer.contentUTI == "public.swift-source" else { + return completionHandler(FormatCommandError.notSwiftLanguage) + } + + // Grab the selected source to format + let sourceToFormat = invocation.buffer.completeBuffer + + // Remove all selections to avoid a crash when changing the contents of the buffer. + invocation.buffer.selections.removeAllObjects() + + do { + let indent = String(repeating: " ", count: invocation.buffer.indentationWidth) + let options = FormatOptions(indent: indent) + let output = try format(sourceToFormat, rules: defaultRules, options: options) + invocation.buffer.completeBuffer = output + } catch let error { + return completionHandler(error) + } + + // For the time being, set the selection back to the last character of the buffer + guard let lastLine = invocation.buffer.lines.lastObject as? String else { + return completionHandler(FormatCommandError.invalidSelection) + } + + let position = XCSourceTextPosition(line: invocation.buffer.lines.count - 1, column: lastLine.characters.count) + let updatedSelectionRange = XCSourceTextRange( + start: position, + end: position + ) + + invocation.buffer.selections.add(updatedSelectionRange) + + return completionHandler(nil) + } +} diff --git a/Xcode Source Editor Extension/Extension/FormatSelectedSourceCommand.swift b/Xcode Source Editor Extension/Extension/FormatSelectedSourceCommand.swift new file mode 100644 index 00000000..52d73565 --- /dev/null +++ b/Xcode Source Editor Extension/Extension/FormatSelectedSourceCommand.swift @@ -0,0 +1,105 @@ +// +// FormatSelectedSourceCommand.swift +// Swift Formatter +// +// Created by Tony Arnold on 5/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +import Foundation +import XcodeKit + +class FormatSelectedSourceCommand: NSObject, XCSourceEditorCommand { + + func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping(Error?) -> Void) -> Void { + guard invocation.buffer.contentUTI == "public.swift-source" else { + return completionHandler(FormatCommandError.notSwiftLanguage) + } + + guard let selection = invocation.buffer.selections.firstObject as? XCSourceTextRange else { + return completionHandler(FormatCommandError.noSelection) + } + + // Grab the selected source to format using entire lines of text + let selectionRange = selection.start.line ... min(selection.end.line, invocation.buffer.lines.count - 1) + let sourceToFormat = selectionRange.flatMap { invocation.buffer.lines[$0] as? String }.joined() + + // Remove all selections to avoid a crash when changing the contents of the buffer. + invocation.buffer.selections.removeAllObjects() + + do { + let indent = self.indentationString(for: invocation.buffer) + let options = FormatOptions(indent: indent, fragment: true) + let formattedSource = try format(sourceToFormat, rules: defaultRules, options: options) + + for line in selectionRange.reversed() { + invocation.buffer.lines.removeObject(at: line) + } + + invocation.buffer.lines.insert(formattedSource, at: selection.start.line) + + let updatedSelectionRange = self.rangeForDifferences(in: selection, between: sourceToFormat, and: formattedSource) + + invocation.buffer.selections.add(updatedSelectionRange) + } catch let error { + + return completionHandler(error) + } + + return completionHandler(nil) + } + + /// Given a source text range, an original source string and a modified target string this method will calculate the differences, and return a usable XCSourceTextRange based upon the original. + /// + /// - Parameters: + /// - textRange: Existing source text range + /// - sourceText: Original text + /// - targetText: Modified text + /// - Returns: Source text range that should be usable with the passed modified text + private func rangeForDifferences(in textRange: XCSourceTextRange, between sourceText: String, and targetText: String) -> XCSourceTextRange { + let lineCountOfTarget = targetText.components(separatedBy: CharacterSet.newlines).count + + // Ensure that we're not greedy about end selections — this can cause empty lines to be removed + let finalLine = (textRange.end.column > 0) ? textRange.end.line : textRange.end.line - 1 + let range = textRange.start.line ... finalLine + let difference = range.count - lineCountOfTarget + let start = XCSourceTextPosition(line: textRange.start.line, column: 0) + let end = XCSourceTextPosition(line: finalLine - difference, column: 0) + + return XCSourceTextRange(start: start, end: end) + } + + /// Calculates the indentation string representation for a given source text buffer. + /// + /// - Parameter buffer: Source text buffer + /// - Returns: Indentation represented as a string + private func indentationString(for buffer: XCSourceTextBuffer) -> String { + let indentCharacter = buffer.usesTabsForIndentation ? "\t" : " " + let indentCount = buffer.usesTabsForIndentation ? buffer.indentationWidth / buffer.tabWidth : buffer.indentationWidth + + return String(repeating: indentCharacter, count: indentCount) + } +} diff --git a/Xcode Source Editor Extension/Extension/Info.plist b/Xcode Source Editor Extension/Extension/Info.plist new file mode 100644 index 00000000..4a5f966d --- /dev/null +++ b/Xcode Source Editor Extension/Extension/Info.plist @@ -0,0 +1,55 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 0.12 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSExtension + + NSExtensionAttributes + + XCSourceEditorCommandDefinitions + + + XCSourceEditorCommandClassName + $(PRODUCT_MODULE_NAME).FormatSelectedSourceCommand + XCSourceEditorCommandIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER).FormatSelectedSourceCommand + XCSourceEditorCommandName + Format Selected Source + + + XCSourceEditorCommandClassName + $(PRODUCT_MODULE_NAME).FormatEntireFileCommand + XCSourceEditorCommandIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER).FormatEntireFileCommand + XCSourceEditorCommandName + Format Entire File + + + XCSourceEditorExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).SourceEditorExtension + + NSExtensionPointIdentifier + com.apple.dt.Xcode.extension.source-editor + + NSHumanReadableCopyright + Copyright © 2016 Nick Lockwood. All rights reserved. + + diff --git a/Xcode Source Editor Extension/Extension/SourceEditorExtension.swift b/Xcode Source Editor Extension/Extension/SourceEditorExtension.swift new file mode 100644 index 00000000..6b1f58e8 --- /dev/null +++ b/Xcode Source Editor Extension/Extension/SourceEditorExtension.swift @@ -0,0 +1,35 @@ +// +// SourceEditorExtension.swift +// Swift Formatter +// +// Created by Tony Arnold on 5/10/16. +// Copyright 2016 Charcoal Design +// +// Distributed under the permissive zlib license +// Get the latest version from here: +// +// https://github.com/nicklockwood/SwiftFormat +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// + +import Foundation +import XcodeKit + +class SourceEditorExtension: NSObject, XCSourceEditorExtension {} diff --git a/Xcode Source Editor Extension/Extension/SwiftFormatter.entitlements b/Xcode Source Editor Extension/Extension/SwiftFormatter.entitlements new file mode 100644 index 00000000..84fa7e33 --- /dev/null +++ b/Xcode Source Editor Extension/Extension/SwiftFormatter.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.application-groups + + XcodeSwiftFormatter + + +