Book/untitled file name updates (#8579)

* file-name has entire path as name, changes to address that

* await promises
This commit is contained in:
Maddy
2019-12-18 09:09:17 -08:00
committed by GitHub
parent a67e3abb4c
commit 746b4d7815
3 changed files with 8 additions and 18 deletions

View File

@@ -211,8 +211,8 @@ export class BookModel implements azdata.nb.NavigationProvider {
if (notebook) {
result = {
hasNavigation: true,
previous: notebook.previousUri ? this.openAsUntitled ? this.getPlatformSpecificUri(notebook.previousUri) : vscode.Uri.file(notebook.previousUri) : undefined,
next: notebook.nextUri ? this.openAsUntitled ? this.getPlatformSpecificUri(notebook.nextUri) : vscode.Uri.file(notebook.nextUri) : undefined
previous: notebook.previousUri ? this.openAsUntitled ? this.getUntitledUri(notebook.previousUri) : vscode.Uri.file(notebook.previousUri) : undefined,
next: notebook.nextUri ? this.openAsUntitled ? this.getUntitledUri(notebook.nextUri) : vscode.Uri.file(notebook.nextUri) : undefined
};
} else {
result = {
@@ -224,12 +224,7 @@ export class BookModel implements azdata.nb.NavigationProvider {
return Promise.resolve(result);
}
getPlatformSpecificUri(resource: string): vscode.Uri {
if (process.platform === 'win32') {
return vscode.Uri.parse(`untitled:${resource}`);
}
else {
return vscode.Uri.parse(resource).with({ scheme: 'untitled' });
}
getUntitledUri(resource: string): vscode.Uri {
return vscode.Uri.parse(`untitled:${resource}`);
}
}