Skip to content

Commit d1121aa

Browse files
committed
Merge tag '0.17.1' into develop
2 parents 7e38c07 + b5f91b6 commit d1121aa

4 files changed

Lines changed: 21 additions & 10 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ public final class SuggestionWidgetController: NSObject {
275275

276276
public extension SuggestionWidgetController {
277277
func suggestCode(fileURL: URL) {
278-
widgetViewModel.endIsProcessing()
279278
Task {
279+
markAsProcessing(true)
280+
defer { markAsProcessing(false) }
280281
if let suggestion = await dataSource?.suggestionForFile(at: fileURL) {
281282
suggestionPanelViewModel.content = .suggestion(suggestion)
282283
suggestionPanelViewModel.isPanelDisplayed = true
@@ -285,7 +286,6 @@ public extension SuggestionWidgetController {
285286
}
286287

287288
func discardSuggestion(fileURL: URL) {
288-
widgetViewModel.endIsProcessing()
289289
Task {
290290
await updateContentForActiveEditor(fileURL: fileURL)
291291
}
@@ -302,12 +302,12 @@ public extension SuggestionWidgetController {
302302
func presentError(_ errorDescription: String) {
303303
suggestionPanelViewModel.content = .error(errorDescription)
304304
suggestionPanelViewModel.isPanelDisplayed = true
305-
widgetViewModel.endIsProcessing()
306305
}
307306

308307
func presentChatRoom(fileURL: URL) {
309-
widgetViewModel.endIsProcessing()
310308
Task {
309+
markAsProcessing(true)
310+
defer { markAsProcessing(false) }
311311
if let chat = await dataSource?.chatForFile(at: fileURL) {
312312
chatWindowViewModel.chat = chat
313313
chatWindowViewModel.isPanelDisplayed = true
@@ -347,15 +347,15 @@ public extension SuggestionWidgetController {
347347
}
348348

349349
func closeChatRoom(fileURL: URL) {
350-
widgetViewModel.endIsProcessing()
351350
Task {
352351
await updateContentForActiveEditor(fileURL: fileURL)
353352
}
354353
}
355354

356355
func presentPromptToCode(fileURL: URL) {
357-
widgetViewModel.endIsProcessing()
358356
Task {
357+
markAsProcessing(true)
358+
defer { markAsProcessing(false) }
359359
if let provider = await dataSource?.promptToCodeForFile(at: fileURL) {
360360
suggestionPanelViewModel.content = .promptToCode(provider)
361361
suggestionPanelViewModel.isPanelDisplayed = true
@@ -371,7 +371,6 @@ public extension SuggestionWidgetController {
371371
}
372372

373373
func discardPromptToCode(fileURL: URL) {
374-
widgetViewModel.endIsProcessing()
375374
Task {
376375
await updateContentForActiveEditor(fileURL: fileURL)
377376
}

Core/Sources/SuggestionWidget/WidgetView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class WidgetViewModel: ObservableObject {
1212

1313
private var isProcessingCounters = [IsProcessingCounter]()
1414
private var cleanupIsProcessingCounterTask: Task<Void, Error>?
15-
@Published var isProcessing: Bool
15+
@Published private(set) var isProcessing: Bool
1616
@Published var currentFileURL: URL?
1717

1818
func markIsProcessing(date: Date = Date()) {

Version.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION = 0.17.0
2-
APP_BUILD = 170
1+
APP_VERSION = 0.17.1
2+
APP_BUILD = 171

appcast.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
<channel>
44
<title>Copilot for Xcode</title>
55

6+
<item>
7+
<title>0.17.1</title>
8+
<pubDate>Wed, 31 May 2023 12:30:21 +0800</pubDate>
9+
<sparkle:version>171</sparkle:version>
10+
<sparkle:shortVersionString>0.17.1</sparkle:shortVersionString>
11+
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
12+
<sparkle:releaseNotesLink>
13+
https://github.com/intitni/CopilotForXcode/releases/tag/0.17.1
14+
</sparkle:releaseNotesLink>
15+
<enclosure url="https://github.com/intitni/CopilotForXcode/releases/download/0.17.1/Copilot.for.Xcode.app.zip" length="19078871" type="application/octet-stream" sparkle:edSignature="YCA19m2Ct8oM45VQXGWqYDL3OLdAL4dT9ZOJinc2w8VExVy/21ei27x9+qA8/7F/+njC3vpdJ/8K3fu3PYDSDw=="/>
16+
</item>
17+
618
<item>
719
<title>0.17.0</title>
820
<pubDate>Sat, 27 May 2023 15:33:25 +0800</pubDate>

0 commit comments

Comments
 (0)