mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
Add an untitled document data property (#115790)
* Add an untitled document data property * Dispose of the model passed back * Fix layer problem * Add untitledDocumentData to untitled notebooks * Fix compilation errors * Switch to using VS Buffer * Fix threading the untitled document data back through * Prevent save dialog on untitled reopen with * Change ignore save setting * Change setting name and abide by preserve focus * Add unit test * Switch to js doc comments * Consolidate calculating the untitled value, and added test
This commit is contained in:
@@ -25,6 +25,7 @@ import { ExtHostNotebookEditor } from './extHostNotebookEditor';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { IRelativePattern } from 'vs/base/common/glob';
|
||||
import { assertIsDefined } from 'vs/base/common/types';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { hash } from 'vs/base/common/hash';
|
||||
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
|
||||
|
||||
@@ -497,9 +498,9 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
|
||||
// --- open, save, saveAs, backup
|
||||
|
||||
async $openNotebook(viewType: string, uri: UriComponents, backupId: string | undefined, token: CancellationToken): Promise<NotebookDataDto> {
|
||||
async $openNotebook(viewType: string, uri: UriComponents, backupId: string | undefined, token: CancellationToken, untitledDocumentData?: VSBuffer): Promise<NotebookDataDto> {
|
||||
const { provider } = this._getProviderData(viewType);
|
||||
const data = await provider.openNotebook(URI.revive(uri), { backupId }, token);
|
||||
const data = await provider.openNotebook(URI.revive(uri), { backupId, untitledDocumentData: untitledDocumentData?.buffer }, token);
|
||||
return {
|
||||
metadata: {
|
||||
...notebookDocumentMetadataDefaults,
|
||||
|
||||
Reference in New Issue
Block a user