Skip to content

Commit d89df81

Browse files
committed
Merge branch 'release/0.34.0'
2 parents 0332f18 + b996216 commit d89df81

131 files changed

Lines changed: 7869 additions & 3558 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1520"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
18+
BuildableName = "Copilot for Xcode.app"
19+
BlueprintName = "Copilot for Xcode"
20+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<TestPlans>
31+
<TestPlanReference
32+
reference = "container:TestPlan.xctestplan"
33+
default = "YES">
34+
</TestPlanReference>
35+
</TestPlans>
36+
</TestAction>
37+
<LaunchAction
38+
buildConfiguration = "Debug"
39+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
40+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
41+
launchStyle = "0"
42+
useCustomWorkingDirectory = "NO"
43+
ignoresPersistentStateOnLaunch = "NO"
44+
debugDocumentVersioning = "YES"
45+
debugServiceExtension = "internal"
46+
allowLocationSimulation = "YES">
47+
<BuildableProductRunnable
48+
runnableDebuggingMode = "0">
49+
<BuildableReference
50+
BuildableIdentifier = "primary"
51+
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
52+
BuildableName = "Copilot for Xcode.app"
53+
BlueprintName = "Copilot for Xcode"
54+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
55+
</BuildableReference>
56+
</BuildableProductRunnable>
57+
<CommandLineArguments>
58+
<CommandLineArgument
59+
argument = "-_NS_4445425547 YES"
60+
isEnabled = "YES">
61+
</CommandLineArgument>
62+
</CommandLineArguments>
63+
</LaunchAction>
64+
<ProfileAction
65+
buildConfiguration = "Release"
66+
shouldUseLaunchSchemeArgsEnv = "YES"
67+
savedToolIdentifier = ""
68+
useCustomWorkingDirectory = "NO"
69+
debugDocumentVersioning = "YES">
70+
<BuildableProductRunnable
71+
runnableDebuggingMode = "0">
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
75+
BuildableName = "Copilot for Xcode.app"
76+
BlueprintName = "Copilot for Xcode"
77+
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
78+
</BuildableReference>
79+
</BuildableProductRunnable>
80+
</ProfileAction>
81+
<AnalyzeAction
82+
buildConfiguration = "Debug">
83+
</AnalyzeAction>
84+
<ArchiveAction
85+
buildConfiguration = "Debug"
86+
customArchiveName = "Copilot for Xcode Debug"
87+
revealArchiveInOrganizer = "YES">
88+
</ArchiveAction>
89+
</Scheme>

Copilot for Xcode.xcodeproj/xcshareddata/xcschemes/ExtensionService.xcscheme

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
reference = "container:TestPlan.xctestplan"
4747
default = "YES">
4848
</TestPlanReference>
49-
<TestPlanReference
50-
reference = "container:Pro/ProTestPlan.xctestplan">
51-
</TestPlanReference>
5249
</TestPlans>
5350
</TestAction>
5451
<LaunchAction

