mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
slightly better uri for untitled notebooks, https://github.com/microsoft/vscode/issues/121974
This commit is contained in:
@@ -119,12 +119,12 @@ export class MainThreadNotebookDocuments implements MainThreadNotebookDocumentsS
|
||||
};
|
||||
}
|
||||
|
||||
async $tryCreateNotebook(options: { viewType?: string, content?: NotebookDataDto }): Promise<UriComponents> {
|
||||
async $tryCreateNotebook(options: { viewType: string, content?: NotebookDataDto }): Promise<UriComponents> {
|
||||
|
||||
// find a free URI for the untitled case
|
||||
let uri: URI;
|
||||
for (let counter = 1; ; counter++) {
|
||||
let candidate = URI.from({ scheme: Schemas.untitled, path: `Untitled-Notebook-${counter}` });
|
||||
let candidate = URI.from({ scheme: Schemas.untitled, path: `Untitled-${counter}`, query: options.viewType });
|
||||
if (!this._notebookService.getNotebookTextModel(candidate)) {
|
||||
uri = candidate;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user