Books/viewlet refactor (#7208)

* add saved/untitled views to the books viewlet and provide save option to untitled

* addressed comments

* fixes after merge

* await on async methods

* reverted back

* await on promise

* added localize for books view names

* initial commit

* missed a file change

* changes to make the merges work part1

* fixes after merges 2

* getChildren to get all books

* chnages to address comments

* fsPromises instead of fs.readSync

* merged master

* replaced deprecated fs.exists async call with pathExists

* renamed method
This commit is contained in:
Maddy
2019-09-20 10:47:33 -07:00
committed by GitHub
parent 1f61a2581c
commit ac6a4e590d
12 changed files with 439 additions and 242 deletions

View File

@@ -708,8 +708,8 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
let result = await this._proxy.$getNavigation(handle, uri);
if (result) {
if (result.next.scheme === Schemas.untitled) {
let untitledNbName: URI = URI.parse(`untitled:${path.basename(result.next.path)}`);
let content = await this._fileService.readFile(URI.parse(result.next.path));
let untitledNbName: URI = URI.parse(`untitled:${result.next.path}`);
let content = await this._fileService.readFile(URI.file(result.next.path));
await this.doOpenEditor(untitledNbName, { initialContent: content.value.toString(), initialDirtyState: false });
}
else {
@@ -721,8 +721,8 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
let result = await this._proxy.$getNavigation(handle, uri);
if (result) {
if (result.previous.scheme === Schemas.untitled) {
let untitledNbName: URI = URI.parse(`untitled:${path.basename(result.previous.path)}`);
let content = await this._fileService.readFile(URI.parse(result.previous.path));
let untitledNbName: URI = URI.parse(`untitled:${result.previous.path}`);
let content = await this._fileService.readFile(URI.file(result.previous.path));
await this.doOpenEditor(untitledNbName, { initialContent: content.value.toString(), initialDirtyState: false });
}
else {