Skip to content

Commit

Permalink
Merge branch 'release/0.34.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
intitni committed Sep 13, 2024
2 parents 0332f18 + b996216 commit d89df81
Show file tree
Hide file tree
Showing 131 changed files with 7,869 additions and 3,558 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
BuildableName = "Copilot for Xcode.app"
BlueprintName = "Copilot for Xcode"
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:TestPlan.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
BuildableName = "Copilot for Xcode.app"
BlueprintName = "Copilot for Xcode"
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-_NS_4445425547 YES"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C8189B152938972F00C9DCDA"
BuildableName = "Copilot for Xcode.app"
BlueprintName = "Copilot for Xcode"
ReferencedContainer = "container:Copilot for Xcode.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Debug"
customArchiveName = "Copilot for Xcode Debug"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
reference = "container:TestPlan.xctestplan"
default = "YES">
</TestPlanReference>
<TestPlanReference
reference = "container:Pro/ProTestPlan.xctestplan">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
Expand Down
21 changes: 9 additions & 12 deletions Core/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let package = Package(
name: "Service",
targets: [
"Service",
"SuggestionInjector",
"FileChangeChecker",
"LaunchAgentManager",
"UpdateChecker",
Expand Down Expand Up @@ -45,7 +44,7 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"),
.package(
url: "https://github.com/pointfreeco/swift-composable-architecture",
from: "1.10.4"
exact: "1.10.4"
),
// quick hack to support custom UserDefaults
// https://github.com/sindresorhus/KeyboardShortcuts
Expand Down Expand Up @@ -87,10 +86,12 @@ let package = Package(
.product(name: "UserDefaultsObserver", package: "Tool"),
.product(name: "AppMonitoring", package: "Tool"),
.product(name: "SuggestionBasic", package: "Tool"),
.product(name: "PromptToCode", package: "Tool"),
.product(name: "ChatTab", package: "Tool"),
.product(name: "Logger", package: "Tool"),
.product(name: "OpenAIService", package: "Tool"),
.product(name: "Preferences", package: "Tool"),
.product(name: "CommandHandler", package: "Tool"),
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
.product(name: "Dependencies", package: "swift-dependencies"),
Expand All @@ -104,7 +105,6 @@ let package = Package(
dependencies: [
"Service",
"Client",
"SuggestionInjector",
.product(name: "XPCShared", package: "Tool"),
.product(name: "SuggestionProvider", package: "Tool"),
.product(name: "SuggestionBasic", package: "Tool"),
Expand Down Expand Up @@ -147,20 +147,13 @@ let package = Package(
"ProExtension",
])
),
.target(
name: "SuggestionInjector",
dependencies: [.product(name: "SuggestionBasic", package: "Tool")]
),
.testTarget(
name: "SuggestionInjectorTests",
dependencies: ["SuggestionInjector"]
),

// MARK: - Prompt To Code

.target(
name: "PromptToCodeService",
dependencies: [
.product(name: "PromptToCode", package: "Tool"),
.product(name: "FocusedCodeFinder", package: "Tool"),
.product(name: "SuggestionBasic", package: "Tool"),
.product(name: "OpenAIService", package: "Tool"),
Expand Down Expand Up @@ -228,13 +221,15 @@ let package = Package(
dependencies: [
"PromptToCodeService",
"ChatGPTChatTab",
.product(name: "PromptToCode", package: "Tool"),
.product(name: "Toast", package: "Tool"),
.product(name: "UserDefaultsObserver", package: "Tool"),
.product(name: "SharedUIComponents", package: "Tool"),
.product(name: "AppMonitoring", package: "Tool"),
.product(name: "ChatTab", package: "Tool"),
.product(name: "Logger", package: "Tool"),
.product(name: "CustomAsyncAlgorithms", package: "Tool"),
.product(name: "CodeDiff", package: "Tool"),
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
.product(name: "MarkdownUI", package: "swift-markdown-ui"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
Expand Down Expand Up @@ -337,12 +332,14 @@ let package = Package(
.target(
name: "KeyBindingManager",
dependencies: [
.product(name: "CommandHandler", package: "Tool"),
.product(name: "Workspace", package: "Tool"),
.product(name: "Preferences", package: "Tool"),
.product(name: "Logger", package: "Tool"),
.product(name: "CGEventOverride", package: "CGEventOverride"),
.product(name: "AppMonitoring", package: "Tool"),
.product(name: "UserDefaultsObserver", package: "Tool"),
.product(name: "CGEventOverride", package: "CGEventOverride"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
.testTarget(
Expand Down
55 changes: 46 additions & 9 deletions Core/Sources/ChatGPTChatTab/Chat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,7 @@ struct Chat {
}
}(),
text: message.summary ?? message.content ?? "",
references: message.references.map {
.init(
title: $0.title,
subtitle: $0.subTitle,
uri: $0.uri,
startLine: $0.startLine,
kind: $0.kind
)
}
references: message.references.map(convertReference)
))

for call in message.toolCalls ?? [] {
Expand Down Expand Up @@ -513,3 +505,48 @@ private actor TimedDebounceFunction {
}
}

private func convertReference(
_ reference: ChatMessage.Reference
) -> DisplayedChatMessage.Reference {
.init(
title: reference.title,
subtitle: {
switch reference.kind {
case let .symbol(_, uri, _, _):
return uri
case let .webpage(uri):
return uri
case let .textFile(uri):
return uri
case let .other(kind):
return kind
case .text:
return reference.content
}
}(),
uri: {
switch reference.kind {
case let .symbol(_, uri, _, _):
return uri
case let .webpage(uri):
return uri
case let .textFile(uri):
return uri
case .other:
return ""
case .text:
return ""
}
}(),
startLine: {
switch reference.kind {
case let .symbol(_, _, startLine, _):
return startLine
default:
return nil
}
}(),
kind: reference.kind
)
}

2 changes: 1 addition & 1 deletion Core/Sources/ChatGPTChatTab/ChatPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ struct ChatPanel_Preview: PreviewProvider {
subtitle: "Hi Hi Hi Hi",
uri: "https://google.com",
startLine: nil,
kind: .class
kind: .symbol(.class, uri: "https://google.com", startLine: nil, endLine: nil)
),
]
),
Expand Down
Loading

0 comments on commit d89df81

Please sign in to comment.