Skip to content

Commit 4cbd5c3

Browse files
committed
Merge tag '0.30.5' into develop
2 parents 46fff5d + 365050d commit 4cbd5c3

5 files changed

Lines changed: 31 additions & 9 deletions

File tree

Core/Sources/SuggestionWidget/FeatureReducers/WidgetFeature.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public struct WidgetFeature: ReducerProtocol {
100100

101101
case updatePanelStateToMatch(WidgetLocation)
102102
case updateFocusingDocumentURL
103+
case setFocusingDocumentURL(to: URL?)
103104
case updateKeyWindow(WindowCanBecomeKey)
104105

105106
case toastPanel(ToastPanel.Action)
@@ -257,7 +258,8 @@ public struct WidgetFeature: ReducerProtocol {
257258
.notifications(named: NSWorkspace.activeSpaceDidChangeNotification)
258259
for await _ in sequence {
259260
try Task.checkCancellation()
260-
guard let activeXcode = xcodeInspector.activeXcode else { continue }
261+
guard let activeXcode = await xcodeInspector.safe.activeXcode
262+
else { continue }
261263
guard let windowsController,
262264
await windowsController.windows.fullscreenDetector.isOnActiveSpace
263265
else { continue }
@@ -324,7 +326,15 @@ public struct WidgetFeature: ReducerProtocol {
324326
return .none
325327

326328
case .updateFocusingDocumentURL:
327-
state.focusingDocumentURL = xcodeInspector.realtimeActiveDocumentURL
329+
return .run { send in
330+
await send(.setFocusingDocumentURL(
331+
to: await xcodeInspector.safe
332+
.realtimeActiveDocumentURL
333+
))
334+
}
335+
336+
case let .setFocusingDocumentURL(url):
337+
state.focusingDocumentURL = url
328338
return .none
329339

330340
case let .updatePanelStateToMatch(widgetLocation):

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ actor WidgetWindowsController: NSObject {
9292
try Task.checkCancellation()
9393
let xcodeInspector = self.xcodeInspector
9494
let activeApp = await xcodeInspector.safe.activeApplication
95+
let latestActiveXcode = await xcodeInspector.safe.latestActiveXcode
9596
await MainActor.run {
9697
let state = store.withState { $0 }
9798
let isChatPanelDetached = state.chatPanelState.chatPanelInASeparateWindow
@@ -113,8 +114,7 @@ actor WidgetWindowsController: NSObject {
113114
}
114115
} else if let activeApp, activeApp.isExtensionService {
115116
let noFocus = {
116-
guard let xcode = xcodeInspector.latestActiveXcode
117-
else { return true }
117+
guard let xcode = latestActiveXcode else { return true }
118118
if let window = xcode.appElement.focusedWindow,
119119
window.role == "AXWindow"
120120
{
@@ -341,7 +341,7 @@ private extension WidgetWindowsController {
341341
selectionRangeChange.debounce(for: Duration.milliseconds(500)),
342342
scroll
343343
) {
344-
guard xcodeInspector.latestActiveXcode != nil else { return }
344+
guard await xcodeInspector.safe.latestActiveXcode != nil else { return }
345345
try Task.checkCancellation()
346346

347347
// for better looking
@@ -354,7 +354,7 @@ private extension WidgetWindowsController {
354354
}
355355
} else {
356356
for await notification in merge(selectionRangeChange, scroll) {
357-
guard xcodeInspector.latestActiveXcode != nil else { return }
357+
guard await xcodeInspector.safe.latestActiveXcode != nil else { return }
358358
try Task.checkCancellation()
359359

360360
// for better looking

Pro

Submodule Pro updated from e1d6080 to 908dd29

Version.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_VERSION = 0.30.5
2-
APP_BUILD = 326
2+
APP_BUILD = 328
33

appcast.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
33
<channel>
44
<title>Copilot for Xcode</title>
5-
5+
6+
<item>
7+
<title>0.30.5</title>
8+
<pubDate>Thu, 22 Feb 2024 17:05:45 +0800</pubDate>
9+
<sparkle:version>328</sparkle:version>
10+
<sparkle:shortVersionString>0.30.5</sparkle:shortVersionString>
11+
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
12+
<sparkle:releaseNotesLink>
13+
https://github.com/intitni/CopilotForXcode/releases/tag/0.30.5
14+
</sparkle:releaseNotesLink>
15+
<enclosure url="https://github.com/intitni/CopilotForXcode/releases/download/0.30.5/Copilot.for.Xcode.app.zip" length="39926962" type="application/octet-stream" sparkle:edSignature="QfvBMnGQNLE6EX8M251QVKGGW8717PifwGEFvVSj8QYdXmW5FcrHAD+KI7M4c1F3o9tPryjJGw+nk/8YwY1ZDQ=="/>
16+
</item>
17+
618
<item>
719
<title>0.30.5</title>
820
<pubDate>Wed, 21 Feb 2024 23:18:59 +0800</pubDate>

0 commit comments

Comments
 (0)