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:
Logan Ramos
2021-03-10 14:54:18 -05:00
committed by GitHub
parent 371562f630
commit c72d7612b4
19 changed files with 155 additions and 26 deletions

View File

@@ -755,7 +755,7 @@ export interface ExtHostCustomEditorsShape {
position: EditorGroupColumn,
cancellation: CancellationToken
): Promise<void>;
$createCustomDocument(resource: UriComponents, viewType: string, backupId: string | undefined, cancellation: CancellationToken): Promise<{ editable: boolean }>;
$createCustomDocument(resource: UriComponents, viewType: string, backupId: string | undefined, untitledDocumentData: VSBuffer | undefined, cancellation: CancellationToken): Promise<{ editable: boolean }>;
$disposeCustomDocument(resource: UriComponents, viewType: string): Promise<void>;
$undo(resource: UriComponents, viewType: string, editId: number, isDirty: boolean): Promise<void>;
@@ -1862,7 +1862,7 @@ export interface ExtHostNotebookShape {
$executeNotebookKernelFromProvider(handle: number, uri: UriComponents, kernelId: string, cellHandle: number | undefined): Promise<void>;
$cancelNotebookKernelFromProvider(handle: number, uri: UriComponents, kernelId: string, cellHandle: number | undefined): Promise<void>;
$onDidReceiveMessage(editorId: string, rendererId: string | undefined, message: unknown): void;
$openNotebook(viewType: string, uri: UriComponents, backupId: string | undefined, token: CancellationToken): Promise<NotebookDataDto>;
$openNotebook(viewType: string, uri: UriComponents, backupId: string | undefined, token: CancellationToken, untitledDocumentData?: VSBuffer): Promise<NotebookDataDto>;
$saveNotebook(viewType: string, uri: UriComponents, token: CancellationToken): Promise<boolean>;
$saveNotebookAs(viewType: string, uri: UriComponents, target: UriComponents, token: CancellationToken): Promise<boolean>;
$backupNotebook(viewType: string, uri: UriComponents, cancellation: CancellationToken): Promise<string>;