mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix Notebook Viewlet Highlighting (#10868)
* Stop double tree data provider registrations * revert book finding logic, leverage currentBook
This commit is contained in:
@@ -232,12 +232,10 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
if (!uri) {
|
if (!uri) {
|
||||||
let openDocument = azdata.nb.activeNotebookEditor;
|
let openDocument = azdata.nb.activeNotebookEditor;
|
||||||
if (openDocument) {
|
if (openDocument) {
|
||||||
let book = this.books.find(b => openDocument.document.uri.fsPath.replace(/\\/g, '/').toLowerCase().indexOf(b.bookPath.toLowerCase()) > -1);
|
bookItem = this.currentBook?.getNotebook(openDocument.document.uri.fsPath);
|
||||||
bookItem = book?.getNotebook(openDocument.document.uri.fsPath);
|
|
||||||
}
|
}
|
||||||
} else if (uri.fsPath) {
|
} else if (uri.fsPath) {
|
||||||
let book = this.books.find(b => uri.fsPath.replace(/\\/g, '/').toLowerCase().indexOf(b.bookPath.toLowerCase()) > -1);
|
bookItem = this.currentBook?.getNotebook(uri.fsPath);
|
||||||
bookItem = book?.getNotebook(uri.fsPath);
|
|
||||||
}
|
}
|
||||||
if (bookItem) {
|
if (bookItem) {
|
||||||
// Select + focus item in viewlet if books viewlet is already open, or if we pass in variable
|
// Select + focus item in viewlet if books viewlet is already open, or if we pass in variable
|
||||||
|
|||||||
@@ -134,8 +134,6 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
extensionContext.subscriptions.push(vscode.window.registerTreeDataProvider(BOOKS_VIEWID, bookTreeViewProvider));
|
|
||||||
extensionContext.subscriptions.push(vscode.window.registerTreeDataProvider(PROVIDED_BOOKS_VIEWID, providedBookTreeViewProvider));
|
|
||||||
return {
|
return {
|
||||||
getJupyterController() {
|
getJupyterController() {
|
||||||
return controller;
|
return controller;
|
||||||
|
|||||||
Reference in New Issue
Block a user