From e5b86a24a319f82592d832026d7ffb0cfaa365a0 Mon Sep 17 00:00:00 2001 From: Thanh Vu Date: Fri, 29 Mar 2024 00:53:01 +0700 Subject: [PATCH] fix: build on xcode 15.3 --- Config.debug.xcconfig | 4 +- Config.xcconfig | 4 +- Copilot for Xcode.xcodeproj/project.pbxproj | 16 ++-- .../xcshareddata/swiftpm/Package.resolved | 84 +++++++++++++------ Core/Sources/Service/Helpers.swift | 6 +- .../PromptToCodePanel.swift | 1 + .../Sources/SuggestionWidget/WidgetView.swift | 1 + ExtensionPoint.appextensionpoint | 2 +- README.md | 6 +- Tool/Package.swift | 2 +- .../CodeiumLanguageServer.swift | 2 +- .../CodeiumService/CodeiumService.swift | 2 +- .../GitHubCopilotService.swift | 2 +- Tool/Sources/Logger/Logger.swift | 2 +- .../APIs/GoogleAIChatCompletionsService.swift | 8 ++ Version.xcconfig | 4 +- launchAgent.plist | 4 +- 17 files changed, 98 insertions(+), 52 deletions(-) diff --git a/Config.debug.xcconfig b/Config.debug.xcconfig index 5417881b..1715a927 100644 --- a/Config.debug.xcconfig +++ b/Config.debug.xcconfig @@ -2,10 +2,10 @@ SLASH = / HOST_APP_NAME = Copilot for Xcode Dev -BUNDLE_IDENTIFIER_BASE = dev.com.intii.CopilotForXcode +BUNDLE_IDENTIFIER_BASE = dev.com.ahiho.CopilotForXcode SPARKLE_FEED_URL = http:$(SLASH)$(SLASH)127.0.0.1:9433/appcast.xml SPARKLE_PUBLIC_KEY = WDzm5GHnc6c8kjeJEgX5GuGiPpW6Lc/ovGjLnrrZvPY= -APPLICATION_SUPPORT_FOLDER = dev.com.intii.CopilotForXcode +APPLICATION_SUPPORT_FOLDER = dev.com.ahiho.CopilotForXcode EXTENSION_BUNDLE_NAME = Copilot Dev EXTENSION_BUNDLE_DISPLAY_NAME = Copilot Dev EXTENSION_SERVICE_NAME = CopilotForXcodeExtensionService diff --git a/Config.xcconfig b/Config.xcconfig index 1c65b4c7..3b014a9a 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -2,10 +2,10 @@ SLASH = / HOST_APP_NAME = Copilot for Xcode -BUNDLE_IDENTIFIER_BASE = com.intii.CopilotForXcode +BUNDLE_IDENTIFIER_BASE = com.ahiho.CopilotForXcode SPARKLE_FEED_URL = https:$(SLASH)$(SLASH)raw.githubusercontent.com/intitni/CopilotForXcode/main/appcast.xml SPARKLE_PUBLIC_KEY = WDzm5GHnc6c8kjeJEgX5GuGiPpW6Lc/ovGjLnrrZvPY= -APPLICATION_SUPPORT_FOLDER = com.intii.CopilotForXcode +APPLICATION_SUPPORT_FOLDER = com.ahiho.CopilotForXcode EXTENSION_BUNDLE_NAME = Copilot EXTENSION_BUNDLE_DISPLAY_NAME = Copilot EXTENSION_SERVICE_NAME = CopilotForXcodeExtensionService diff --git a/Copilot for Xcode.xcodeproj/project.pbxproj b/Copilot for Xcode.xcodeproj/project.pbxproj index 13ab8477..c8b66398 100644 --- a/Copilot for Xcode.xcodeproj/project.pbxproj +++ b/Copilot for Xcode.xcodeproj/project.pbxproj @@ -596,7 +596,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = EditorExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "$(EXTESNION_BUNDLE_NAME)"; @@ -623,7 +623,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = EditorExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "$(EXTESNION_BUNDLE_NAME)"; @@ -769,7 +769,7 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; DEVELOPMENT_ASSET_PATHS = "\"Copilot for Xcode/Preview Content\""; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -801,7 +801,7 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; DEVELOPMENT_ASSET_PATHS = "\"Copilot for Xcode/Preview Content\""; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -825,7 +825,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; MACOSX_DEPLOYMENT_TARGET = 12.0; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -838,7 +838,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; MACOSX_DEPLOYMENT_TARGET = 12.0; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -856,7 +856,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -888,7 +888,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "$(APP_BUILD)"; - DEVELOPMENT_TEAM = 5YKZ4Y3DAW; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; diff --git a/Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved index c5870abd..91ec3f36 100644 --- a/Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/combine-schedulers", "state" : { - "revision" : "0625932976b3ae23949f6b816d13bd97f3b40b7c", - "version" : "0.10.0" + "revision" : "ec62f32d21584214a4b27c8cee2b2ad70ab2c38a", + "version" : "0.11.0" } }, { @@ -27,6 +27,15 @@ "version" : "1.0.2" } }, + { + "identity" : "generative-ai-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/generative-ai-swift", + "state" : { + "revision" : "e2cebcd90645a3a94c0c823696e510a176bc384a", + "version" : "0.4.8" + } + }, { "identity" : "glob", "kind" : "remoteSourceControl", @@ -54,6 +63,15 @@ "version" : "0.6.0" } }, + { + "identity" : "keyboardshortcuts", + "kind" : "remoteSourceControl", + "location" : "https://github.com/intitni/KeyboardShortcuts", + "state" : { + "branch" : "main", + "revision" : "65fb410b0c6d3ed96623b460bab31ffce5f48b4d" + } + }, { "identity" : "languageclient", "kind" : "remoteSourceControl", @@ -99,6 +117,24 @@ "version" : "2.4.2" } }, + { + "identity" : "sttextkitplus", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzyzanowskim/STTextKitPlus", + "state" : { + "revision" : "5500fa8811ed339605b0861ae0390677863a7bfe", + "version" : "0.0.2" + } + }, + { + "identity" : "sttextview", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzyzanowskim/STTextView", + "state" : { + "revision" : "e9e54718b882115db69ec1e17ac1bec844906cd9", + "version" : "0.9.0" + } + }, { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", @@ -131,8 +167,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-clocks", "state" : { - "revision" : "f9acfa1a45f4483fe0f2c434a74e6f68f865d12d", - "version" : "0.3.0" + "revision" : "0fbaebfc013715dab44d715a4d350ba37f297e4d", + "version" : "0.4.0" } }, { @@ -149,8 +185,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-composable-architecture", "state" : { - "revision" : "89f80fe2400d21a853abc9556a060a2fa50eb2cb", - "version" : "0.55.0" + "revision" : "9f4202ab5b8422aa90f0ed983bf7652c3af7abf0", + "version" : "0.59.0" + } + }, + { + "identity" : "swift-concurrency-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-concurrency-extras", + "state" : { + "revision" : "479750bd98fac2e813fffcf2af0728b5b0085795", + "version" : "0.1.1" } }, { @@ -158,8 +203,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-custom-dump", "state" : { - "revision" : "3a35f7892e7cf6ba28a78cd46a703c0be4e0c6dc", - "version" : "0.11.0" + "revision" : "0a5bff05fe01dcd513932ed338a4efad8268b803", + "version" : "0.11.2" } }, { @@ -167,8 +212,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-dependencies", "state" : { - "revision" : "de1a984a71e51f6e488e98ce3652035563eb8acb", - "version" : "0.5.1" + "revision" : "16fd42ae04c6e7f74a6a86395d04722c641cccee", + "version" : "0.6.0" } }, { @@ -203,8 +248,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax.git", "state" : { - "branch" : "main", - "revision" : "aa3b1e187c9cc568f9d1abc47feb11f6b044d284" + "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", + "version" : "509.0.2" } }, { @@ -219,10 +264,10 @@ { "identity" : "swifttreesitter", "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/SwiftTreeSitter", + "location" : "https://github.com/intitni/SwiftTreeSitter.git", "state" : { - "revision" : "df25a52f72ebc5b50ae20d26d1363793408bb28b", - "version" : "0.7.1" + "branch" : "main", + "revision" : "fd499bfafcccfae12a1a579dc922d8418025a35d" } }, { @@ -252,15 +297,6 @@ "revision" : "1b54ef0b5efddddf393b45e173788499cc572048" } }, - { - "identity" : "tree-sitter-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/alex-pinkus/tree-sitter-swift", - "state" : { - "branch" : "with-generated-files", - "revision" : "eda05af7ac41adb4eb19c346883c0fa32fe3bdd8" - } - }, { "identity" : "usearch", "kind" : "remoteSourceControl", diff --git a/Core/Sources/Service/Helpers.swift b/Core/Sources/Service/Helpers.swift index a2c16a85..53fd21cd 100644 --- a/Core/Sources/Service/Helpers.swift +++ b/Core/Sources/Service/Helpers.swift @@ -35,16 +35,16 @@ extension NSError { case .timeout: message = "Timeout." } - return NSError(domain: "com.intii.CopilotForXcode", code: -1, userInfo: [ + return NSError(domain: "com.ahiho.CopilotForXcode", code: -1, userInfo: [ NSLocalizedDescriptionKey: message, ]) } if let error = error as? CancellationError { - return NSError(domain: "com.intii.CopilotForXcode", code: -100, userInfo: [ + return NSError(domain: "com.ahiho.CopilotForXcode", code: -100, userInfo: [ NSLocalizedDescriptionKey: error.localizedDescription, ]) } - return NSError(domain: "com.intii.CopilotForXcode", code: -1, userInfo: [ + return NSError(domain: "com.ahiho.CopilotForXcode", code: -1, userInfo: [ NSLocalizedDescriptionKey: error.localizedDescription, ]) } diff --git a/Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift b/Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift index 98b5707f..9b94eaa3 100644 --- a/Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift +++ b/Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift @@ -41,6 +41,7 @@ extension PromptToCodePanel { Button(action: { withAnimation(.linear(duration: 0.1)) { store.send(.selectionRangeToggleTapped) + return } }) { WithViewStore( diff --git a/Core/Sources/SuggestionWidget/WidgetView.swift b/Core/Sources/SuggestionWidget/WidgetView.swift index 04c11c86..baf70c22 100644 --- a/Core/Sources/SuggestionWidget/WidgetView.swift +++ b/Core/Sources/SuggestionWidget/WidgetView.swift @@ -19,6 +19,7 @@ struct WidgetView: View { .onTapGesture { withAnimation(.easeInOut(duration: 0.2)) { store.send(.widgetClicked) + return } } .overlay { WidgetAnimatedCircle(store: store) } diff --git a/ExtensionPoint.appextensionpoint b/ExtensionPoint.appextensionpoint index 0a3d3f89..dd4a61a4 100644 --- a/ExtensionPoint.appextensionpoint +++ b/ExtensionPoint.appextensionpoint @@ -2,7 +2,7 @@ - com.intii.CopilotForXcode.ExtensionService.Extension + com.ahiho.CopilotForXcode.ExtensionService.Extension EXPresentsUserInterface diff --git a/README.md b/README.md index cbff5a77..83cf5980 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ When this hotkey is not set to enabled globally, it will only work when the serv 5. After signing in, return to the app and click on "Confirm Sign-in" to complete the process. 6. Go to "Feature - Suggestion" and update the feature provider to "GitHub Copilot". -The installed language server is located at `~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/`. +The installed language server is located at `~/Library/Application Support/com.ahiho.CopilotForXcode/GitHub Copilot/executable/`. #### Setting Up Codeium @@ -165,7 +165,7 @@ The installed language server is located at `~/Library/Application Support/com.i > The key is stored in the keychain. When the helper app tries to access the key for the first time, it will prompt you to enter the password to access the keychain. Please select "Always Allow" to let the helper app access the key. -The installed language server is located at `~/Library/Application Support/com.intii.CopilotForXcode/Codeium/executable/`. +The installed language server is located at `~/Library/Application Support/com.ahiho.CopilotForXcode/Codeium/executable/`. #### Using Locally Run LLMs @@ -371,7 +371,7 @@ The currently available Plus features include: - Browser tab in chat panel. - Unlimited custom commands. -Since the app needs to manage license keys, it will send network request to `https://copilotforxcode-license.intii.com`, +Since the app needs to manage license keys, it will send network request to `https://copilotforxcode-license.ahiho.com`, - when you activate the license key - when you deactivate the license key diff --git a/Tool/Package.swift b/Tool/Package.swift index 61b90ca5..0adb902e 100644 --- a/Tool/Package.swift +++ b/Tool/Package.swift @@ -59,7 +59,7 @@ let package = Package( .package(url: "https://github.com/intitni/Highlightr", branch: "bump-highlight-js-version"), .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - from: "0.55.0" + from: "0.56.0" ), .package(url: "https://github.com/apple/swift-syntax.git", exact: "509.0.2"), .package(url: "https://github.com/GottaGetSwifty/CodableWrappers", from: "2.0.7"), diff --git a/Tool/Sources/CodeiumService/CodeiumLanguageServer.swift b/Tool/Sources/CodeiumService/CodeiumLanguageServer.swift index ad0916e8..732513b8 100644 --- a/Tool/Sources/CodeiumService/CodeiumLanguageServer.swift +++ b/Tool/Sources/CodeiumService/CodeiumLanguageServer.swift @@ -189,7 +189,7 @@ final class IOTransport { stdoutPipe = Pipe() stderrPipe = Pipe() closed = false - queue = DispatchQueue(label: "com.intii.CopilotForXcode.IOTransport") + queue = DispatchQueue(label: "com.ahiho.CopilotForXcode.IOTransport") setupFileHandleHandlers() } diff --git a/Tool/Sources/CodeiumService/CodeiumService.swift b/Tool/Sources/CodeiumService/CodeiumService.swift index 7448e102..b79744b2 100644 --- a/Tool/Sources/CodeiumService/CodeiumService.swift +++ b/Tool/Sources/CodeiumService/CodeiumService.swift @@ -98,7 +98,7 @@ public class CodeiumSuggestionService { let metadata = try await getMetadata() let tempFolderURL = FileManager.default.temporaryDirectory let managerDirectoryURL = tempFolderURL - .appendingPathComponent("com.intii.CopilotForXcode") + .appendingPathComponent("com.ahiho.CopilotForXcode") .appendingPathComponent(UUID().uuidString) if !FileManager.default.fileExists(atPath: managerDirectoryURL.path) { try FileManager.default.createDirectory( diff --git a/Tool/Sources/GitHubCopilotService/GitHubCopilotService.swift b/Tool/Sources/GitHubCopilotService/GitHubCopilotService.swift index e18eb58a..8f9c075f 100644 --- a/Tool/Sources/GitHubCopilotService/GitHubCopilotService.swift +++ b/Tool/Sources/GitHubCopilotService/GitHubCopilotService.swift @@ -54,7 +54,7 @@ enum GitHubCopilotError: Error, LocalizedError { public extension Notification.Name { static let gitHubCopilotShouldRefreshEditorInformation = Notification - .Name("com.intii.CopilotForXcode.GitHubCopilotShouldRefreshEditorInformation") + .Name("com.ahiho.CopilotForXcode.GitHubCopilotShouldRefreshEditorInformation") } public class GitHubCopilotBaseService { diff --git a/Tool/Sources/Logger/Logger.swift b/Tool/Sources/Logger/Logger.swift index b24912ed..2b50d8b0 100644 --- a/Tool/Sources/Logger/Logger.swift +++ b/Tool/Sources/Logger/Logger.swift @@ -27,7 +27,7 @@ public final class Logger { public static let temp = Logger(category: "Temp") #endif - public init(subsystem: String = "com.intii.CopilotForXcode", category: String) { + public init(subsystem: String = "com.ahiho.CopilotForXcode", category: String) { self.subsystem = subsystem self.category = category osLog = OSLog(subsystem: subsystem, category: category) diff --git a/Tool/Sources/OpenAIService/APIs/GoogleAIChatCompletionsService.swift b/Tool/Sources/OpenAIService/APIs/GoogleAIChatCompletionsService.swift index 80a5c9b8..df845efc 100644 --- a/Tool/Sources/OpenAIService/APIs/GoogleAIChatCompletionsService.swift +++ b/Tool/Sources/OpenAIService/APIs/GoogleAIChatCompletionsService.swift @@ -53,6 +53,10 @@ actor GoogleAIChatCompletionsService: ChatCompletionsAPI, ChatCompletionsStreamA throw error case .responseStoppedEarly: throw error + case .invalidAPIKey: + throw error + case .unsupportedUserLocation: + throw error } } catch { throw error @@ -100,6 +104,10 @@ actor GoogleAIChatCompletionsService: ChatCompletionsAPI, ChatCompletionsStreamA continuation.finish(throwing: error) case .responseStoppedEarly: continuation.finish(throwing: error) + case .invalidAPIKey: + continuation.finish(throwing: error) + case .unsupportedUserLocation: + continuation.finish(throwing: error) } } catch { continuation.finish(throwing: error) diff --git a/Version.xcconfig b/Version.xcconfig index efa04634..ea36c06e 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,3 +1,3 @@ -APP_VERSION = 0.31.2 -APP_BUILD = 340 +APP_VERSION = 0.31.3 +APP_BUILD = 341 diff --git a/launchAgent.plist b/launchAgent.plist index 7b248b50..1b8efbba 100644 --- a/launchAgent.plist +++ b/launchAgent.plist @@ -3,12 +3,12 @@ Label - com.intii.CopilotForXcode.ExtensionService + com.ahiho.CopilotForXcode.ExtensionService Program /Applications/Copilot for Xcode.app/Contents/Applications/CopilotForXcodeExtensionService.app/Contents/MacOS/CopilotForXcodeExtensionService MachServices - com.intii.CopilotForXcode.ExtensionService + com.ahiho.CopilotForXcode.ExtensionService