From 35e291d94f8e3a6db2bf955c2226201f1036efe7 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Sun, 21 May 2023 23:38:06 +0800 Subject: [PATCH 1/4] Fix that "Objective-C"(uppercased) code is not highlighted --- Core/Sources/SuggestionWidget/SyntaxHighlighting.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift b/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift index 761546d7..ce856445 100644 --- a/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift +++ b/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift @@ -77,7 +77,8 @@ func highlightedCodeBlock( return formatted default: var language = language - if language == "objective-c" { + // Workaround: Highlightr uses a different identifier for Objective-C. + if language.lowercased().hasPrefix("objective"), language.lowercased().hasSuffix("c") { language = "objectivec" } func unhighlightedCode() -> NSAttributedString { From 4a1ab57a40de916b7a01d7a557f68b094d6a3c9a Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Tue, 23 May 2023 10:57:30 +0800 Subject: [PATCH 2/4] Fix that the widget can't follow Xcode to another space --- .../SuggestionWidgetController.swift | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift b/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift index 0d31399b..162ce8d4 100644 --- a/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift +++ b/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift @@ -172,10 +172,11 @@ public final class SuggestionWidgetController: NSObject { if app != previousApp { windowChangeObservationTask?.cancel() windowChangeObservationTask = nil - self.observeXcodeWindowChangeIfNeeded(app) + observeXcodeWindowChangeIfNeeded(app) } - await self.updateContentForActiveEditor() - self.updateWindowLocation() + await updateContentForActiveEditor() + updateWindowLocation() + orderFront() } else { if ActiveApplicationMonitor.activeApplication?.bundleIdentifier != Bundle .main.bundleIdentifier @@ -203,11 +204,8 @@ public final class SuggestionWidgetController: NSObject { guard let activeXcode = ActiveApplicationMonitor.activeXcode else { continue } guard fullscreenDetector.isOnActiveSpace else { continue } let app = AXUIElementCreateApplication(activeXcode.processIdentifier) - if let window = app.focusedWindow, window.isFullScreen { - widgetWindow.orderFrontRegardless() - tabWindow.orderFrontRegardless() - panelWindow.orderFrontRegardless() - chatWindow.orderFrontRegardless() + if let window = app.focusedWindow { + orderFront() } } } @@ -263,6 +261,13 @@ public final class SuggestionWidgetController: NSObject { } } } + + func orderFront() { + widgetWindow.orderFrontRegardless() + tabWindow.orderFrontRegardless() + panelWindow.orderFrontRegardless() + chatWindow.orderFrontRegardless() + } } // MARK: - Handle Events From b1d64bcb8ca5a37423b944ffb1c1ca389de5809a Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Tue, 23 May 2023 10:59:12 +0800 Subject: [PATCH 3/4] Bump version to 0.16.1 --- Version.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version.xcconfig b/Version.xcconfig index 10f85f0e..6542541d 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,2 +1,2 @@ -APP_VERSION = 0.16.0 -APP_BUILD = 160 +APP_VERSION = 0.16.1 +APP_BUILD = 161 From 699d11eb38fbb988b78f7c369e2fceec4e278d17 Mon Sep 17 00:00:00 2001 From: Shx Guo Date: Tue, 23 May 2023 11:08:21 +0800 Subject: [PATCH 4/4] Update appcast.xml --- appcast.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/appcast.xml b/appcast.xml index e8f977bc..525c315a 100644 --- a/appcast.xml +++ b/appcast.xml @@ -3,6 +3,18 @@ Copilot for Xcode + + 0.16.1 + Tue, 23 May 2023 11:06:14 +0800 + 161 + 0.16.1 + 12.0 + + https://github.com/intitni/CopilotForXcode/releases/tag/0.16.1 + + + + 0.15.4 Mon, 15 May 2023 22:13:11 +0800