Feat/close book (#9453)

* initial commit

* Add Reveal in Books editor tab context option

* Select item in books viewlet automatically

* changes

* easier than i thought it'd be

* added file watcher on toc file v1

* Merge from Feat/create book

* Undo Merge from Feat/create book

* Use fsPath instead of path

* repen book on toc update

* update book in-place

* fix close book

* error handling for closeBook

* PR comments

* addressed comments

* moved the watch block to try ,watch vs watchFile

Co-authored-by: chlafreniere <hichise@gmail.com>
Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com>
This commit is contained in:
Maddy
2020-03-06 14:55:22 -08:00
committed by GitHub
parent 6f17f0de58
commit 9cc31bee62
7 changed files with 55 additions and 1 deletions

View File

@@ -37,6 +37,8 @@ export class BookModel implements azdata.nb.NavigationProvider {
}
public async initializeContents(): Promise<void> {
this._tableOfContentPaths = [];
this._bookItems = [];
await this.getTableOfContentFiles(this.bookPath);
await this.readBooks();
}
@@ -157,8 +159,8 @@ export class BookModel implements azdata.nb.NavigationProvider {
let uriToNotebook: vscode.Uri = vscode.Uri.file(pathToNotebook);
if (!this._allNotebooks.get(uriToNotebook.fsPath)) {
this._allNotebooks.set(uriToNotebook.fsPath, notebook);
notebooks.push(notebook);
}
notebooks.push(notebook);
}
} else if (await fs.pathExists(pathToMarkdown)) {
let markdown: BookTreeItem = new BookTreeItem({