Skip to content

Commit 729feb1

Browse files
committed
Update accepting suggestions to remove suggestion snapshot
1 parent 2becfe2 commit 729feb1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Core/Sources/Service/Workspace.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ final class Filespace {
3333
self.fileURL = fileURL
3434
}
3535

36-
func reset() {
36+
func reset(resetSnapshot: Bool = true) {
3737
suggestions = []
3838
suggestionIndex = 0
39+
if resetSnapshot {
40+
Snapshot = .init(linesHash: -1, cursorPosition: .outOfScope)
41+
}
3942
}
4043
}
4144

@@ -168,7 +171,7 @@ extension Workspace {
168171
Task {
169172
await service.notifyRejected(filespaces[fileURL]?.suggestions ?? [])
170173
}
171-
filespaces[fileURL]?.reset()
174+
filespaces[fileURL]?.reset(resetSnapshot: false)
172175
}
173176

174177
func acceptSuggestion(forFileAt fileURL: URL) -> CopilotCompletion? {

0 commit comments

Comments
 (0)