mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix some issues with book tree view (#10521)
This commit is contained in:
@@ -86,7 +86,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
if (notebookDocuments) {
|
if (notebookDocuments) {
|
||||||
// update trust state of opened items
|
// update trust state of opened items
|
||||||
notebookDocuments.forEach(document => {
|
notebookDocuments.forEach(document => {
|
||||||
let notebook = this.currentBook.getNotebook(document.uri.fsPath);
|
let notebook = this.currentBook?.getNotebook(document.uri.fsPath);
|
||||||
if (notebook && this._bookTrustManager.isNotebookTrustedByDefault(document.uri.fsPath)) {
|
if (notebook && this._bookTrustManager.isNotebookTrustedByDefault(document.uri.fsPath)) {
|
||||||
document.setTrusted(true);
|
document.setTrusted(true);
|
||||||
}
|
}
|
||||||
@@ -235,10 +235,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) {
|
||||||
bookItem = this.currentBook.getNotebook(openDocument.document.uri.fsPath);
|
bookItem = this.currentBook?.getNotebook(openDocument.document.uri.fsPath);
|
||||||
}
|
}
|
||||||
} else if (uri.fsPath) {
|
} else if (uri.fsPath) {
|
||||||
bookItem = this.currentBook.getNotebook(uri.fsPath);
|
bookItem = this.currentBook?.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
|
||||||
@@ -276,7 +276,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
async saveJupyterBooks(): Promise<void> {
|
async saveJupyterBooks(): Promise<void> {
|
||||||
if (this.currentBook.bookPath) {
|
if (this.currentBook?.bookPath) {
|
||||||
const allFilesFilter = loc.allFiles;
|
const allFilesFilter = loc.allFiles;
|
||||||
let filter: any = {};
|
let filter: any = {};
|
||||||
filter[allFilesFilter] = '*';
|
filter[allFilesFilter] = '*';
|
||||||
|
|||||||
Reference in New Issue
Block a user