├── .gitignore
├── Alignment
├── Alignment.entitlements
├── Info.plist
├── SourceEditorCommand.swift
└── SourceEditorExtension.swift
├── AlignmentForXcode.entitlements
├── AlignmentForXcode.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── LICENSE
├── README.md
├── XcodeSourceEditorExtension-Alignment
├── AppDelegate.swift
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon_128@1x.png
│ │ ├── icon_128@2x.png
│ │ ├── icon_16@1x.png
│ │ ├── icon_16@2x.png
│ │ ├── icon_256@1x.png
│ │ ├── icon_256@2x.png
│ │ ├── icon_32@1x.png
│ │ ├── icon_32@2x.png
│ │ ├── icon_512@1x.png
│ │ └── icon_512@2x.png
│ ├── Contents.json
│ └── Icon.imageset
│ │ ├── Contents.json
│ │ ├── icon_256@1x.png
│ │ └── icon_256@2x.png
├── Base.lproj
│ └── Main.storyboard
├── Info.plist
└── ViewController.swift
└── docs
├── index.md
└── privacy
└── english.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ### https://raw.github.com/github/gitignore/fceac113a3a20e00718d6317e468eec27f6e2d99/swift.gitignore
2 |
3 | # Xcode
4 | #
5 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
6 |
7 | ## Build generated
8 | build/
9 | DerivedData
10 |
11 | ## Various settings
12 | *.pbxuser
13 | !default.pbxuser
14 | *.mode1v3
15 | !default.mode1v3
16 | *.mode2v3
17 | !default.mode2v3
18 | *.perspectivev3
19 | !default.perspectivev3
20 | xcuserdata
21 |
22 | ## Other
23 | *.xccheckout
24 | *.moved-aside
25 | *.xcuserstate
26 | *.xcscmblueprint
27 |
28 | ## Obj-C/Swift specific
29 | *.hmap
30 | *.ipa
31 |
32 | # Swift Package Manager
33 | #
34 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
35 | # Packages/
36 | .build/
37 |
38 | # CocoaPods
39 | #
40 | # We recommend against adding the Pods directory to your .gitignore. However
41 | # you should judge for yourself, the pros and cons are mentioned at:
42 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
43 | #
44 | # Pods/
45 |
46 | # Carthage
47 | #
48 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
49 | # Carthage/Checkouts
50 |
51 | Carthage/Build
52 |
53 | # fastlane
54 | #
55 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
56 | # screenshots whenever they are needed.
57 | # For more information about the recommended setup visit:
58 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
59 |
60 | fastlane/report.xml
61 | fastlane/screenshots
62 |
63 |
64 |
--------------------------------------------------------------------------------
/Alignment/Alignment.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.application-groups
8 |
9 | $(TeamIdentifierPrefix)Alignment-for-Xcode
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Alignment/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Alignment
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | XPC!
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(CURRENT_PROJECT_VERSION)
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSExtension
28 |
29 | NSExtensionAttributes
30 |
31 | XCSourceEditorCommandDefinitions
32 |
33 |
34 | XCSourceEditorCommandClassName
35 | $(PRODUCT_MODULE_NAME).SourceEditorCommand
36 | XCSourceEditorCommandIdentifier
37 | com.tid.XcodeSourceEditorExtension-Alignment.Alignment.SourceEditorCommand
38 | XCSourceEditorCommandName
39 | Align
40 |
41 |
42 | XCSourceEditorExtensionPrincipalClass
43 | $(PRODUCT_MODULE_NAME).SourceEditorExtension
44 |
45 | NSExtensionPointIdentifier
46 | com.apple.dt.Xcode.extension.source-editor
47 |
48 | NSHumanReadableCopyright
49 | Copyright © 2016 Atsushi Kiwaki. All rights reserved.
50 | TeamIdentifierPrefix
51 | $(TeamIdentifierPrefix)
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Alignment/SourceEditorCommand.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SourceEditorCommand.swift
3 | // Alignment
4 | //
5 | // Created by Atsushi Kiwaki on 6/16/16.
6 | // Copyright © 2016 Atsushi Kiwaki. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import XcodeKit
11 |
12 | class SourceEditorCommand: NSObject, XCSourceEditorCommand {
13 |
14 | func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) {
15 | // Implement your command here, invoking the completion handler when done. Pass it nil on success, and an NSError on failure.
16 | guard let selection = invocation.buffer.selections.firstObject as? XCSourceTextRange else {
17 | completionHandler(NSError(domain: "SampleExtension", code: -1, userInfo: [NSLocalizedDescriptionKey: "None selection"]))
18 | return
19 | }
20 |
21 | let def = UserDefaults(suiteName: "\(Bundle.main.object(forInfoDictionaryKey: "TeamIdentifierPrefix") as? String ?? "")Alignment-for-Xcode")
22 | let isEnableAssignment = def?.object(forKey: "KEY_ENABLE_ASSIGNMENT") as? Bool ?? true
23 | let isEnableTypeDeclaration = def?.object(forKey: "KEY_ENABLE_TYPE_DECLARATION") as? Bool ?? false
24 | let isEnableTypeObjectModel = def?.object(forKey: "KEY_ENABLE_TYPE_OBJECT_MODEL") as? Bool ?? false
25 |
26 | do {
27 |
28 |
29 | if isEnableTypeDeclaration {
30 | try align(invocation: invocation, selection: selection, key: ":")
31 | }
32 |
33 | if isEnableTypeObjectModel {
34 | try align(invocation: invocation, selection: selection, key: "<-")
35 | }
36 |
37 | if isEnableAssignment {
38 | try alignAssignment(invocation: invocation, selection: selection)
39 | }
40 |
41 |
42 | } catch {
43 | completionHandler(NSError(domain: "SampleExtension", code: -1, userInfo: [NSLocalizedDescriptionKey: ""]))
44 | return
45 | }
46 |
47 | completionHandler(nil)
48 | }
49 |
50 | func alignAssignment(invocation: XCSourceEditorCommandInvocation, selection: XCSourceTextRange) throws {
51 | var regex: NSRegularExpression?
52 | regex = try NSRegularExpression(pattern: "[^+^%^*^^^<^>^&^|^?^=^-](\\s*)(=)[^=]", options: .caseInsensitive)
53 |
54 | let alignPosition = invocation.buffer.lines.enumerated().map { i, line -> Int in
55 | guard i >= selection.start.line && i <= selection.end.line,
56 | let line = line as? String,
57 | let result = regex?.firstMatch(in: line, options: .reportProgress, range: NSRange(location: 0, length: line.utf16.count)) else {
58 | return 0
59 | }
60 | return result.range(at: 1).location
61 | }.max()
62 |
63 | for index in selection.start.line ... selection.end.line {
64 | guard let line = invocation.buffer.lines[index] as? String,
65 | let result = regex?.firstMatch(in: line, options: .reportProgress, range: NSRange(location: 0, length: line.utf16.count)) else {
66 | continue
67 | }
68 |
69 | let range = result.range(at: 2)
70 | if range.location != NSNotFound {
71 | let repeatCount = alignPosition! - range.location + 1
72 | if repeatCount != 0 {
73 | let whiteSpaces = String(repeating: " ", count: abs(repeatCount))
74 |
75 | if repeatCount > 0 {
76 | invocation.buffer.lines.replaceObject(at: index, with: line.replacingOccurrences(of: "=", with: "\(whiteSpaces)=", options: [.regularExpression], range: line.startIndex.. Int in
90 | guard i >= selection.start.line && i <= selection.end.line,
91 | let line = line as? String,
92 | let result = regex?.firstMatch(in: line, options: .reportProgress, range: NSRange(location: 0, length: line.utf16.count)) else {
93 | return 0
94 | }
95 | return result.range.location
96 | }.max()
97 |
98 | for index in selection.start.line ... selection.end.line {
99 | guard let line = invocation.buffer.lines[index] as? NSString else {
100 | continue
101 | }
102 |
103 | let range = line.range(of: key)
104 | if range.location != NSNotFound {
105 | let repeatCount = alignPosition1! - range.location + 1
106 | if repeatCount != 0 {
107 | let whiteSpaces = String(repeating: " ", count: abs(repeatCount))
108 |
109 | if repeatCount > 0 {
110 | invocation.buffer.lines.replaceObject(at: index, with: line.replacingOccurrences(of: key, with: "\(whiteSpaces)\(key)"))
111 | } else {
112 | invocation.buffer.lines.replaceObject(at: index, with: line.replacingOccurrences(of: "\(whiteSpaces)\(key)", with: key))
113 | }
114 | }
115 | }
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/Alignment/SourceEditorExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SourceEditorExtension.swift
3 | // Alignment
4 | //
5 | // Created by Atsushi Kiwaki on 6/16/16.
6 | // Copyright © 2016 Atsushi Kiwaki. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import XcodeKit
11 |
12 | class SourceEditorExtension: NSObject, XCSourceEditorExtension {
13 |
14 | /*
15 | func extensionDidFinishLaunching() {
16 | // If your extension needs to do any work at launch, implement this optional method.
17 | }
18 | */
19 |
20 | /*
21 | var commandDefinitions: [[XCSourceEditorCommandDefinitionKey: AnyObject]] {
22 | // If your extension needs to return a collection of command definitions that differs from those in its Info.plist, implement this optional property getter.
23 | return []
24 | }
25 | */
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/AlignmentForXcode.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.application-groups
8 |
9 | $(TeamIdentifierPrefix)Alignment-for-Xcode
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/AlignmentForXcode.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1E50AC03256BBA4C00A3625E /* XcodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E50AC02256BBA4C00A3625E /* XcodeKit.framework */; };
11 | 1E50AC04256BBA4C00A3625E /* XcodeKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1E50AC02256BBA4C00A3625E /* XcodeKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
12 | 1E6C02941D11C98C004D2B5E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6C02931D11C98C004D2B5E /* AppDelegate.swift */; };
13 | 1E6C02961D11C98C004D2B5E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6C02951D11C98C004D2B5E /* ViewController.swift */; };
14 | 1E6C02981D11C98C004D2B5E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1E6C02971D11C98C004D2B5E /* Assets.xcassets */; };
15 | 1E6C029B1D11C98D004D2B5E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E6C02991D11C98D004D2B5E /* Main.storyboard */; };
16 | 1E6C02A91D11C995004D2B5E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E6C02A81D11C995004D2B5E /* Cocoa.framework */; };
17 | 1E6C02AE1D11C995004D2B5E /* SourceEditorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6C02AD1D11C995004D2B5E /* SourceEditorExtension.swift */; };
18 | 1E6C02B01D11C995004D2B5E /* SourceEditorCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6C02AF1D11C995004D2B5E /* SourceEditorCommand.swift */; };
19 | 1E6C02B41D11C995004D2B5E /* Alignment.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1E6C02A61D11C995004D2B5E /* Alignment.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 1E6C02B21D11C995004D2B5E /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 1E6C02881D11C98C004D2B5E /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 1E6C02A51D11C995004D2B5E;
28 | remoteInfo = Alignment;
29 | };
30 | /* End PBXContainerItemProxy section */
31 |
32 | /* Begin PBXCopyFilesBuildPhase section */
33 | 1E50AC05256BBA4C00A3625E /* Embed Frameworks */ = {
34 | isa = PBXCopyFilesBuildPhase;
35 | buildActionMask = 2147483647;
36 | dstPath = "";
37 | dstSubfolderSpec = 10;
38 | files = (
39 | 1E50AC04256BBA4C00A3625E /* XcodeKit.framework in Embed Frameworks */,
40 | );
41 | name = "Embed Frameworks";
42 | runOnlyForDeploymentPostprocessing = 0;
43 | };
44 | 1E6C02B81D11C995004D2B5E /* Embed App Extensions */ = {
45 | isa = PBXCopyFilesBuildPhase;
46 | buildActionMask = 2147483647;
47 | dstPath = "";
48 | dstSubfolderSpec = 13;
49 | files = (
50 | 1E6C02B41D11C995004D2B5E /* Alignment.appex in Embed App Extensions */,
51 | );
52 | name = "Embed App Extensions";
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXCopyFilesBuildPhase section */
56 |
57 | /* Begin PBXFileReference section */
58 | 1E13EAF91DBCB6AA0057352A /* AlignmentForXcode.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AlignmentForXcode.entitlements; sourceTree = SOURCE_ROOT; };
59 | 1E50AC02256BBA4C00A3625E /* XcodeKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XcodeKit.framework; path = Library/Frameworks/XcodeKit.framework; sourceTree = DEVELOPER_DIR; };
60 | 1E6C02901D11C98C004D2B5E /* AlignmentForXcode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AlignmentForXcode.app; sourceTree = BUILT_PRODUCTS_DIR; };
61 | 1E6C02931D11C98C004D2B5E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
62 | 1E6C02951D11C98C004D2B5E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
63 | 1E6C02971D11C98C004D2B5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
64 | 1E6C029A1D11C98D004D2B5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
65 | 1E6C029C1D11C98D004D2B5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
66 | 1E6C02A61D11C995004D2B5E /* Alignment.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Alignment.appex; sourceTree = BUILT_PRODUCTS_DIR; };
67 | 1E6C02A81D11C995004D2B5E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
68 | 1E6C02AC1D11C995004D2B5E /* Alignment.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Alignment.entitlements; sourceTree = ""; };
69 | 1E6C02AD1D11C995004D2B5E /* SourceEditorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorExtension.swift; sourceTree = ""; };
70 | 1E6C02AF1D11C995004D2B5E /* SourceEditorCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorCommand.swift; sourceTree = ""; };
71 | 1E6C02B11D11C995004D2B5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
72 | /* End PBXFileReference section */
73 |
74 | /* Begin PBXFrameworksBuildPhase section */
75 | 1E6C028D1D11C98C004D2B5E /* Frameworks */ = {
76 | isa = PBXFrameworksBuildPhase;
77 | buildActionMask = 2147483647;
78 | files = (
79 | );
80 | runOnlyForDeploymentPostprocessing = 0;
81 | };
82 | 1E6C02A31D11C995004D2B5E /* Frameworks */ = {
83 | isa = PBXFrameworksBuildPhase;
84 | buildActionMask = 2147483647;
85 | files = (
86 | 1E6C02A91D11C995004D2B5E /* Cocoa.framework in Frameworks */,
87 | 1E50AC03256BBA4C00A3625E /* XcodeKit.framework in Frameworks */,
88 | );
89 | runOnlyForDeploymentPostprocessing = 0;
90 | };
91 | /* End PBXFrameworksBuildPhase section */
92 |
93 | /* Begin PBXGroup section */
94 | 1E6C02871D11C98C004D2B5E = {
95 | isa = PBXGroup;
96 | children = (
97 | 1E6C02921D11C98C004D2B5E /* AlignmentForXcode */,
98 | 1E6C02AA1D11C995004D2B5E /* Alignment */,
99 | 1E6C02A71D11C995004D2B5E /* Frameworks */,
100 | 1E6C02911D11C98C004D2B5E /* Products */,
101 | );
102 | sourceTree = "";
103 | };
104 | 1E6C02911D11C98C004D2B5E /* Products */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 1E6C02901D11C98C004D2B5E /* AlignmentForXcode.app */,
108 | 1E6C02A61D11C995004D2B5E /* Alignment.appex */,
109 | );
110 | name = Products;
111 | sourceTree = "";
112 | };
113 | 1E6C02921D11C98C004D2B5E /* AlignmentForXcode */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 1E13EAF91DBCB6AA0057352A /* AlignmentForXcode.entitlements */,
117 | 1E6C02931D11C98C004D2B5E /* AppDelegate.swift */,
118 | 1E6C02951D11C98C004D2B5E /* ViewController.swift */,
119 | 1E6C02971D11C98C004D2B5E /* Assets.xcassets */,
120 | 1E6C02991D11C98D004D2B5E /* Main.storyboard */,
121 | 1E6C029C1D11C98D004D2B5E /* Info.plist */,
122 | );
123 | name = AlignmentForXcode;
124 | path = "XcodeSourceEditorExtension-Alignment";
125 | sourceTree = "";
126 | };
127 | 1E6C02A71D11C995004D2B5E /* Frameworks */ = {
128 | isa = PBXGroup;
129 | children = (
130 | 1E50AC02256BBA4C00A3625E /* XcodeKit.framework */,
131 | 1E6C02A81D11C995004D2B5E /* Cocoa.framework */,
132 | );
133 | name = Frameworks;
134 | sourceTree = "";
135 | };
136 | 1E6C02AA1D11C995004D2B5E /* Alignment */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 1E6C02AD1D11C995004D2B5E /* SourceEditorExtension.swift */,
140 | 1E6C02AF1D11C995004D2B5E /* SourceEditorCommand.swift */,
141 | 1E6C02B11D11C995004D2B5E /* Info.plist */,
142 | 1E6C02AB1D11C995004D2B5E /* Supporting Files */,
143 | );
144 | path = Alignment;
145 | sourceTree = "";
146 | };
147 | 1E6C02AB1D11C995004D2B5E /* Supporting Files */ = {
148 | isa = PBXGroup;
149 | children = (
150 | 1E6C02AC1D11C995004D2B5E /* Alignment.entitlements */,
151 | );
152 | name = "Supporting Files";
153 | sourceTree = "";
154 | };
155 | /* End PBXGroup section */
156 |
157 | /* Begin PBXNativeTarget section */
158 | 1E6C028F1D11C98C004D2B5E /* AlignmentForXcode */ = {
159 | isa = PBXNativeTarget;
160 | buildConfigurationList = 1E6C029F1D11C98D004D2B5E /* Build configuration list for PBXNativeTarget "AlignmentForXcode" */;
161 | buildPhases = (
162 | 1E6C028C1D11C98C004D2B5E /* Sources */,
163 | 1E6C028D1D11C98C004D2B5E /* Frameworks */,
164 | 1E6C028E1D11C98C004D2B5E /* Resources */,
165 | 1E6C02B81D11C995004D2B5E /* Embed App Extensions */,
166 | );
167 | buildRules = (
168 | );
169 | dependencies = (
170 | 1E6C02B31D11C995004D2B5E /* PBXTargetDependency */,
171 | );
172 | name = AlignmentForXcode;
173 | productName = "XcodeSourceEditorExtension-Alignment";
174 | productReference = 1E6C02901D11C98C004D2B5E /* AlignmentForXcode.app */;
175 | productType = "com.apple.product-type.application";
176 | };
177 | 1E6C02A51D11C995004D2B5E /* Alignment */ = {
178 | isa = PBXNativeTarget;
179 | buildConfigurationList = 1E6C02B51D11C995004D2B5E /* Build configuration list for PBXNativeTarget "Alignment" */;
180 | buildPhases = (
181 | 1E6C02A21D11C995004D2B5E /* Sources */,
182 | 1E6C02A31D11C995004D2B5E /* Frameworks */,
183 | 1E6C02A41D11C995004D2B5E /* Resources */,
184 | 1E50AC05256BBA4C00A3625E /* Embed Frameworks */,
185 | );
186 | buildRules = (
187 | );
188 | dependencies = (
189 | );
190 | name = Alignment;
191 | productName = Alignment;
192 | productReference = 1E6C02A61D11C995004D2B5E /* Alignment.appex */;
193 | productType = "com.apple.product-type.xcode-extension";
194 | };
195 | /* End PBXNativeTarget section */
196 |
197 | /* Begin PBXProject section */
198 | 1E6C02881D11C98C004D2B5E /* Project object */ = {
199 | isa = PBXProject;
200 | attributes = {
201 | LastSwiftUpdateCheck = 0800;
202 | LastUpgradeCheck = 1220;
203 | ORGANIZATIONNAME = tid;
204 | TargetAttributes = {
205 | 1E6C028F1D11C98C004D2B5E = {
206 | CreatedOnToolsVersion = 8.0;
207 | DevelopmentTeam = DP9Q5R8635;
208 | DevelopmentTeamName = "Atsushi Kiwaki";
209 | LastSwiftMigration = 1220;
210 | ProvisioningStyle = Automatic;
211 | SystemCapabilities = {
212 | com.apple.ApplicationGroups.Mac = {
213 | enabled = 1;
214 | };
215 | com.apple.Sandbox = {
216 | enabled = 1;
217 | };
218 | };
219 | };
220 | 1E6C02A51D11C995004D2B5E = {
221 | CreatedOnToolsVersion = 8.0;
222 | DevelopmentTeam = DP9Q5R8635;
223 | DevelopmentTeamName = "Atsushi Kiwaki";
224 | LastSwiftMigration = 1220;
225 | ProvisioningStyle = Automatic;
226 | SystemCapabilities = {
227 | com.apple.ApplicationGroups.Mac = {
228 | enabled = 1;
229 | };
230 | };
231 | };
232 | };
233 | };
234 | buildConfigurationList = 1E6C028B1D11C98C004D2B5E /* Build configuration list for PBXProject "AlignmentForXcode" */;
235 | compatibilityVersion = "Xcode 3.2";
236 | developmentRegion = English;
237 | hasScannedForEncodings = 0;
238 | knownRegions = (
239 | English,
240 | en,
241 | Base,
242 | );
243 | mainGroup = 1E6C02871D11C98C004D2B5E;
244 | productRefGroup = 1E6C02911D11C98C004D2B5E /* Products */;
245 | projectDirPath = "";
246 | projectRoot = "";
247 | targets = (
248 | 1E6C028F1D11C98C004D2B5E /* AlignmentForXcode */,
249 | 1E6C02A51D11C995004D2B5E /* Alignment */,
250 | );
251 | };
252 | /* End PBXProject section */
253 |
254 | /* Begin PBXResourcesBuildPhase section */
255 | 1E6C028E1D11C98C004D2B5E /* Resources */ = {
256 | isa = PBXResourcesBuildPhase;
257 | buildActionMask = 2147483647;
258 | files = (
259 | 1E6C02981D11C98C004D2B5E /* Assets.xcassets in Resources */,
260 | 1E6C029B1D11C98D004D2B5E /* Main.storyboard in Resources */,
261 | );
262 | runOnlyForDeploymentPostprocessing = 0;
263 | };
264 | 1E6C02A41D11C995004D2B5E /* Resources */ = {
265 | isa = PBXResourcesBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | runOnlyForDeploymentPostprocessing = 0;
270 | };
271 | /* End PBXResourcesBuildPhase section */
272 |
273 | /* Begin PBXSourcesBuildPhase section */
274 | 1E6C028C1D11C98C004D2B5E /* Sources */ = {
275 | isa = PBXSourcesBuildPhase;
276 | buildActionMask = 2147483647;
277 | files = (
278 | 1E6C02961D11C98C004D2B5E /* ViewController.swift in Sources */,
279 | 1E6C02941D11C98C004D2B5E /* AppDelegate.swift in Sources */,
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | };
283 | 1E6C02A21D11C995004D2B5E /* Sources */ = {
284 | isa = PBXSourcesBuildPhase;
285 | buildActionMask = 2147483647;
286 | files = (
287 | 1E6C02AE1D11C995004D2B5E /* SourceEditorExtension.swift in Sources */,
288 | 1E6C02B01D11C995004D2B5E /* SourceEditorCommand.swift in Sources */,
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | };
292 | /* End PBXSourcesBuildPhase section */
293 |
294 | /* Begin PBXTargetDependency section */
295 | 1E6C02B31D11C995004D2B5E /* PBXTargetDependency */ = {
296 | isa = PBXTargetDependency;
297 | target = 1E6C02A51D11C995004D2B5E /* Alignment */;
298 | targetProxy = 1E6C02B21D11C995004D2B5E /* PBXContainerItemProxy */;
299 | };
300 | /* End PBXTargetDependency section */
301 |
302 | /* Begin PBXVariantGroup section */
303 | 1E6C02991D11C98D004D2B5E /* Main.storyboard */ = {
304 | isa = PBXVariantGroup;
305 | children = (
306 | 1E6C029A1D11C98D004D2B5E /* Base */,
307 | );
308 | name = Main.storyboard;
309 | sourceTree = "";
310 | };
311 | /* End PBXVariantGroup section */
312 |
313 | /* Begin XCBuildConfiguration section */
314 | 1E6C029D1D11C98D004D2B5E /* Debug */ = {
315 | isa = XCBuildConfiguration;
316 | buildSettings = {
317 | ALWAYS_SEARCH_USER_PATHS = NO;
318 | CLANG_ANALYZER_NONNULL = YES;
319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
320 | CLANG_CXX_LIBRARY = "libc++";
321 | CLANG_ENABLE_MODULES = YES;
322 | CLANG_ENABLE_OBJC_ARC = YES;
323 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
324 | CLANG_WARN_BOOL_CONVERSION = YES;
325 | CLANG_WARN_COMMA = YES;
326 | CLANG_WARN_CONSTANT_CONVERSION = YES;
327 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
329 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
330 | CLANG_WARN_EMPTY_BODY = YES;
331 | CLANG_WARN_ENUM_CONVERSION = YES;
332 | CLANG_WARN_INFINITE_RECURSION = YES;
333 | CLANG_WARN_INT_CONVERSION = YES;
334 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
335 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
338 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
339 | CLANG_WARN_STRICT_PROTOTYPES = YES;
340 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
341 | CLANG_WARN_UNREACHABLE_CODE = YES;
342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
343 | CODE_SIGN_IDENTITY = "-";
344 | COPY_PHASE_STRIP = NO;
345 | DEBUG_INFORMATION_FORMAT = dwarf;
346 | ENABLE_STRICT_OBJC_MSGSEND = YES;
347 | ENABLE_TESTABILITY = YES;
348 | GCC_C_LANGUAGE_STANDARD = gnu99;
349 | GCC_DYNAMIC_NO_PIC = NO;
350 | GCC_NO_COMMON_BLOCKS = YES;
351 | GCC_OPTIMIZATION_LEVEL = 0;
352 | GCC_PREPROCESSOR_DEFINITIONS = (
353 | "DEBUG=1",
354 | "$(inherited)",
355 | );
356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
358 | GCC_WARN_UNDECLARED_SELECTOR = YES;
359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
360 | GCC_WARN_UNUSED_FUNCTION = YES;
361 | GCC_WARN_UNUSED_VARIABLE = YES;
362 | MACOSX_DEPLOYMENT_TARGET = 10.15;
363 | MTL_ENABLE_DEBUG_INFO = YES;
364 | ONLY_ACTIVE_ARCH = YES;
365 | SDKROOT = macosx;
366 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
367 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
368 | };
369 | name = Debug;
370 | };
371 | 1E6C029E1D11C98D004D2B5E /* Release */ = {
372 | isa = XCBuildConfiguration;
373 | buildSettings = {
374 | ALWAYS_SEARCH_USER_PATHS = NO;
375 | CLANG_ANALYZER_NONNULL = YES;
376 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
377 | CLANG_CXX_LIBRARY = "libc++";
378 | CLANG_ENABLE_MODULES = YES;
379 | CLANG_ENABLE_OBJC_ARC = YES;
380 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
381 | CLANG_WARN_BOOL_CONVERSION = YES;
382 | CLANG_WARN_COMMA = YES;
383 | CLANG_WARN_CONSTANT_CONVERSION = YES;
384 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
385 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
386 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
387 | CLANG_WARN_EMPTY_BODY = YES;
388 | CLANG_WARN_ENUM_CONVERSION = YES;
389 | CLANG_WARN_INFINITE_RECURSION = YES;
390 | CLANG_WARN_INT_CONVERSION = YES;
391 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
392 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
393 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
395 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
396 | CLANG_WARN_STRICT_PROTOTYPES = YES;
397 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
398 | CLANG_WARN_UNREACHABLE_CODE = YES;
399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
400 | CODE_SIGN_IDENTITY = "-";
401 | COPY_PHASE_STRIP = NO;
402 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
403 | ENABLE_NS_ASSERTIONS = NO;
404 | ENABLE_STRICT_OBJC_MSGSEND = YES;
405 | GCC_C_LANGUAGE_STANDARD = gnu99;
406 | GCC_NO_COMMON_BLOCKS = YES;
407 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
408 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
409 | GCC_WARN_UNDECLARED_SELECTOR = YES;
410 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
411 | GCC_WARN_UNUSED_FUNCTION = YES;
412 | GCC_WARN_UNUSED_VARIABLE = YES;
413 | MACOSX_DEPLOYMENT_TARGET = 10.15;
414 | MTL_ENABLE_DEBUG_INFO = NO;
415 | SDKROOT = macosx;
416 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
417 | };
418 | name = Release;
419 | };
420 | 1E6C02A01D11C98D004D2B5E /* Debug */ = {
421 | isa = XCBuildConfiguration;
422 | buildSettings = {
423 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
424 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
425 | CODE_SIGN_ENTITLEMENTS = AlignmentForXcode.entitlements;
426 | CODE_SIGN_IDENTITY = "Mac Developer";
427 | COMBINE_HIDPI_IMAGES = YES;
428 | CURRENT_PROJECT_VERSION = 7;
429 | INFOPLIST_FILE = "XcodeSourceEditorExtension-Alignment/Info.plist";
430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
431 | MARKETING_VERSION = 1.2.0;
432 | PRODUCT_BUNDLE_IDENTIFIER = "com.tid.Alignment-for-Xcode";
433 | PRODUCT_NAME = "$(TARGET_NAME)";
434 | SWIFT_VERSION = 5.0;
435 | };
436 | name = Debug;
437 | };
438 | 1E6C02A11D11C98D004D2B5E /* Release */ = {
439 | isa = XCBuildConfiguration;
440 | buildSettings = {
441 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
443 | CODE_SIGN_ENTITLEMENTS = AlignmentForXcode.entitlements;
444 | CODE_SIGN_IDENTITY = "Mac Developer";
445 | COMBINE_HIDPI_IMAGES = YES;
446 | CURRENT_PROJECT_VERSION = 7;
447 | INFOPLIST_FILE = "XcodeSourceEditorExtension-Alignment/Info.plist";
448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
449 | MARKETING_VERSION = 1.2.0;
450 | PRODUCT_BUNDLE_IDENTIFIER = "com.tid.Alignment-for-Xcode";
451 | PRODUCT_NAME = "$(TARGET_NAME)";
452 | SWIFT_VERSION = 5.0;
453 | };
454 | name = Release;
455 | };
456 | 1E6C02B61D11C995004D2B5E /* Debug */ = {
457 | isa = XCBuildConfiguration;
458 | buildSettings = {
459 | CODE_SIGN_ENTITLEMENTS = Alignment/Alignment.entitlements;
460 | CODE_SIGN_IDENTITY = "Mac Developer";
461 | COMBINE_HIDPI_IMAGES = YES;
462 | CURRENT_PROJECT_VERSION = 7;
463 | DEVELOPMENT_TEAM = DP9Q5R8635;
464 | INFOPLIST_FILE = Alignment/Info.plist;
465 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
466 | MARKETING_VERSION = 1.2.0;
467 | PRODUCT_BUNDLE_IDENTIFIER = "com.tid.Alignment-for-Xcode.Alignment";
468 | PRODUCT_NAME = "$(TARGET_NAME)";
469 | SKIP_INSTALL = YES;
470 | SWIFT_VERSION = 5.0;
471 | };
472 | name = Debug;
473 | };
474 | 1E6C02B71D11C995004D2B5E /* Release */ = {
475 | isa = XCBuildConfiguration;
476 | buildSettings = {
477 | CODE_SIGN_ENTITLEMENTS = Alignment/Alignment.entitlements;
478 | CODE_SIGN_IDENTITY = "Mac Developer";
479 | COMBINE_HIDPI_IMAGES = YES;
480 | CURRENT_PROJECT_VERSION = 7;
481 | DEVELOPMENT_TEAM = DP9Q5R8635;
482 | INFOPLIST_FILE = Alignment/Info.plist;
483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
484 | MARKETING_VERSION = 1.2.0;
485 | PRODUCT_BUNDLE_IDENTIFIER = "com.tid.Alignment-for-Xcode.Alignment";
486 | PRODUCT_NAME = "$(TARGET_NAME)";
487 | SKIP_INSTALL = YES;
488 | SWIFT_VERSION = 5.0;
489 | };
490 | name = Release;
491 | };
492 | /* End XCBuildConfiguration section */
493 |
494 | /* Begin XCConfigurationList section */
495 | 1E6C028B1D11C98C004D2B5E /* Build configuration list for PBXProject "AlignmentForXcode" */ = {
496 | isa = XCConfigurationList;
497 | buildConfigurations = (
498 | 1E6C029D1D11C98D004D2B5E /* Debug */,
499 | 1E6C029E1D11C98D004D2B5E /* Release */,
500 | );
501 | defaultConfigurationIsVisible = 0;
502 | defaultConfigurationName = Release;
503 | };
504 | 1E6C029F1D11C98D004D2B5E /* Build configuration list for PBXNativeTarget "AlignmentForXcode" */ = {
505 | isa = XCConfigurationList;
506 | buildConfigurations = (
507 | 1E6C02A01D11C98D004D2B5E /* Debug */,
508 | 1E6C02A11D11C98D004D2B5E /* Release */,
509 | );
510 | defaultConfigurationIsVisible = 0;
511 | defaultConfigurationName = Release;
512 | };
513 | 1E6C02B51D11C995004D2B5E /* Build configuration list for PBXNativeTarget "Alignment" */ = {
514 | isa = XCConfigurationList;
515 | buildConfigurations = (
516 | 1E6C02B61D11C995004D2B5E /* Debug */,
517 | 1E6C02B71D11C995004D2B5E /* Release */,
518 | );
519 | defaultConfigurationIsVisible = 0;
520 | defaultConfigurationName = Release;
521 | };
522 | /* End XCConfigurationList section */
523 | };
524 | rootObject = 1E6C02881D11C98C004D2B5E /* Project object */;
525 | }
526 |
--------------------------------------------------------------------------------
/AlignmentForXcode.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AlignmentForXcode.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Atsushi Kiwaki (@_tid_)
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Alignment
2 |
3 | This Xcode source editor extension align your assignment statement.
4 |
5 | 
6 |
7 | ## Install:
8 | [](https://itunes.apple.com/us/app/alignment-for-xcode/id1168397789?ls=1&mt=12)
9 |
10 | 
11 |
12 | 
13 |
14 | ## Usage:
15 |
16 | 1. Open your code on Xcode 8
17 | 2. Select your code
18 | 3. Choose menu `Editor > Alignment`
19 |
20 |
21 | ## Settings:
22 | 
23 | * Align assignment
24 | When checked, assignment statement align will be enabled.
25 |
26 | ```
27 | let value = 0
28 | let i = 0
29 | ```
30 |
31 | ```
32 | let value = 0
33 | let i = 0
34 | ```
35 |
36 | * Align type declaration
37 | When checked, type declaration align will be enabled.
38 |
39 | ```
40 | func sort(from: Int,
41 | to: Int) {
42 | }
43 | ```
44 |
45 | ```
46 | func sort(from : Int,
47 | to : Int) {
48 | }
49 | ```
50 |
51 | ## Usage without installing:
52 |
53 | 1. Install Xcode 8
54 | 2. Run Xcode 8 and install additional system components
55 | 3. Open this project in Xcode 8 and run the extension
56 | 4. Choose an app to run: Xcode 8
57 | 5. Select your code
58 | 6. Choose menu `Editor > Alignment`
59 |
60 | License:
61 | =================
62 | The MIT License. See the LICENSE file for more infomation.
63 |
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // XcodeSourceEditorExtension-Alignment
4 | //
5 | // Created by Atsushi Kiwaki on 6/16/16.
6 | // Copyright © 2016 Atsushi Kiwaki. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 |
15 |
16 | func applicationDidFinishLaunching(_ aNotification: Notification) {
17 | // Insert code here to initialize your application
18 | }
19 |
20 | func applicationWillTerminate(_ aNotification: Notification) {
21 | // Insert code here to tear down your application
22 | }
23 |
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "icon_16@1x.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "icon_16@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "icon_32@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "icon_32@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "icon_128@1x.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "icon_128@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "icon_256@1x.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "icon_256@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "icon_512@1x.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "icon_512@2x.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_128@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_128@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_128@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_16@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_16@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_16@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_256@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_256@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_32@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_32@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_32@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_512@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_512@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/AppIcon.appiconset/icon_512@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "icon_256@1x.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "icon_256@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Icon.imageset/icon_256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Icon.imageset/icon_256@1x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Icon.imageset/icon_256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tid-kijyun/XcodeSourceEditorExtension-Alignment/d5b7263fd734fcc517891578c841a93085b4aa22/XcodeSourceEditorExtension-Alignment/Assets.xcassets/Icon.imageset/icon_256@2x.png
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
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 |
747 |
757 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(CURRENT_PROJECT_VERSION)
25 | LSApplicationCategoryType
26 | public.app-category.developer-tools
27 | LSMinimumSystemVersion
28 | $(MACOSX_DEPLOYMENT_TARGET)
29 | NSHumanReadableCopyright
30 | Copyright © 2016 Atsushi Kiwaki. All rights reserved.
31 | NSMainStoryboardFile
32 | Main
33 | NSPrincipalClass
34 | NSApplication
35 | TeamIdentifierPrefix
36 | $(TeamIdentifierPrefix)
37 |
38 |
39 |
--------------------------------------------------------------------------------
/XcodeSourceEditorExtension-Alignment/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // XcodeSourceEditorExtension-Alignment
4 | //
5 | // Created by Atsushi Kiwaki on 6/16/16.
6 | // Copyright © 2016 Atsushi Kiwaki. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | struct ConfigurationKey {
12 | static let EnableAssignment = "KEY_ENABLE_ASSIGNMENT"
13 | static let EnableTypeDeclaration = "KEY_ENABLE_TYPE_DECLARATION"
14 | static let EnableTypeObjectModel = "KEY_ENABLE_TYPE_OBJECT_MODEL"
15 | }
16 |
17 | let linkToGitHub = "https://github.com/tid-kijyun/XcodeSourceEditorExtension-Alignment"
18 |
19 | extension NSButton {
20 | var isChecked: Bool {
21 | return self.state == .on ? true : false
22 | }
23 | }
24 |
25 | class ViewController: NSViewController {
26 | @IBOutlet weak var checkAlignAssignment: NSButton!
27 | @IBOutlet weak var checkAlignObjectModel: NSButton!
28 | @IBOutlet weak var checkAlignTypeDeclaration: NSButton!
29 | @IBOutlet weak var warning: NSTextField!
30 | @IBOutlet weak var version: NSTextField! {
31 | didSet {
32 | version.stringValue = "Version \(Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0")"
33 | }
34 | }
35 | @IBOutlet weak var link: NSTextField! {
36 | didSet {
37 | link.isSelectable = true
38 | link.attributedStringValue = link_string(text: linkToGitHub, url: NSURL(string: linkToGitHub)!)
39 | }
40 | }
41 |
42 | func link_string(text:String, url:NSURL) -> NSMutableAttributedString {
43 | // initially set viewable text
44 | let attrString = NSMutableAttributedString(string: text)
45 | let range = NSRange(location: 0, length: attrString.length)
46 | attrString.beginEditing()
47 | attrString.addAttributes(convertToNSAttributedStringKeyDictionary([
48 | convertFromNSAttributedStringKey(NSAttributedString.Key.link): url.absoluteString!,
49 | convertFromNSAttributedStringKey(NSAttributedString.Key.foregroundColor): NSColor.blue,
50 | convertFromNSAttributedStringKey(NSAttributedString.Key.underlineStyle):NSUnderlineStyle.single.rawValue
51 | ]), range: range)
52 |
53 | attrString.endEditing()
54 | return attrString
55 | }
56 |
57 | private let def = UserDefaults(suiteName: "\(Bundle.main.object(forInfoDictionaryKey: "TeamIdentifierPrefix") as? String ?? "")Alignment-for-Xcode")
58 |
59 | private var isAlignAssignment: Bool = true {
60 | didSet {
61 | checkAlignAssignment.state = isAlignAssignment ? .on : .off
62 | def?.set(isAlignAssignment, forKey: ConfigurationKey.EnableAssignment)
63 | validateSettings()
64 | }
65 | }
66 |
67 | private var isAlignTypeDeclaration: Bool = false {
68 | didSet {
69 | checkAlignTypeDeclaration.state = isAlignTypeDeclaration ? .on : .off
70 | def?.set(isAlignTypeDeclaration, forKey: ConfigurationKey.EnableTypeDeclaration)
71 | validateSettings()
72 | }
73 | }
74 |
75 | private var isAlignTypeObjectModel: Bool = false {
76 | didSet {
77 | checkAlignObjectModel.state = isAlignTypeObjectModel ? .on : .off
78 | def?.set(isAlignTypeDeclaration, forKey: ConfigurationKey.EnableTypeObjectModel)
79 | validateSettings()
80 | }
81 | }
82 |
83 | override func viewDidLoad() {
84 | super.viewDidLoad()
85 |
86 | // Do any additional setup after loading the view.
87 | load()
88 | }
89 |
90 | func load() {
91 | isAlignAssignment = def?.object(forKey: ConfigurationKey.EnableAssignment) as? Bool ?? true
92 | isAlignTypeDeclaration = def?.object(forKey: ConfigurationKey.EnableTypeDeclaration) as? Bool ?? false
93 | isAlignTypeObjectModel = def?.object(forKey: ConfigurationKey.EnableTypeObjectModel) as? Bool ?? false
94 | }
95 |
96 | func validateSettings() {
97 | warning.isHidden = isAlignAssignment || isAlignTypeDeclaration || isAlignTypeObjectModel
98 | }
99 |
100 | override var representedObject: Any? {
101 | didSet {
102 | // Update the view, if already loaded.
103 | }
104 | }
105 |
106 | @IBAction func onCheckAlignAssignment(_ sender: NSButton) {
107 | isAlignAssignment = sender.isChecked
108 |
109 | }
110 | @IBAction func onCheckAlignTypeDeclaration(_ sender: NSButton) {
111 | isAlignTypeDeclaration = sender.isChecked
112 | }
113 |
114 | @IBAction func onCheckAlignObjectModel(_ sender: NSButton) {
115 | isAlignTypeObjectModel = sender.isChecked
116 |
117 | }
118 | }
119 |
120 | // Helper function inserted by Swift 4.2 migrator.
121 | fileprivate func convertToNSAttributedStringKeyDictionary(_ input: [String: Any]) -> [NSAttributedString.Key: Any] {
122 | return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)})
123 | }
124 |
125 | // Helper function inserted by Swift 4.2 migrator.
126 | fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String {
127 | return input.rawValue
128 | }
129 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ## Privacy Policy
2 |
3 | * [english](./privacy/english)
4 |
5 |
--------------------------------------------------------------------------------
/docs/privacy/english.md:
--------------------------------------------------------------------------------
1 | ## Privacy Policy
2 |
3 | Atsushi Kiwaki built the Alignment for Xcode app as an Open Source app. This SERVICE is provided by Atsushi Kiwaki at no cost and is intended for use as is.
4 |
5 | This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
6 |
7 | If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
8 |
9 | The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Alignment for Xcode unless otherwise defined in this Privacy Policy.
10 |
11 | **Information Collection and Use**
12 |
13 | For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not collected by me in any way.
14 |
15 | The app does use third party services that may collect information used to identify you.
16 |
17 | Link to privacy policy of third party service providers used by the app
18 |
19 | **Log Data**
20 |
21 | I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
22 |
23 | **Cookies**
24 |
25 | Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
26 |
27 | This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
28 |
29 | **Service Providers**
30 |
31 | I may employ third-party companies and individuals due to the following reasons:
32 |
33 | * To facilitate our Service;
34 | * To provide the Service on our behalf;
35 | * To perform Service-related services; or
36 | * To assist us in analyzing how our Service is used.
37 |
38 | I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
39 |
40 | **Security**
41 |
42 | I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
43 |
44 | **Links to Other Sites**
45 |
46 | This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
47 |
48 | **Changes to This Privacy Policy**
49 |
50 | I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.
51 |
52 | **Contact Us**
53 |
54 | If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me.
55 |
56 | This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.firebaseapp.com/)
57 |
58 |
--------------------------------------------------------------------------------