Skip to content

Commit 5ecabf9

Browse files
firelizzard18suzmue
authored andcommitted
src/goTest: populate tests for open docs on start
Reverts CL 343490 and explicitly scans all open documents when the extension is activated. From the discussion on microsoft/vscode#131282, I am confident that the strage Git URLs are created by the Git extension and are not intended for use by other extensions. Change-Id: I234c572e9f31b0af5eb21dd2e0ff67d8f4d818a7 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/348570 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Trust: Suzy Mueller <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 079e752 commit 5ecabf9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/goTest/explore.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export class GoTestExplorer {
4040
symProvider.provideDocumentSymbols(doc, token)
4141
);
4242

43+
// Process already open editors
44+
vscode.window.visibleTextEditors.forEach((ed) => {
45+
inst.documentUpdate(ed.document);
46+
});
47+
4348
context.subscriptions.push(ctrl);
4449
context.subscriptions.push(vscode.window.registerTreeDataProvider('go.test.profile', inst.profiler.view));
4550

@@ -271,12 +276,6 @@ export class GoTestExplorer {
271276

272277
// Handle opened documents, document changes, and file creation.
273278
private async documentUpdate(doc: TextDocument, ranges?: Range[]) {
274-
if (doc.uri.scheme === 'git') {
275-
// TODO(firelizzard18): When a workspace is reopened, VSCode passes us git: URIs. Why?
276-
const { path } = JSON.parse(doc.uri.query);
277-
doc = await vscode.workspace.openTextDocument(path);
278-
}
279-
280279
if (!doc.uri.path.endsWith('_test.go')) {
281280
return;
282281
}

0 commit comments

Comments
 (0)