Skip to content

Commit 0f2f1d4

Browse files
committed
Update command feature arguments to optional
1 parent 720a67e commit 0f2f1d4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import Foundation
22

33
public struct CustomCommand: Codable {
4+
/// The custom command feature.
5+
///
6+
/// Keep everything optional so nothing will break when the format changes.
47
public enum Feature: Codable {
5-
case promptToCode(prompt: String, continuousMode: Bool)
6-
case chatWithSelection(prompt: String)
8+
case promptToCode(prompt: String?, continuousMode: Bool?)
9+
case chatWithSelection(prompt: String?)
710
case customChat(systemPrompt: String?, prompt: String?)
811
}
9-
12+
1013
public var name: String
1114
public var feature: Feature
1215
}

Core/Sources/Service/SuggestionCommandHandler/WindowBaseCommandHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ extension WindowBaseCommandHandler {
294294
try await presentPromptToCode(
295295
editor: editor,
296296
prompt: prompt,
297-
isContinuous: continuousMode
297+
isContinuous: continuousMode ?? false
298298
)
299299
}
300300
}

0 commit comments

Comments
 (0)