Nb/open book without reload (#6635)

* initial commit

* fix: added initialize method to fix the previous/next links rendering

* added checks

* open first markdown/ipynb in the book ans expand the view

* added launch book from command pallete, removed the pick folder and save option added launching the first notebook/markdown

* moved the open book command pallet action from mssql to notebooks

* open as untitled to true

* opening markdown files issue fix

* removed opening as untitled files

* open ipynb files as untitled and changes for previous&next links to work

* add books as seperate viewlet

* localize double quote issues and renamed treeCollapsibleState

* renames and added logic to conditionally show Preview command

* moved registerCommands from widget to extension contribution

* isEditorUntitled check

* async comment updates

* formatting issues.

* promisfying the async calls

* moved existsAsync to top
This commit is contained in:
Maddy
2019-08-23 11:19:35 -07:00
committed by GitHub
parent 1a39fdae24
commit 9274f223f0
9 changed files with 576 additions and 464 deletions

View File

@@ -100,6 +100,8 @@ class AzdataExtensionBookContributionProvider extends Disposable implements Book
this._onContributionsChanged.fire(this);
}
}, undefined, this._disposables);
this.registerCommands();
}
private readonly _onContributionsChanged = this._register(new vscode.EventEmitter<this>());
@@ -117,8 +119,18 @@ class AzdataExtensionBookContributionProvider extends Disposable implements Book
.map(BookContributions.fromExtension)
.reduce(BookContributions.merge, []);
}
private registerCommands(): void {
this.contributions.map(book => {
let bookName: string = path.basename(book.path);
vscode.commands.executeCommand('setContext', bookName, true);
vscode.commands.registerCommand('books.' + bookName, async (context) => {
vscode.commands.executeCommand('bookTreeView.openBook', book.path, true);
});
});
}
}
export function getBookExtensionContributions(context: vscode.ExtensionContext): BookContributionProvider {
return new AzdataExtensionBookContributionProvider(context.extensionPath);
}
}