mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
highlight correct notebook on navigation. (#10807)
* highlight correct notebook on navigation. * add back behavior of highight on viewlet visible * optimize bookViewer create * createTreeView for every book
This commit is contained in:
@@ -183,9 +183,6 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
this.revealActiveDocumentInViewlet();
|
||||
}
|
||||
});
|
||||
azdata.nb.onDidChangeActiveNotebookEditor(e => {
|
||||
this.revealActiveDocumentInViewlet(e.document.uri, false);
|
||||
});
|
||||
}
|
||||
|
||||
async showPreviewFile(urlToOpen?: string): Promise<void> {
|
||||
@@ -235,10 +232,12 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
if (!uri) {
|
||||
let openDocument = azdata.nb.activeNotebookEditor;
|
||||
if (openDocument) {
|
||||
bookItem = this.currentBook?.getNotebook(openDocument.document.uri.fsPath);
|
||||
let book = this.books.find(b => openDocument.document.uri.fsPath.replace(/\\/g, '/').toLowerCase().indexOf(b.bookPath.toLowerCase()) > -1);
|
||||
bookItem = book?.getNotebook(openDocument.document.uri.fsPath);
|
||||
}
|
||||
} else if (uri.fsPath) {
|
||||
bookItem = this.currentBook?.getNotebook(uri.fsPath);
|
||||
let book = this.books.find(b => uri.fsPath.replace(/\\/g, '/').toLowerCase().indexOf(b.bookPath.toLowerCase()) > -1);
|
||||
bookItem = book?.getNotebook(uri.fsPath);
|
||||
}
|
||||
if (bookItem) {
|
||||
// Select + focus item in viewlet if books viewlet is already open, or if we pass in variable
|
||||
|
||||
Reference in New Issue
Block a user