Skip to content

Commit dd52003

Browse files
Merge pull request #7 from winkelsdorf/feature/Darkmode-and-Embedding
Feature/Darkmode and Embedding
2 parents a93681a + dcd8940 commit dd52003

File tree

11 files changed

+34
-40
lines changed

11 files changed

+34
-40
lines changed

CommentWrapper.xcodeproj/project.pbxproj

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
67A3C0BC207A8B8900E93876 /* Itemizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A3C0B9207A8AE600E93876 /* Itemizer.swift */; };
5050
67A3C0BE207A8D3E00E93876 /* CommentUnwrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A3C0BD207A8D3E00E93876 /* CommentUnwrapperTests.swift */; };
5151
67A3C0C0207A8D5B00E93876 /* TestStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A3C0BF207A8D5B00E93876 /* TestStrings.swift */; };
52-
67ABFBBE25B445EA00DAA9DC /* XcodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67ABFBBD25B445EA00DAA9DC /* XcodeKit.framework */; };
52+
D4C7432625BC392200C4FE38 /* XcodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67ABFBBD25B445EA00DAA9DC /* XcodeKit.framework */; };
53+
D4C7432725BC392200C4FE38 /* XcodeKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 67ABFBBD25B445EA00DAA9DC /* XcodeKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5354
/* End PBXBuildFile section */
5455

5556
/* Begin PBXContainerItemProxy section */
@@ -81,6 +82,17 @@
8182
name = "Embed App Extensions";
8283
runOnlyForDeploymentPostprocessing = 0;
8384
};
85+
D4C7432825BC392200C4FE38 /* Embed Frameworks */ = {
86+
isa = PBXCopyFilesBuildPhase;
87+
buildActionMask = 2147483647;
88+
dstPath = "";
89+
dstSubfolderSpec = 10;
90+
files = (
91+
D4C7432725BC392200C4FE38 /* XcodeKit.framework in Embed Frameworks */,
92+
);
93+
name = "Embed Frameworks";
94+
runOnlyForDeploymentPostprocessing = 0;
95+
};
8496
/* End PBXCopyFilesBuildPhase section */
8597

8698
/* Begin PBXFileReference section */
@@ -145,8 +157,8 @@
145157
isa = PBXFrameworksBuildPhase;
146158
buildActionMask = 2147483647;
147159
files = (
148-
67ABFBBE25B445EA00DAA9DC /* XcodeKit.framework in Frameworks */,
149160
67A3C094207822DD00E93876 /* Cocoa.framework in Frameworks */,
161+
D4C7432625BC392200C4FE38 /* XcodeKit.framework in Frameworks */,
150162
);
151163
runOnlyForDeploymentPostprocessing = 0;
152164
};
@@ -325,6 +337,7 @@
325337
67A3C08E207822DD00E93876 /* Frameworks */,
326338
67A3C08F207822DD00E93876 /* Resources */,
327339
675DC4002095B8F7007142A7 /* Set Build Number */,
340+
D4C7432825BC392200C4FE38 /* Embed Frameworks */,
328341
);
329342
buildRules = (
330343
);
@@ -801,7 +814,7 @@
801814
);
802815
MARKETING_VERSION = 1.0.1;
803816
PRODUCT_BUNDLE_IDENTIFIER = com.stevebarnegren.xcodecommentwrapperext;
804-
PRODUCT_MODULE_NAME = Comment_Wrapper_Ext;
817+
PRODUCT_MODULE_NAME = CommentWrapperExt;
805818
PRODUCT_NAME = "$(TARGET_NAME)";
806819
PROVISIONING_PROFILE = "6124f69c-ec06-4601-82c5-7b59a9be6f1c";
807820
PROVISIONING_PROFILE_SPECIFIER = "XcodeCommentWrapperExt-macOS-Development";
@@ -827,7 +840,7 @@
827840
);
828841
MARKETING_VERSION = 1.0.1;
829842
PRODUCT_BUNDLE_IDENTIFIER = com.stevebarnegren.xcodecommentwrapperext;
830-
PRODUCT_MODULE_NAME = Comment_Wrapper_Ext;
843+
PRODUCT_MODULE_NAME = CommentWrapperExt;
831844
PRODUCT_NAME = "$(TARGET_NAME)";
832845
PROVISIONING_PROFILE = "09b44ae6-a2ad-462d-b720-4ab39eb1263e";
833846
PROVISIONING_PROFILE_SPECIFIER = "XcodeCommentWrapperExt-macOS-AdHoc";

CommentWrapper.xcodeproj/xcshareddata/xcschemes/CommentWrapperExt.xcscheme

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Scheme
33
LastUpgradeVersion = "1220"
44
wasCreatedForAppExtension = "YES"
5-
version = "2.0">
5+
version = "1.3">
66
<BuildAction
77
parallelizeBuildables = "YES"
88
buildImplicitDependencies = "YES">
@@ -69,18 +69,16 @@
6969
selectedDebuggerIdentifier = ""
7070
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
7171
launchStyle = "0"
72-
askForAppToLaunch = "Yes"
7372
useCustomWorkingDirectory = "NO"
7473
ignoresPersistentStateOnLaunch = "NO"
7574
debugDocumentVersioning = "YES"
7675
debugServiceExtension = "internal"
77-
allowLocationSimulation = "YES"
78-
launchAutomaticallySubstyle = "2">
79-
<RemoteRunnable
76+
allowLocationSimulation = "YES">
77+
<PathRunnable
8078
runnableDebuggingMode = "0"
8179
BundleIdentifier = "com.apple.dt.Xcode"
82-
RemotePath = "/Applications/Xcode.app">
83-
</RemoteRunnable>
80+
FilePath = "/Applications/Xcode.app">
81+
</PathRunnable>
8482
<MacroExpansion>
8583
<BuildableReference
8684
BuildableIdentifier = "primary"

