From cce8a961ac2ddf2634ca4f7ba7beedbad40e646a Mon Sep 17 00:00:00 2001 From: Barbara Valdez <34872381+barbaravaldez@users.noreply.github.com> Date: Wed, 3 Feb 2021 18:17:08 -0800 Subject: [PATCH] Fix decorations for modified notebooks in Books View (#14152) * Tree item resource uri should be the root when it's a book and notebook path for notebooks --- extensions/notebook/src/book/bookTreeItem.ts | 2 +- .../browser/notebookExplorer/notebookExplorerViewlet.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/notebook/src/book/bookTreeItem.ts b/extensions/notebook/src/book/bookTreeItem.ts index 6fc19bdcce..0c3927f2e1 100644 --- a/extensions/notebook/src/book/bookTreeItem.ts +++ b/extensions/notebook/src/book/bookTreeItem.ts @@ -82,7 +82,7 @@ export class BookTreeItem extends vscode.TreeItem { } this._rootContentPath = getContentPath(this.book.version, this.book.root, ''); this.tooltip = this.book.type === BookTreeItemType.Book ? this._rootContentPath : this.book.contentPath; - this.resourceUri = vscode.Uri.file(this.book.root); + this.resourceUri = this.book.type === BookTreeItemType.Book ? vscode.Uri.file(this.book.root) : vscode.Uri.file(this.book.contentPath); } } diff --git a/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet.ts b/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet.ts index fa610216aa..c546ae6498 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet.ts @@ -291,7 +291,7 @@ export class NotebookExplorerViewPaneContainer extends ViewPaneContainer { filesToIncludeFiltered = filesToIncludeFiltered + path.join(folderToSearch.folder.fsPath, '**', '*.md') + ',' + path.join(folderToSearch.folder.fsPath, '**', '*.ipynb') + ','; } else { let pattern = {}; - let rootFolder = URI.file(root.resourceUri.path); + let rootFolder = URI.file(path.dirname(root.resourceUri.path)); let pathToNotebook = isString(root.tooltip) ? root.tooltip : root.tooltip.value; let baseName = path.join('**', path.basename(pathToNotebook)); pattern[baseName] = true;