Skip to content

Commit 1736ca3

Browse files
committed
Add SuggestionWidgetDataSource
1 parent 8b368e8 commit 1736ca3

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)