mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
Fix rest of notebook unhandled promises (#16933)
* Fix rest of notebook unhandled promises * add rule * fix some tests
This commit is contained in:
@@ -48,7 +48,7 @@ export class BookModel {
|
||||
public watchTOC(): void {
|
||||
fs.watchFile(this.tableOfContentsPath, async (curr, prev) => {
|
||||
if (curr.mtime > prev.mtime) {
|
||||
this.reinitializeContents();
|
||||
this.reinitializeContents().catch(err => console.error('Error reinitializing book contents ', err));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ export class BookTocManager implements IBookTocManager {
|
||||
const movedSections = await this.traverseSections(files);
|
||||
this.newSection.sections = movedSections;
|
||||
this._modifiedDirectory.add(path.dirname(section.book.contentPath));
|
||||
this.cleanUp(path.dirname(section.book.contentPath));
|
||||
await this.cleanUp(path.dirname(section.book.contentPath));
|
||||
}
|
||||
|
||||
if (bookItem.book.version === BookVersion.v1) {
|
||||
|
||||
@@ -155,8 +155,8 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
|
||||
async createBook(): Promise<void> {
|
||||
const dialog = new CreateBookDialog(this.bookTocManager);
|
||||
dialog.createDialog();
|
||||
TelemetryReporter.sendActionEvent(BookTelemetryView, NbTelemetryActions.CreateBook);
|
||||
return dialog.createDialog();
|
||||
}
|
||||
|
||||
async getSelectionQuickPick(movingElement: BookTreeItem): Promise<quickPickResults> {
|
||||
@@ -237,7 +237,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
|
||||
if (showPreview) {
|
||||
this.currentBook = this.books.find(book => book.bookPath === bookPath);
|
||||
this._bookViewer.reveal(this.currentBook.bookItems[0], { expand: vscode.TreeItemCollapsibleState.Expanded, focus: true, select: true });
|
||||
await this._bookViewer.reveal(this.currentBook.bookItems[0], { expand: vscode.TreeItemCollapsibleState.Expanded, focus: true, select: true });
|
||||
await this.showPreviewFile(urlToOpen);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ export class BookTrustManager implements IBookTrustManager {
|
||||
let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(constants.notebookConfigKey);
|
||||
let storeInWorspace: boolean = this.hasWorkspaceFolders();
|
||||
|
||||
config.update(constants.trustedBooksConfigKey, bookPaths, storeInWorspace ? false : vscode.ConfigurationTarget.Global);
|
||||
void config.update(constants.trustedBooksConfigKey, bookPaths, storeInWorspace ? false : vscode.ConfigurationTarget.Global);
|
||||
}
|
||||
|
||||
hasWorkspaceFolders(): boolean {
|
||||
|
||||
@@ -23,7 +23,7 @@ export class GitHubRemoteBook extends RemoteBook {
|
||||
this.setLocalPath();
|
||||
this.outputChannel.appendLine(loc.msgDownloadLocation(this.localPath.fsPath));
|
||||
this.outputChannel.appendLine(loc.msgRemoteBookDownloadProgress);
|
||||
this.createDirectory();
|
||||
await this.createDirectory();
|
||||
let notebookConfig = vscode.workspace.getConfiguration(constants.notebookConfigKey);
|
||||
let downloadTimeout = notebookConfig[constants.remoteBookDownloadTimeout];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user