Skip to content

Commit 205aa50

Browse files
committed
dispose event
1 parent cffd4bc commit 205aa50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/specialCommands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ export default () => {
254254

255255
onCompletionAcceptedOverride.value = () => {}
256256
const { ranges, text } = await new Promise<{ text: string; ranges: vscode.Range[] }>(resolve => {
257-
vscode.workspace.onDidChangeTextDocument(({ document, contentChanges }) => {
257+
const { dispose } = vscode.workspace.onDidChangeTextDocument(({ document, contentChanges }) => {
258258
if (document !== editor.document || contentChanges.length === 0) return
259259
const ranges = contentChanges.map(
260260
change => new vscode.Range(change.range.start, offsetPosition(document, change.range.start, change.text.length)),
261261
)
262+
dispose()
262263
resolve({ ranges, text: contentChanges[0]!.text })
263264
})
264265
void vscode.commands.executeCommand('acceptSelectedSuggestion')

0 commit comments

Comments
 (0)