CommentWrapper/About/AboutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AboutViewController: NSViewController {
3232

3333
let text = $0!.title
3434
let font = $0!.font!
35-
let color = NSColor.blue
35+
let color = NSColor.linkColor
3636

3737
let attributedString =
3838
AttributedStringBuilder()

CommentWrapper/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
</customView>
187187
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c85-CW-ted">
188188
<rect key="frame" x="251" y="360" width="238" height="24"/>
189-
<segmentedCell key="cell" borderStyle="border" alignment="left" segmentDistribution="fillEqually" style="rounded" trackingMode="selectOne" id="Gto-Cc-orR">
189+
<segmentedCell key="cell" borderStyle="border" alignment="left" segmentDistribution="fillEqually" style="capsule" trackingMode="selectOne" id="Gto-Cc-orR">
190190
<font key="font" metaFont="system"/>
191191
<segments>
192192
<segment label="What" width="77" selected="YES"/>

CommentWrapper/Content/ContentBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import AttributedStringBuilder
1313
class ContentBuilder {
1414

1515
private let stringBuilder = AttributedStringBuilder()
16-
private let textColor = NSColor.black
16+
private let textColor = NSColor.textColor
1717
private let codeFont = NSFont(name: "menlo", size: 11.5)!
1818

1919
@discardableResult func title(_ string: String) -> ContentBuilder {

CommentWrapper/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<key>LSMinimumSystemVersion</key>
2626
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2727
<key>NSHumanReadableCopyright</key>
28-
<string>Copyright © 2018 Steve Barnegren. All rights reserved.</string>
28+
<string>Copyright © 2021 Steve Barnegren. All rights reserved.</string>
2929
<key>NSMainStoryboardFile</key>
3030
<string>Main</string>
3131
<key>NSPrincipalClass</key>

CommentWrapperExt/CommentUnwrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CommentUnwrapper {
4848
var reversed = Array(items.reversed())
4949
while let next = reversed.popLast() {
5050

51-
//next.debug_print()
51+
// next.debug_print()
5252

5353
switch next {
5454
case .word(let word):

CommentWrapperExt/CommentWrapper.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@
88

99
import Foundation
1010

11-
public extension Array {
12-
13-
mutating func popFirst() -> Element? {
14-
15-
if self.isEmpty {
16-
return nil
17-
} else {
18-
return self.remove(at: 0)
19-
}
20-
}
21-
}
22-
2311
class CommentWrapper {
2412

2513
static func wrap(string: String, lineLength: Int) -> String {
@@ -58,7 +46,7 @@ class CommentWrapper {
5846
var reversed = Array(items.reversed())
5947
while let next = reversed.popLast() {
6048

61-
//next.debug_print()
49+
// next.debug_print()
6250

6351
switch next {
6452
case .word(let word):

CommentWrapperExt/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundleName</key>
1616
<string>$(PRODUCT_NAME)</string>
1717
<key>CFBundlePackageType</key>
18-
<string>XPC!</string>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
@@ -29,12 +29,12 @@
2929
<key>XCSourceEditorCommandDefinitions</key>
3030
<array/>
3131
<key>XCSourceEditorExtensionPrincipalClass</key>
32-
<string>Comment_Wrapper_Ext.SourceEditorExtension</string>
32+
<string>$(PRODUCT_MODULE_NAME).SourceEditorExtension</string>
3333
</dict>
3434
<key>NSExtensionPointIdentifier</key>
3535
<string>com.apple.dt.Xcode.extension.source-editor</string>
3636
</dict>
3737
<key>NSHumanReadableCopyright</key>
38-
<string>Copyright © 2018 Steve Barnegren. All rights reserved.</string>
38+
<string>Copyright © 2021 Steve Barnegren. All rights reserved.</string>
3939
</dict>
4040
</plist>

CommentWrapperExt/SourceEditorCommand.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import Foundation
1212
import XcodeKit
1313

14-
enum Action: String {
14+
enum Action: String, CaseIterable {
1515
case wrap40 = "commentwrapper.wrap-40"
1616
case wrap60 = "commentwrapper.wrap-60"
1717
case wrap80 = "commentwrapper.wrap-80"
@@ -48,10 +48,6 @@ enum Action: String {
4848
case .rewrap80: return 80
4949
}
5050
}
51-
52-
static var all: [Action] {
53-
return [Action.wrap40, .wrap60, .wrap80, .unwrap, .rewrap40, .rewrap60, .rewrap80]
54-
}
5551
}
5652

5753
class SourceEditorCommand: NSObject, XCSourceEditorCommand {

0 commit comments

Comments
 (0)