From b7e12cb8a74a5bbde45058f9fd79db7b443467ab Mon Sep 17 00:00:00 2001 From: Maddy <12754347+MaddyDev@users.noreply.github.com> Date: Mon, 17 Aug 2020 08:52:30 -0700 Subject: [PATCH] open resource only when it's file (#11815) --- .../contrib/notebook/browser/notebookExplorer/notebookSearch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookSearch.ts b/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookSearch.ts index 37b25f5497..a412a355b1 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookSearch.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookSearch.ts @@ -225,7 +225,7 @@ export class NotebookSearchView extends SearchView { this.toggleCollapseStateDelayer.trigger(() => this.toggleExpandAction.onTreeCollapseStateChange()) )); this.treeSelectionChangeListener = this._register(this.tree.onDidChangeSelection(async (e) => { - if (this.tree.getSelection().length) { + if (this.tree.getSelection().length && this.tree.getSelection()[0] instanceof FileMatch) { let element = this.tree.getSelection()[0] as Match; const resource = element instanceof Match ? element.parent().resource : (element).resource; if (resource.fsPath.endsWith('.md')) {