Skip to content

Commit f9f0c88

Browse files
committed
Merge branch 'release/0.33.1'
2 parents 4211bc5 + 93640be commit f9f0c88

File tree

136 files changed

+5310
-3470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5310
-3470
lines changed

CommunicationBridge/ServiceDelegate.swift

+20-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ actor EventHandler {
6969
reply(endpoint)
7070
#else
7171
if await launcher.isApplicationValid {
72+
Logger.communicationBridge.info("Service app is still valid")
7273
reply(endpoint)
7374
} else {
7475
endpoint = nil
@@ -116,7 +117,17 @@ actor ExtensionServiceLauncher {
116117
var isLaunching: Bool = false
117118
var application: NSRunningApplication?
118119
var isApplicationValid: Bool {
119-
if let application, !application.isTerminated { return true }
120+
guard let application else { return false }
121+
if application.isTerminated { return false }
122+
let identifier = application.processIdentifier
123+
if let application = NSWorkspace.shared.runningApplications.first(where: {
124+
$0.processIdentifier == identifier
125+
}) {
126+
Logger.communicationBridge.info(
127+
"Service app found: \(application.processIdentifier) \(String(describing: application.bundleIdentifier))"
128+
)
129+
return true
130+
}
120131
return false
121132
}
122133

@@ -125,9 +136,16 @@ actor ExtensionServiceLauncher {
125136
isLaunching = true
126137

127138
Logger.communicationBridge.info("Launching extension service app.")
139+
128140
NSWorkspace.shared.openApplication(
129141
at: appURL,
130-
configuration: .init()
142+
configuration: {
143+
let configuration = NSWorkspace.OpenConfiguration()
144+
configuration.createsNewApplicationInstance = false
145+
configuration.addsToRecentItems = false
146+
configuration.activates = false
147+
return configuration
148+
}()
131149
) { app, error in
132150
if let error = error {
133151
Logger.communicationBridge.error(

Copilot for Xcode.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
C882175C294187EF00A22FD3 /* Client in Frameworks */ = {isa = PBXBuildFile; productRef = C882175B294187EF00A22FD3 /* Client */; };
5454
C89E75C32A46FB32000DD64F /* AppDelegate+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89E75C22A46FB32000DD64F /* AppDelegate+Menu.swift */; };
5555
C8C8B60929AFA35F00034BEE /* CopilotForXcodeExtensionService.app in Embed XPCService */ = {isa = PBXBuildFile; fileRef = C861E60E2994F6070056CB02 /* CopilotForXcodeExtensionService.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
56-
C8DCF00029CE11D500FDDDD7 /* ChatWithSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DCEFFF29CE11D500FDDDD7 /* ChatWithSelection.swift */; };
56+
C8DCF00029CE11D500FDDDD7 /* OpenChat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DCEFFF29CE11D500FDDDD7 /* OpenChat.swift */; };
5757
C8DD9CB12BC673F80036641C /* CloseIdleTabsCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8DD9CB02BC673F80036641C /* CloseIdleTabsCommand.swift */; };
5858
/* End PBXBuildFile section */
5959

@@ -236,7 +236,7 @@
236236
C887BC832965D96000931567 /* DEVELOPMENT.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = DEVELOPMENT.md; sourceTree = "<group>"; };
237237
C89E75C22A46FB32000DD64F /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
238238
C8CD828229B88006008D044D /* TestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestPlan.xctestplan; sourceTree = "<group>"; };
239-
C8DCEFFF29CE11D500FDDDD7 /* ChatWithSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatWithSelection.swift; sourceTree = "<group>"; };
239+
C8DCEFFF29CE11D500FDDDD7 /* OpenChat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenChat.swift; sourceTree = "<group>"; };
240240
C8DD9CB02BC673F80036641C /* CloseIdleTabsCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloseIdleTabsCommand.swift; sourceTree = "<group>"; };
241241
C8F103292A7A365000D28F4F /* launchAgent.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = launchAgent.plist; sourceTree = "<group>"; };
242242
/* End PBXFileReference section */
@@ -320,7 +320,7 @@
320320
C8009C022941C576007AA7E8 /* RealtimeSuggestionCommand.swift */,
321321
C800DBB0294C624D00B04CAC /* PrefetchSuggestionsCommand.swift */,
322322
C8758E6F29F04BFF00D29C1C /* CustomCommand.swift */,
323-
C8DCEFFF29CE11D500FDDDD7 /* ChatWithSelection.swift */,
323+
C8DCEFFF29CE11D500FDDDD7 /* OpenChat.swift */,
324324
C8DD9CB02BC673F80036641C /* CloseIdleTabsCommand.swift */,
325325
C861A6A229E5503F005C41A3 /* PromptToCodeCommand.swift */,
326326
C81458972939EFDC00135263 /* Info.plist */,
@@ -675,7 +675,7 @@
675675
isa = PBXSourcesBuildPhase;
676676
buildActionMask = 2147483647;
677677
files = (
678-
C8DCF00029CE11D500FDDDD7 /* ChatWithSelection.swift in Sources */,
678+
C8DCF00029CE11D500FDDDD7 /* OpenChat.swift in Sources */,
679679
C81458942939EFDC00135263 /* SourceEditorExtension.swift in Sources */,
680680
C8DD9CB12BC673F80036641C /* CloseIdleTabsCommand.swift in Sources */,
681681
C8758E7029F04BFF00D29C1C /* CustomCommand.swift in Sources */,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "C8738B622BE4D4B900609E7F"
19+
BuildableName = "CommunicationBridge"
20+
BlueprintName = "CommunicationBridge"
21+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES"
43+
viewDebuggingEnabled = "No">
44+
<BuildableProductRunnable
45+
runnableDebuggingMode = "0">
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "C8738B622BE4D4B900609E7F"
49+
BuildableName = "CommunicationBridge"
50+
BlueprintName = "CommunicationBridge"
51+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
52+
</BuildableReference>
53+
</BuildableProductRunnable>
54+
</LaunchAction>
55+
<ProfileAction
56+
buildConfiguration = "Release"
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
savedToolIdentifier = ""
59+
useCustomWorkingDirectory = "NO"
60+
debugDocumentVersioning = "YES">
61+
<BuildableProductRunnable
62+
runnableDebuggingMode = "0">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "C8738B622BE4D4B900609E7F"
66+
BuildableName = "CommunicationBridge"
67+
BlueprintName = "CommunicationBridge"
68+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
69+
</BuildableReference>
70+
</BuildableProductRunnable>
71+
</ProfileAction>
72+
<AnalyzeAction
73+
buildConfiguration = "Debug">
74+
</AnalyzeAction>
75+
<ArchiveAction
76+
buildConfiguration = "Release"
77+
revealArchiveInOrganizer = "YES">
78+
</ArchiveAction>
79+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "C8738B772BE5363800609E7F"
19+
BuildableName = "SandboxedClientTester.app"
20+
BlueprintName = "SandboxedClientTester"
21+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "C8738B772BE5363800609E7F"
48+
BuildableName = "SandboxedClientTester.app"
49+
BlueprintName = "SandboxedClientTester"
50+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "C8738B772BE5363800609E7F"
65+
BuildableName = "SandboxedClientTester.app"
66+
BlueprintName = "SandboxedClientTester"
67+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

Core/.swiftpm/xcode/xcshareddata/xcschemes/Core-Package.xcscheme renamed to Core/.swiftpm/xcode/xcshareddata/xcschemes/Client.xcscheme

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1540"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
7-
buildImplicitDependencies = "YES">
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
89
<BuildActionEntries>
910
<BuildActionEntry
1011
buildForTesting = "YES"
@@ -14,9 +15,9 @@
1415
buildForAnalyzing = "YES">
1516
<BuildableReference
1617
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "Core"
18-
BuildableName = "Core"
19-
BlueprintName = "Core"
18+
BlueprintIdentifier = "Client"
19+
BuildableName = "Client"
20+
BlueprintName = "Client"
2021
ReferencedContainer = "container:">
2122
</BuildableReference>
2223
</BuildActionEntry>
@@ -49,9 +50,9 @@
4950
<MacroExpansion>
5051
<BuildableReference
5152
BuildableIdentifier = "primary"
52-
BlueprintIdentifier = "Core"
53-
BuildableName = "Core"
54-
BlueprintName = "Core"
53+
BlueprintIdentifier = "Client"
54+
BuildableName = "Client"
55+
BlueprintName = "Client"
5556
ReferencedContainer = "container:">
5657
</BuildableReference>
5758
</MacroExpansion>

Tool/.swiftpm/xcode/xcshareddata/xcschemes/Tool-Package.xcscheme renamed to Core/.swiftpm/xcode/xcshareddata/xcschemes/HostApp.xcscheme

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1540"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
7-
buildImplicitDependencies = "YES">
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
89
<BuildActionEntries>
910
<BuildActionEntry
1011
buildForTesting = "YES"
@@ -14,9 +15,9 @@
1415
buildForAnalyzing = "YES">
1516
<BuildableReference
1617
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "Tool"
18-
BuildableName = "Tool"
19-
BlueprintName = "Tool"
18+
BlueprintIdentifier = "HostApp"
19+
BuildableName = "HostApp"
20+
BlueprintName = "HostApp"
2021
ReferencedContainer = "container:">
2122
</BuildableReference>
2223
</BuildActionEntry>
@@ -49,9 +50,9 @@
4950
<MacroExpansion>
5051
<BuildableReference
5152
BuildableIdentifier = "primary"
52-
BlueprintIdentifier = "Tool"
53-
BuildableName = "Tool"
54-
BlueprintName = "Tool"
53+
BlueprintIdentifier = "HostApp"
54+
BuildableName = "HostApp"
55+
BlueprintName = "HostApp"
5556
ReferencedContainer = "container:">
5657
</BuildableReference>
5758
</MacroExpansion>

Core/Package.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ let package = Package(
9393
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.1.0"),
9494
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.0.0"),
9595
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.1"),
96-
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "0.5.1"),
96+
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"),
9797
.package(
9898
url: "https://github.com/pointfreeco/swift-composable-architecture",
99-
from: "0.55.0"
99+
from: "1.10.4"
100100
),
101101
// quick hack to support custom UserDefaults
102102
// https://github.com/sindresorhus/KeyboardShortcuts
@@ -126,6 +126,7 @@ let package = Package(
126126
"PromptToCodeService",
127127
"ServiceUpdateMigration",
128128
"ChatGPTChatTab",
129+
"PlusFeatureFlag",
129130
.product(name: "XPCShared", package: "Tool"),
130131
.product(name: "SuggestionProvider", package: "Tool"),
131132
.product(name: "Workspace", package: "Tool"),
@@ -184,6 +185,8 @@ let package = Package(
184185
.target(
185186
name: "SuggestionService",
186187
dependencies: [
188+
.product(name: "UserDefaultsObserver", package: "Tool"),
189+
.product(name: "Preferences", package: "Tool"),
187190
.product(name: "SuggestionModel", package: "Tool"),
188191
.product(name: "SuggestionProvider", package: "Tool")
189192
].pro([

0 commit comments

Comments
 (0)