Core/Package.swift

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ let package = Package(
1414
name: "Service",
1515
targets: [
1616
"Service",
17-
"SuggestionInjector",
1817
"FileChangeChecker",
1918
"LaunchAgentManager",
2019
"UpdateChecker",
@@ -45,7 +44,7 @@ let package = Package(
4544
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"),
4645
.package(
4746
url: "https://github.com/pointfreeco/swift-composable-architecture",
48-
from: "1.10.4"
47+
exact: "1.10.4"
4948
),
5049
// quick hack to support custom UserDefaults
5150
// https://github.com/sindresorhus/KeyboardShortcuts
@@ -87,10 +86,12 @@ let package = Package(
8786
.product(name: "UserDefaultsObserver", package: "Tool"),
8887
.product(name: "AppMonitoring", package: "Tool"),
8988
.product(name: "SuggestionBasic", package: "Tool"),
89+
.product(name: "PromptToCode", package: "Tool"),
9090
.product(name: "ChatTab", package: "Tool"),
9191
.product(name: "Logger", package: "Tool"),
9292
.product(name: "OpenAIService", package: "Tool"),
9393
.product(name: "Preferences", package: "Tool"),
94+
.product(name: "CommandHandler", package: "Tool"),
9495
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
9596
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
9697
.product(name: "Dependencies", package: "swift-dependencies"),
@@ -104,7 +105,6 @@ let package = Package(
104105
dependencies: [
105106
"Service",
106107
"Client",
107-
"SuggestionInjector",
108108
.product(name: "XPCShared", package: "Tool"),
109109
.product(name: "SuggestionProvider", package: "Tool"),
110110
.product(name: "SuggestionBasic", package: "Tool"),
@@ -147,20 +147,13 @@ let package = Package(
147147
"ProExtension",
148148
])
149149
),
150-
.target(
151-
name: "SuggestionInjector",
152-
dependencies: [.product(name: "SuggestionBasic", package: "Tool")]
153-
),
154-
.testTarget(
155-
name: "SuggestionInjectorTests",
156-
dependencies: ["SuggestionInjector"]
157-
),
158150

159151
// MARK: - Prompt To Code
160152

161153
.target(
162154
name: "PromptToCodeService",
163155
dependencies: [
156+
.product(name: "PromptToCode", package: "Tool"),
164157
.product(name: "FocusedCodeFinder", package: "Tool"),
165158
.product(name: "SuggestionBasic", package: "Tool"),
166159
.product(name: "OpenAIService", package: "Tool"),
@@ -228,13 +221,15 @@ let package = Package(
228221
dependencies: [
229222
"PromptToCodeService",
230223
"ChatGPTChatTab",
224+
.product(name: "PromptToCode", package: "Tool"),
231225
.product(name: "Toast", package: "Tool"),
232226
.product(name: "UserDefaultsObserver", package: "Tool"),
233227
.product(name: "SharedUIComponents", package: "Tool"),
234228
.product(name: "AppMonitoring", package: "Tool"),
235229
.product(name: "ChatTab", package: "Tool"),
236230
.product(name: "Logger", package: "Tool"),
237231
.product(name: "CustomAsyncAlgorithms", package: "Tool"),
232+
.product(name: "CodeDiff", package: "Tool"),
238233
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
239234
.product(name: "MarkdownUI", package: "swift-markdown-ui"),
240235
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
@@ -337,12 +332,14 @@ let package = Package(
337332
.target(
338333
name: "KeyBindingManager",
339334
dependencies: [
335+
.product(name: "CommandHandler", package: "Tool"),
340336
.product(name: "Workspace", package: "Tool"),
341337
.product(name: "Preferences", package: "Tool"),
342338
.product(name: "Logger", package: "Tool"),
343-
.product(name: "CGEventOverride", package: "CGEventOverride"),
344339
.product(name: "AppMonitoring", package: "Tool"),
345340
.product(name: "UserDefaultsObserver", package: "Tool"),
341+
.product(name: "CGEventOverride", package: "CGEventOverride"),
342+
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
346343
]
347344
),
348345
.testTarget(

Core/Sources/ChatGPTChatTab/Chat.swift

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,7 @@ struct Chat {
343343
}
344344
}(),
345345
text: message.summary ?? message.content ?? "",
346-
references: message.references.map {
347-
.init(
348-
title: $0.title,
349-
subtitle: $0.subTitle,
350-
uri: $0.uri,
351-
startLine: $0.startLine,
352-
kind: $0.kind
353-
)
354-
}
346+
references: message.references.map(convertReference)
355347
))
356348

357349
for call in message.toolCalls ?? [] {
@@ -513,3 +505,48 @@ private actor TimedDebounceFunction {
513505
}
514506
}
515507

508+
private func convertReference(
509+
_ reference: ChatMessage.Reference
510+
) -> DisplayedChatMessage.Reference {
511+
.init(
512+
title: reference.title,
513+
subtitle: {
514+
switch reference.kind {
515+
case let .symbol(_, uri, _, _):
516+
return uri
517+
case let .webpage(uri):
518+
return uri
519+
case let .textFile(uri):
520+
return uri
521+
case let .other(kind):
522+
return kind
523+
case .text:
524+
return reference.content
525+
}
526+
}(),
527+
uri: {
528+
switch reference.kind {
529+
case let .symbol(_, uri, _, _):
530+
return uri
531+
case let .webpage(uri):
532+
return uri
533+
case let .textFile(uri):
534+
return uri
535+
case .other:
536+
return ""
537+
case .text:
538+
return ""
539+
}
540+
}(),
541+
startLine: {
542+
switch reference.kind {
543+
case let .symbol(_, _, startLine, _):
544+
return startLine
545+
default:
546+
return nil
547+
}
548+
}(),
549+
kind: reference.kind
550+
)
551+
}
552+

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ struct ChatPanel_Preview: PreviewProvider {
504504
subtitle: "Hi Hi Hi Hi",
505505
uri: "https://google.com",
506506
startLine: nil,
507-
kind: .class
507+
kind: .symbol(.class, uri: "https://google.com", startLine: nil, endLine: nil)
508508
),
509509
]
510510
),

0 commit comments

Comments
 (0)