diff options
author | Zac Pullar-Strecker <[email protected]> | 2020-07-31 03:12:44 +0100 |
---|---|---|
committer | Zac Pullar-Strecker <[email protected]> | 2020-07-31 03:12:44 +0100 |
commit | f05d7b41a719d848844b054a16477b29d0f063c6 (patch) | |
tree | 0a8a0946e8aef2ce64d4c13d0035ba41cce2daf3 /editors/code/src/snippets.ts | |
parent | 73ff610e41959e3e7c78a2b4b25b086883132956 (diff) | |
parent | 6b7cb8b5ab539fc4333ce34bc29bf77c976f232a (diff) |
Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links
Hasn't fixed tests yet.
Diffstat (limited to 'editors/code/src/snippets.ts')
-rw-r--r-- | editors/code/src/snippets.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editors/code/src/snippets.ts b/editors/code/src/snippets.ts index bcb3f2cc7..258b49982 100644 --- a/editors/code/src/snippets.ts +++ b/editors/code/src/snippets.ts | |||
@@ -6,6 +6,10 @@ export async function applySnippetWorkspaceEdit(edit: vscode.WorkspaceEdit) { | |||
6 | assert(edit.entries().length === 1, `bad ws edit: ${JSON.stringify(edit)}`); | 6 | assert(edit.entries().length === 1, `bad ws edit: ${JSON.stringify(edit)}`); |
7 | const [uri, edits] = edit.entries()[0]; | 7 | const [uri, edits] = edit.entries()[0]; |
8 | 8 | ||
9 | if (vscode.window.activeTextEditor?.document.uri !== uri) { | ||
10 | // `vscode.window.visibleTextEditors` only contains editors whose contents are being displayed | ||
11 | await vscode.window.showTextDocument(uri, {}); | ||
12 | } | ||
9 | const editor = vscode.window.visibleTextEditors.find((it) => it.document.uri.toString() === uri.toString()); | 13 | const editor = vscode.window.visibleTextEditors.find((it) => it.document.uri.toString() === uri.toString()); |
10 | if (!editor) return; | 14 | if (!editor) return; |
11 | await applySnippetTextEdits(editor, edits); | 15 | await applySnippetTextEdits(editor, edits); |