We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b368e8 commit 1736ca3Copy full SHA for 1736ca3
1 file changed
Core/Sources/SuggestionWidget/SuggestionWidgetDataSource.swift
@@ -0,0 +1,28 @@
1
+import Foundation
2
+
3
+public protocol SuggestionWidgetDataSource {
4
+ func suggestionForFile(at path: URL) -> (SuggestionProvider)?
5
+ func chatForFile(at path: URL) -> ChatProvider?
6
+}
7
8
+struct MockWidgetDataSource: SuggestionWidgetDataSource {
9
+ func suggestionForFile(at path: URL) -> (SuggestionProvider)? {
10
+ return SuggestionProvider(
11
+ code: """
12
+ func test() {
13
+ let x = 1
14
+ let y = 2
15
+ let z = x + y
16
+ }
17
+ """,
18
+ language: "swift",
19
+ startLineIndex: 1,
20
+ suggestionCount: 3,
21
+ currentSuggestionIndex: 0
22
+ )
23
24
25
+ func chatForFile(at path: URL) -> ChatProvider? {
26
+ return nil
27
28
0 commit comments