@codingame/monaco-vscode-notebook-service-override 20.1.1 → 20.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +23 -23
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.d.ts +26 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +20 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +69 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +67 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +37 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts +67 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-notebook-service-override",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - notebook service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,28 +15,28 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-0cd5242b-7b61-5f66-ac25-ffa40baf8e8f-common": "20.
|
|
19
|
-
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "20.
|
|
20
|
-
"@codingame/monaco-vscode-23aade48-f094-5c08-9555-97fc9cca96c9-common": "20.
|
|
21
|
-
"@codingame/monaco-vscode-3109a756-1f83-5d09-945b-9f0fcad928f0-common": "20.
|
|
22
|
-
"@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "20.
|
|
23
|
-
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "20.
|
|
24
|
-
"@codingame/monaco-vscode-622c0cca-d5fa-59b6-b730-0715afcf93ee-common": "20.
|
|
25
|
-
"@codingame/monaco-vscode-670aae94-7f88-54d7-90ea-6fcbef423557-common": "20.
|
|
26
|
-
"@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common": "20.
|
|
27
|
-
"@codingame/monaco-vscode-6f9bc782-77e0-5716-93bd-b05210c768c5-common": "20.
|
|
28
|
-
"@codingame/monaco-vscode-88aa9a78-75f5-5aaa-89e9-bbdd580b3b5c-common": "20.
|
|
29
|
-
"@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common": "20.
|
|
30
|
-
"@codingame/monaco-vscode-9ed6fe06-a052-57c2-a234-5d9b94d2e7e0-common": "20.
|
|
31
|
-
"@codingame/monaco-vscode-9ee79c1a-3f03-568b-8eac-b02513a98b68-common": "20.
|
|
32
|
-
"@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common": "20.
|
|
33
|
-
"@codingame/monaco-vscode-api": "20.
|
|
34
|
-
"@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common": "20.
|
|
35
|
-
"@codingame/monaco-vscode-b99aef83-0d60-5e8c-a62e-9908b6256f35-common": "20.
|
|
36
|
-
"@codingame/monaco-vscode-caeb744c-8e3f-5c11-80fb-0f057d24d544-common": "20.
|
|
37
|
-
"@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common": "20.
|
|
38
|
-
"@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common": "20.
|
|
39
|
-
"@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common": "20.
|
|
18
|
+
"@codingame/monaco-vscode-0cd5242b-7b61-5f66-ac25-ffa40baf8e8f-common": "20.2.1",
|
|
19
|
+
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "20.2.1",
|
|
20
|
+
"@codingame/monaco-vscode-23aade48-f094-5c08-9555-97fc9cca96c9-common": "20.2.1",
|
|
21
|
+
"@codingame/monaco-vscode-3109a756-1f83-5d09-945b-9f0fcad928f0-common": "20.2.1",
|
|
22
|
+
"@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "20.2.1",
|
|
23
|
+
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "20.2.1",
|
|
24
|
+
"@codingame/monaco-vscode-622c0cca-d5fa-59b6-b730-0715afcf93ee-common": "20.2.1",
|
|
25
|
+
"@codingame/monaco-vscode-670aae94-7f88-54d7-90ea-6fcbef423557-common": "20.2.1",
|
|
26
|
+
"@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common": "20.2.1",
|
|
27
|
+
"@codingame/monaco-vscode-6f9bc782-77e0-5716-93bd-b05210c768c5-common": "20.2.1",
|
|
28
|
+
"@codingame/monaco-vscode-88aa9a78-75f5-5aaa-89e9-bbdd580b3b5c-common": "20.2.1",
|
|
29
|
+
"@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common": "20.2.1",
|
|
30
|
+
"@codingame/monaco-vscode-9ed6fe06-a052-57c2-a234-5d9b94d2e7e0-common": "20.2.1",
|
|
31
|
+
"@codingame/monaco-vscode-9ee79c1a-3f03-568b-8eac-b02513a98b68-common": "20.2.1",
|
|
32
|
+
"@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common": "20.2.1",
|
|
33
|
+
"@codingame/monaco-vscode-api": "20.2.1",
|
|
34
|
+
"@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common": "20.2.1",
|
|
35
|
+
"@codingame/monaco-vscode-b99aef83-0d60-5e8c-a62e-9908b6256f35-common": "20.2.1",
|
|
36
|
+
"@codingame/monaco-vscode-caeb744c-8e3f-5c11-80fb-0f057d24d544-common": "20.2.1",
|
|
37
|
+
"@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common": "20.2.1",
|
|
38
|
+
"@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common": "20.2.1",
|
|
39
|
+
"@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common": "20.2.1",
|
|
40
40
|
"dompurify": "3.2.6",
|
|
41
41
|
"marked": "14.0.0"
|
|
42
42
|
},
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
1
6
|
.monaco-editor .contentWidgets .empty-editor-hint {
|
|
2
7
|
color: var(--vscode-input-placeholderForeground);
|
|
3
8
|
}
|
|
9
|
+
|
|
4
10
|
.monaco-editor .contentWidgets .empty-editor-hint a {
|
|
5
11
|
color: var(--vscode-textLink-foreground)
|
|
6
12
|
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
1
6
|
.monaco-workbench .notebookOverlay.notebook-editor.find-hide-transition {
|
|
2
7
|
overflow-y: hidden;
|
|
3
8
|
}
|
|
9
|
+
|
|
4
10
|
.monaco-workbench .notebookOverlay.notebook-editor.find-show-transition {
|
|
5
11
|
overflow-y: hidden;
|
|
6
12
|
}
|
|
13
|
+
|
|
7
14
|
.monaco-workbench .notebookOverlay.notebook-editor .simple-fr-find-part-wrapper .matchesCount {
|
|
8
15
|
text-align: center;
|
|
9
16
|
text-overflow: ellipsis;
|
|
@@ -12,6 +19,7 @@
|
|
|
12
19
|
padding: 0 2px;
|
|
13
20
|
box-sizing: border-box;
|
|
14
21
|
}
|
|
22
|
+
|
|
15
23
|
.monaco-workbench .nb-findScope {
|
|
16
24
|
background-color: var(--vscode-editor-findRangeHighlightBackground);
|
|
17
25
|
}
|
|
@@ -5,6 +5,9 @@ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
5
5
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
6
6
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
7
7
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
8
|
+
/**
|
|
9
|
+
* Sets a context key when a notebook has ever been opened by the user
|
|
10
|
+
*/
|
|
8
11
|
export declare class NotebookGettingStarted extends Disposable implements IWorkbenchContribution {
|
|
9
12
|
constructor(_editorService: IEditorService, _storageService: IStorageService, _contextKeyService: IContextKeyService, _commandService: ICommandService, _configurationService: IConfigurationService);
|
|
10
13
|
}
|
|
@@ -61,6 +61,11 @@ export declare class NotebookMultiCursorController extends Disposable implements
|
|
|
61
61
|
undo(): Promise<void>;
|
|
62
62
|
redo(): Promise<void>;
|
|
63
63
|
private constructCellEditorOptions;
|
|
64
|
+
/**
|
|
65
|
+
* Updates the multicursor selection decorations for a specific matched cell
|
|
66
|
+
*
|
|
67
|
+
* @param cell -- match object containing the viewmodel + selections
|
|
68
|
+
*/
|
|
64
69
|
private initializeMultiSelectDecorations;
|
|
65
70
|
private updateLazyDecorations;
|
|
66
71
|
private clearDecorations;
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts
CHANGED
|
@@ -83,7 +83,13 @@ export declare class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|
|
83
83
|
private checkDelayer;
|
|
84
84
|
constructor(_editor: INotebookEditorPane, _target: OutlineTarget, _themeService: IThemeService, _editorService: IEditorService, _instantiationService: IInstantiationService, _configurationService: IConfigurationService, _languageFeaturesService: ILanguageFeaturesService, _notebookExecutionStateService: INotebookExecutionStateService);
|
|
85
85
|
private initializeOutline;
|
|
86
|
+
/**
|
|
87
|
+
* set up the primary data source + three viewing sources for the various outline views
|
|
88
|
+
*/
|
|
86
89
|
private setDataSources;
|
|
90
|
+
/**
|
|
91
|
+
* set up the listeners for the outline content, these respond to model changes in the notebook
|
|
92
|
+
*/
|
|
87
93
|
private setModelListeners;
|
|
88
94
|
private computeSymbols;
|
|
89
95
|
doComputeSymbols(cancelToken: CancellationToken): Promise<void>;
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts
CHANGED
|
@@ -53,5 +53,8 @@ export declare class NotebookKernelService extends Disposable implements INotebo
|
|
|
53
53
|
registerNotebookKernelDetectionTask(task: INotebookKernelDetectionTask): IDisposable;
|
|
54
54
|
getKernelDetectionTasks(notebook: INotebookTextModelLike): INotebookKernelDetectionTask[];
|
|
55
55
|
registerKernelSourceActionProvider(viewType: string, provider: IKernelSourceActionProvider): IDisposable;
|
|
56
|
+
/**
|
|
57
|
+
* Get kernel source actions from providers
|
|
58
|
+
*/
|
|
56
59
|
getKernelSourceActions2(notebook: INotebookTextModelLike): Promise<INotebookKernelSourceAction[]>;
|
|
57
60
|
}
|
|
@@ -10,13 +10,20 @@ type MessageToSend = {
|
|
|
10
10
|
export declare class NotebookRendererMessagingService extends Disposable implements INotebookRendererMessagingService {
|
|
11
11
|
private readonly extensionService;
|
|
12
12
|
_serviceBrand: undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Activation promises. Maps renderer IDs to a queue of messages that should
|
|
15
|
+
* be sent once activation finishes, or undefined if activation is complete.
|
|
16
|
+
*/
|
|
13
17
|
private readonly activations;
|
|
14
18
|
private readonly scopedMessaging;
|
|
15
19
|
private readonly postMessageEmitter;
|
|
16
20
|
readonly onShouldPostMessage: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<MessageToSend>;
|
|
17
21
|
constructor(extensionService: IExtensionService);
|
|
22
|
+
/** @inheritdoc */
|
|
18
23
|
receiveMessage(editorId: string | undefined, rendererId: string, message: unknown): Promise<boolean>;
|
|
24
|
+
/** @inheritdoc */
|
|
19
25
|
prepare(rendererId: string): void;
|
|
26
|
+
/** @inheritdoc */
|
|
20
27
|
getScoped(editorId: string): IScopedRendererMessaging;
|
|
21
28
|
private postMessage;
|
|
22
29
|
}
|
|
@@ -58,6 +58,7 @@ export declare class NotebookOutputRendererInfoStore {
|
|
|
58
58
|
get(rendererId: string): NotebookOutputRendererInfo | undefined;
|
|
59
59
|
getAll(): NotebookOutputRendererInfo[];
|
|
60
60
|
add(info: NotebookOutputRendererInfo): void;
|
|
61
|
+
/** Update and remember the preferred renderer for the given mimetype in this workspace */
|
|
61
62
|
setPreferred(notebookProviderInfo: NotebookProviderInfo, mimeType: string, rendererId: string): void;
|
|
62
63
|
findBestRenderers(notebookProviderInfo: NotebookProviderInfo | undefined, mimeType: string, kernelProvides: readonly string[] | undefined): IOrderedMimeType[];
|
|
63
64
|
}
|
|
@@ -2,6 +2,9 @@ import { IResourceUndoRedoElement, UndoRedoElementType } from "@codingame/monaco
|
|
|
2
2
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
3
|
import { NotebookCellTextModel } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
4
4
|
import { ISelectionState, NotebookCellMetadata } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
5
|
+
/**
|
|
6
|
+
* It should not modify Undo/Redo stack
|
|
7
|
+
*/
|
|
5
8
|
export interface ITextCellEditingDelegate {
|
|
6
9
|
insertCell?(index: number, cell: NotebookCellTextModel, endSelections?: ISelectionState): void;
|
|
7
10
|
deleteCell?(index: number, endSelections?: ISelectionState): void;
|
|
@@ -33,7 +33,13 @@ export declare class NotebookTextModel extends Disposable implements INotebookTe
|
|
|
33
33
|
metadata: NotebookDocumentMetadata;
|
|
34
34
|
transientOptions: TransientOptions;
|
|
35
35
|
private _versionId;
|
|
36
|
+
/**
|
|
37
|
+
* This alternative id is only for non-cell-content changes.
|
|
38
|
+
*/
|
|
36
39
|
private _notebookSpecificAlternativeId;
|
|
40
|
+
/**
|
|
41
|
+
* Unlike, versionId, this can go down (via undo) or go to previous values (via redo)
|
|
42
|
+
*/
|
|
37
43
|
private _alternativeVersionId;
|
|
38
44
|
private _operationManager;
|
|
39
45
|
private _pauseableEmitter;
|
|
@@ -5,6 +5,7 @@ declare class DependencyList {
|
|
|
5
5
|
private readonly value;
|
|
6
6
|
readonly defined: boolean;
|
|
7
7
|
constructor(value: Iterable<string>);
|
|
8
|
+
/** Gets whether any of the 'available' dependencies match the ones in this list */
|
|
8
9
|
matches(available: ReadonlyArray<string>): boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare class NotebookOutputRendererInfo implements INotebookRendererInfo {
|
|
@@ -7,6 +7,32 @@ type ICell = {
|
|
|
7
7
|
getLinesContent(): string[];
|
|
8
8
|
cellKind: CellKind;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Given a set of modified cells and original cells, this function will attempt to match the modified cells with the original cells.
|
|
12
|
+
* E.g. Assume you have (original on left and modified on right):
|
|
13
|
+
* =================
|
|
14
|
+
* Cell A | Cell a
|
|
15
|
+
* Cell B | Cell b
|
|
16
|
+
* Cell C | Cell d
|
|
17
|
+
* Cell D | Cell e
|
|
18
|
+
* =================
|
|
19
|
+
* Here we know that `Cell C` has been removed and `Cell e` has been added.
|
|
20
|
+
* The mapping from modified to original will be as follows:
|
|
21
|
+
* Cell a => Cell A
|
|
22
|
+
* Cell b => Cell B
|
|
23
|
+
* Cell d => Cell D
|
|
24
|
+
* Cell e => <Does not match anything in original, hence a new Cell>
|
|
25
|
+
* Cell C in original was not matched, hence it was deleted.
|
|
26
|
+
*
|
|
27
|
+
* Thus the return value is as follows:
|
|
28
|
+
* [
|
|
29
|
+
* { modified: 0, original: 0 },
|
|
30
|
+
* { modified: 1, original: 1 },
|
|
31
|
+
* { modified: 2, original: 3 },
|
|
32
|
+
* { modified: 3, original: -1 },
|
|
33
|
+
* ]
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
10
36
|
export declare function matchCellBasedOnSimilarties(modifiedCells: ICell[], originalCells: ICell[]): {
|
|
11
37
|
modified: number;
|
|
12
38
|
original: number;
|
package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts
CHANGED
|
@@ -6,9 +6,29 @@ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
6
6
|
import { IWorkingCopyBackupService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
7
7
|
import { IFileWorkingCopy, IFileWorkingCopyModel } from "@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy";
|
|
8
8
|
export interface IBaseFileWorkingCopyManager<M extends IFileWorkingCopyModel, W extends IFileWorkingCopy<M>> extends IDisposable {
|
|
9
|
+
/**
|
|
10
|
+
* An event for when a file working copy was created.
|
|
11
|
+
*/
|
|
9
12
|
readonly onDidCreate: Event<W>;
|
|
13
|
+
/**
|
|
14
|
+
* Access to all known file working copies within the manager.
|
|
15
|
+
*/
|
|
10
16
|
readonly workingCopies: readonly W[];
|
|
17
|
+
/**
|
|
18
|
+
* Returns the file working copy for the provided resource
|
|
19
|
+
* or `undefined` if none.
|
|
20
|
+
*/
|
|
11
21
|
get(resource: URI): W | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Disposes all working copies of the manager and disposes the manager. This
|
|
24
|
+
* method is different from `dispose` in that it will unregister any working
|
|
25
|
+
* copy from the `IWorkingCopyService`. Since this impact things like backups,
|
|
26
|
+
* the method is `async` because it needs to trigger `save` for any dirty
|
|
27
|
+
* working copy to preserve the data.
|
|
28
|
+
*
|
|
29
|
+
* Callers should make sure to e.g. close any editors associated with the
|
|
30
|
+
* working copy.
|
|
31
|
+
*/
|
|
12
32
|
destroy(): Promise<void>;
|
|
13
33
|
}
|
|
14
34
|
export declare abstract class BaseFileWorkingCopyManager<M extends IFileWorkingCopyModel, W extends IFileWorkingCopy<M>> extends Disposable implements IBaseFileWorkingCopyManager<M, W> {
|
|
@@ -28,16 +28,85 @@ import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
28
28
|
import { IDecorationsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/decorations/common/decorations.service";
|
|
29
29
|
import { IProgressService } from "@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service";
|
|
30
30
|
export interface IFileWorkingCopyManager<S extends IStoredFileWorkingCopyModel, U extends IUntitledFileWorkingCopyModel> extends IBaseFileWorkingCopyManager<S | U, IFileWorkingCopy<S | U>> {
|
|
31
|
+
/**
|
|
32
|
+
* Provides access to the manager for stored file working copies.
|
|
33
|
+
*/
|
|
31
34
|
readonly stored: IStoredFileWorkingCopyManager<S>;
|
|
35
|
+
/**
|
|
36
|
+
* Provides access to the manager for untitled file working copies.
|
|
37
|
+
*/
|
|
32
38
|
readonly untitled: IUntitledFileWorkingCopyManager<U>;
|
|
39
|
+
/**
|
|
40
|
+
* Allows to resolve a stored file working copy. If the manager already knows
|
|
41
|
+
* about a stored file working copy with the same `URI`, it will return that
|
|
42
|
+
* existing stored file working copy. There will never be more than one
|
|
43
|
+
* stored file working copy per `URI` until the stored file working copy is
|
|
44
|
+
* disposed.
|
|
45
|
+
*
|
|
46
|
+
* Use the `IStoredFileWorkingCopyResolveOptions.reload` option to control the
|
|
47
|
+
* behaviour for when a stored file working copy was previously already resolved
|
|
48
|
+
* with regards to resolving it again from the underlying file resource
|
|
49
|
+
* or not.
|
|
50
|
+
*
|
|
51
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
52
|
+
*
|
|
53
|
+
* @param resource used as unique identifier of the stored file working copy in
|
|
54
|
+
* case one is already known for this `URI`.
|
|
55
|
+
* @param options
|
|
56
|
+
*/
|
|
33
57
|
resolve(resource: URI, options?: IStoredFileWorkingCopyManagerResolveOptions): Promise<IStoredFileWorkingCopy<S>>;
|
|
58
|
+
/**
|
|
59
|
+
* Create a new untitled file working copy with optional initial contents.
|
|
60
|
+
*
|
|
61
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
62
|
+
*/
|
|
34
63
|
resolve(options?: INewUntitledFileWorkingCopyOptions): Promise<IUntitledFileWorkingCopy<U>>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new untitled file working copy with optional initial contents
|
|
66
|
+
* and associated resource. The associated resource will be used when
|
|
67
|
+
* saving and will not require to ask the user for a file path.
|
|
68
|
+
*
|
|
69
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
70
|
+
*/
|
|
35
71
|
resolve(options?: INewUntitledFileWorkingCopyWithAssociatedResourceOptions): Promise<IUntitledFileWorkingCopy<U>>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new untitled file working copy with optional initial contents
|
|
74
|
+
* with the provided resource or return an existing untitled file working
|
|
75
|
+
* copy otherwise.
|
|
76
|
+
*
|
|
77
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
78
|
+
*/
|
|
36
79
|
resolve(options?: INewOrExistingUntitledFileWorkingCopyOptions): Promise<IUntitledFileWorkingCopy<U>>;
|
|
80
|
+
/**
|
|
81
|
+
* Implements "Save As" for file based working copies. The API is `URI` based
|
|
82
|
+
* because it works even without resolved file working copies. If a file working
|
|
83
|
+
* copy exists for any given `URI`, the implementation will deal with them properly
|
|
84
|
+
* (e.g. dirty contents of the source will be written to the target and the source
|
|
85
|
+
* will be reverted).
|
|
86
|
+
*
|
|
87
|
+
* Note: it is possible that the returned file working copy has a different `URI`
|
|
88
|
+
* than the `target` that was passed in. Based on URI identity, the file working
|
|
89
|
+
* copy may chose to return an existing file working copy with different casing
|
|
90
|
+
* to respect file systems that are case insensitive.
|
|
91
|
+
*
|
|
92
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
93
|
+
*
|
|
94
|
+
* Note: Untitled file working copies are being disposed when saved.
|
|
95
|
+
*
|
|
96
|
+
* @param source the source resource to save as
|
|
97
|
+
* @param target the optional target resource to save to. if not defined, the user
|
|
98
|
+
* will be asked for input
|
|
99
|
+
* @returns the target stored working copy that was saved to or `undefined` in case of
|
|
100
|
+
* cancellation
|
|
101
|
+
*/
|
|
37
102
|
saveAs(source: URI, target: URI, options?: ISaveOptions): Promise<IStoredFileWorkingCopy<S> | undefined>;
|
|
38
103
|
saveAs(source: URI, target: undefined, options?: IFileWorkingCopySaveAsOptions): Promise<IStoredFileWorkingCopy<S> | undefined>;
|
|
39
104
|
}
|
|
40
105
|
export interface IFileWorkingCopySaveAsOptions extends ISaveOptions {
|
|
106
|
+
/**
|
|
107
|
+
* Optional target resource to suggest to the user in case
|
|
108
|
+
* no target resource is provided to save to.
|
|
109
|
+
*/
|
|
41
110
|
suggestedTarget?: URI;
|
|
42
111
|
}
|
|
43
112
|
export declare class FileWorkingCopyManager<S extends IStoredFileWorkingCopyModel, U extends IUntitledFileWorkingCopyModel> extends Disposable implements IFileWorkingCopyManager<S, U> {
|
package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts
CHANGED
|
@@ -16,24 +16,91 @@ import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/
|
|
|
16
16
|
import { IWorkingCopyEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.service";
|
|
17
17
|
import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
18
18
|
import { IProgressService } from "@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service";
|
|
19
|
+
/**
|
|
20
|
+
* The only one that should be dealing with `IStoredFileWorkingCopy` and handle all
|
|
21
|
+
* operations that are working copy related, such as save/revert, backup
|
|
22
|
+
* and resolving.
|
|
23
|
+
*/
|
|
19
24
|
export interface IStoredFileWorkingCopyManager<M extends IStoredFileWorkingCopyModel> extends IBaseFileWorkingCopyManager<M, IStoredFileWorkingCopy<M>> {
|
|
25
|
+
/**
|
|
26
|
+
* An event for when a stored file working copy was resolved.
|
|
27
|
+
*/
|
|
20
28
|
readonly onDidResolve: Event<IStoredFileWorkingCopy<M>>;
|
|
29
|
+
/**
|
|
30
|
+
* An event for when a stored file working copy changed it's dirty state.
|
|
31
|
+
*/
|
|
21
32
|
readonly onDidChangeDirty: Event<IStoredFileWorkingCopy<M>>;
|
|
33
|
+
/**
|
|
34
|
+
* An event for when a stored file working copy changed it's readonly state.
|
|
35
|
+
*/
|
|
22
36
|
readonly onDidChangeReadonly: Event<IStoredFileWorkingCopy<M>>;
|
|
37
|
+
/**
|
|
38
|
+
* An event for when a stored file working copy changed it's orphaned state.
|
|
39
|
+
*/
|
|
23
40
|
readonly onDidChangeOrphaned: Event<IStoredFileWorkingCopy<M>>;
|
|
41
|
+
/**
|
|
42
|
+
* An event for when a stored file working copy failed to save.
|
|
43
|
+
*/
|
|
24
44
|
readonly onDidSaveError: Event<IStoredFileWorkingCopy<M>>;
|
|
45
|
+
/**
|
|
46
|
+
* An event for when a stored file working copy successfully saved.
|
|
47
|
+
*/
|
|
25
48
|
readonly onDidSave: Event<IStoredFileWorkingCopySaveEvent<M>>;
|
|
49
|
+
/**
|
|
50
|
+
* An event for when a stored file working copy was reverted.
|
|
51
|
+
*/
|
|
26
52
|
readonly onDidRevert: Event<IStoredFileWorkingCopy<M>>;
|
|
53
|
+
/**
|
|
54
|
+
* An event for when a stored file working copy is removed from the manager.
|
|
55
|
+
*/
|
|
27
56
|
readonly onDidRemove: Event<URI>;
|
|
57
|
+
/**
|
|
58
|
+
* Allows to resolve a stored file working copy. If the manager already knows
|
|
59
|
+
* about a stored file working copy with the same `URI`, it will return that
|
|
60
|
+
* existing stored file working copy. There will never be more than one
|
|
61
|
+
* stored file working copy per `URI` until the stored file working copy is
|
|
62
|
+
* disposed.
|
|
63
|
+
*
|
|
64
|
+
* Use the `IStoredFileWorkingCopyResolveOptions.reload` option to control the
|
|
65
|
+
* behaviour for when a stored file working copy was previously already resolved
|
|
66
|
+
* with regards to resolving it again from the underlying file resource
|
|
67
|
+
* or not.
|
|
68
|
+
*
|
|
69
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
70
|
+
*
|
|
71
|
+
* @param resource used as unique identifier of the stored file working copy in
|
|
72
|
+
* case one is already known for this `URI`.
|
|
73
|
+
* @param options
|
|
74
|
+
*/
|
|
28
75
|
resolve(resource: URI, options?: IStoredFileWorkingCopyManagerResolveOptions): Promise<IStoredFileWorkingCopy<M>>;
|
|
76
|
+
/**
|
|
77
|
+
* Waits for the stored file working copy to be ready to be disposed. There may be
|
|
78
|
+
* conditions under which the stored file working copy cannot be disposed, e.g. when
|
|
79
|
+
* it is dirty. Once the promise is settled, it is safe to dispose.
|
|
80
|
+
*/
|
|
29
81
|
canDispose(workingCopy: IStoredFileWorkingCopy<M>): true | Promise<true>;
|
|
30
82
|
}
|
|
31
83
|
export interface IStoredFileWorkingCopySaveEvent<M extends IStoredFileWorkingCopyModel> extends IBaseStoredFileWorkingCopySaveEvent {
|
|
84
|
+
/**
|
|
85
|
+
* The stored file working copy that was successfully saved.
|
|
86
|
+
*/
|
|
32
87
|
readonly workingCopy: IStoredFileWorkingCopy<M>;
|
|
33
88
|
}
|
|
34
89
|
export interface IStoredFileWorkingCopyManagerResolveOptions extends IStoredFileWorkingCopyResolveOptions {
|
|
90
|
+
/**
|
|
91
|
+
* If the stored file working copy was already resolved before,
|
|
92
|
+
* allows to trigger a reload of it to fetch the latest contents.
|
|
93
|
+
*/
|
|
35
94
|
readonly reload?: {
|
|
95
|
+
/**
|
|
96
|
+
* Controls whether the reload happens in the background
|
|
97
|
+
* or whether `resolve` will await the reload to happen.
|
|
98
|
+
*/
|
|
36
99
|
readonly async: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Controls whether to force reading the contents from the
|
|
102
|
+
* underlying resource even if the resource did not change.
|
|
103
|
+
*/
|
|
37
104
|
readonly force?: boolean;
|
|
38
105
|
};
|
|
39
106
|
}
|
|
@@ -9,26 +9,63 @@ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/c
|
|
|
9
9
|
import { ISaveOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
10
10
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
11
11
|
import { IWorkingCopyBackupService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
12
|
+
/**
|
|
13
|
+
* Untitled file specific working copy model factory.
|
|
14
|
+
*/
|
|
12
15
|
export interface IUntitledFileWorkingCopyModelFactory<M extends IUntitledFileWorkingCopyModel> extends IFileWorkingCopyModelFactory<M> {
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The underlying model of a untitled file working copy provides
|
|
19
|
+
* some methods for the untitled file working copy to function.
|
|
20
|
+
* The model is typically only available after the working copy
|
|
21
|
+
* has been resolved via it's `resolve()` method.
|
|
22
|
+
*/
|
|
14
23
|
export interface IUntitledFileWorkingCopyModel extends IFileWorkingCopyModel {
|
|
15
24
|
readonly onDidChangeContent: Event<IUntitledFileWorkingCopyModelContentChangedEvent>;
|
|
16
25
|
}
|
|
17
26
|
export interface IUntitledFileWorkingCopyModelContentChangedEvent {
|
|
27
|
+
/**
|
|
28
|
+
* Flag that indicates that the content change should
|
|
29
|
+
* clear the dirty/modified flags, e.g. because the contents are
|
|
30
|
+
* back to being empty or back to an initial state that
|
|
31
|
+
* should not be considered as modified.
|
|
32
|
+
*/
|
|
18
33
|
readonly isInitial: boolean;
|
|
19
34
|
}
|
|
20
35
|
export interface IUntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends IFileWorkingCopy<M> {
|
|
36
|
+
/**
|
|
37
|
+
* Whether this untitled file working copy model has an associated file path.
|
|
38
|
+
*/
|
|
21
39
|
readonly hasAssociatedFilePath: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether we have a resolved model or not.
|
|
42
|
+
*/
|
|
22
43
|
isResolved(): this is IResolvedUntitledFileWorkingCopy<M>;
|
|
23
44
|
}
|
|
24
45
|
export interface IResolvedUntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends IUntitledFileWorkingCopy<M> {
|
|
46
|
+
/**
|
|
47
|
+
* A resolved untitled file working copy has a resolved model.
|
|
48
|
+
*/
|
|
25
49
|
readonly model: M;
|
|
26
50
|
}
|
|
27
51
|
export interface IUntitledFileWorkingCopySaveDelegate<M extends IUntitledFileWorkingCopyModel> {
|
|
52
|
+
/**
|
|
53
|
+
* A delegate to enable saving of untitled file working copies.
|
|
54
|
+
*/
|
|
28
55
|
(workingCopy: IUntitledFileWorkingCopy<M>, options?: ISaveOptions): Promise<boolean>;
|
|
29
56
|
}
|
|
30
57
|
export interface IUntitledFileWorkingCopyInitialContents {
|
|
58
|
+
/**
|
|
59
|
+
* The initial contents of the untitled file working copy.
|
|
60
|
+
*/
|
|
31
61
|
readonly value: VSBufferReadableStream;
|
|
62
|
+
/**
|
|
63
|
+
* If not provided, the untitled file working copy will be marked
|
|
64
|
+
* modified by default given initial contents are provided.
|
|
65
|
+
*
|
|
66
|
+
* Note: if the untitled file working copy has an associated path
|
|
67
|
+
* the modified state will always be set.
|
|
68
|
+
*/
|
|
32
69
|
readonly markModified?: boolean;
|
|
33
70
|
}
|
|
34
71
|
export declare class UntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends Disposable implements IUntitledFileWorkingCopy<M> {
|
package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts
CHANGED
|
@@ -8,22 +8,79 @@ import { IWorkingCopyBackupService } from "@codingame/monaco-vscode-api/vscode/v
|
|
|
8
8
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
9
9
|
import { BaseFileWorkingCopyManager, IBaseFileWorkingCopyManager } from "./abstractFileWorkingCopyManager.js";
|
|
10
10
|
export interface IUntitledFileWorkingCopySaveEvent {
|
|
11
|
+
/**
|
|
12
|
+
* The source untitled file working copy that was saved. It is disposed at this point.
|
|
13
|
+
*/
|
|
11
14
|
readonly source: URI;
|
|
15
|
+
/**
|
|
16
|
+
* The target file working copy the untitled was saved to. Is never untitled.
|
|
17
|
+
*/
|
|
12
18
|
readonly target: URI;
|
|
13
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The only one that should be dealing with `IUntitledFileWorkingCopy` and
|
|
22
|
+
* handle all operations that are working copy related, such as save/revert,
|
|
23
|
+
* backup and resolving.
|
|
24
|
+
*/
|
|
14
25
|
export interface IUntitledFileWorkingCopyManager<M extends IUntitledFileWorkingCopyModel> extends IBaseFileWorkingCopyManager<M, IUntitledFileWorkingCopy<M>> {
|
|
26
|
+
/**
|
|
27
|
+
* An event for when an untitled file working copy was saved.
|
|
28
|
+
* At the point the event fires, the untitled file working copy is
|
|
29
|
+
* disposed.
|
|
30
|
+
*/
|
|
15
31
|
readonly onDidSave: Event<IUntitledFileWorkingCopySaveEvent>;
|
|
32
|
+
/**
|
|
33
|
+
* An event for when a untitled file working copy changed it's dirty state.
|
|
34
|
+
*/
|
|
16
35
|
readonly onDidChangeDirty: Event<IUntitledFileWorkingCopy<M>>;
|
|
36
|
+
/**
|
|
37
|
+
* An event for when a untitled file working copy is about to be disposed.
|
|
38
|
+
*/
|
|
17
39
|
readonly onWillDispose: Event<IUntitledFileWorkingCopy<M>>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new untitled file working copy with optional initial contents.
|
|
42
|
+
*
|
|
43
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
44
|
+
*/
|
|
18
45
|
resolve(options?: INewUntitledFileWorkingCopyOptions): Promise<IUntitledFileWorkingCopy<M>>;
|
|
46
|
+
/**
|
|
47
|
+
* Create a new untitled file working copy with optional initial contents
|
|
48
|
+
* and associated resource. The associated resource will be used when
|
|
49
|
+
* saving and will not require to ask the user for a file path.
|
|
50
|
+
*
|
|
51
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
52
|
+
*/
|
|
19
53
|
resolve(options?: INewUntitledFileWorkingCopyWithAssociatedResourceOptions): Promise<IUntitledFileWorkingCopy<M>>;
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new untitled file working copy with optional initial contents
|
|
56
|
+
* with the provided resource or return an existing untitled file working
|
|
57
|
+
* copy otherwise.
|
|
58
|
+
*
|
|
59
|
+
* Note: Callers must `dispose` the working copy when no longer needed.
|
|
60
|
+
*/
|
|
20
61
|
resolve(options?: INewOrExistingUntitledFileWorkingCopyOptions): Promise<IUntitledFileWorkingCopy<M>>;
|
|
62
|
+
/**
|
|
63
|
+
* Internal method: triggers the onDidSave event.
|
|
64
|
+
*/
|
|
21
65
|
notifyDidSave(source: URI, target: URI): void;
|
|
22
66
|
}
|
|
23
67
|
export interface INewUntitledFileWorkingCopyOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Initial value of the untitled file working copy
|
|
70
|
+
* with support to indicate whether this should turn
|
|
71
|
+
* the working copy dirty or not.
|
|
72
|
+
*/
|
|
24
73
|
contents?: IUntitledFileWorkingCopyInitialContents;
|
|
25
74
|
}
|
|
26
75
|
export interface INewUntitledFileWorkingCopyWithAssociatedResourceOptions extends INewUntitledFileWorkingCopyOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Resource components to associate with the untitled file working copy.
|
|
78
|
+
* When saving, the associated components will be used and the user
|
|
79
|
+
* is not being asked to provide a file path.
|
|
80
|
+
*
|
|
81
|
+
* Note: currently it is not possible to specify the `scheme` to use. The
|
|
82
|
+
* untitled file working copy will saved to the default local or remote resource.
|
|
83
|
+
*/
|
|
27
84
|
associatedResource: {
|
|
28
85
|
authority?: string;
|
|
29
86
|
path?: string;
|
|
@@ -32,7 +89,17 @@ export interface INewUntitledFileWorkingCopyWithAssociatedResourceOptions extend
|
|
|
32
89
|
};
|
|
33
90
|
}
|
|
34
91
|
export interface INewOrExistingUntitledFileWorkingCopyOptions extends INewUntitledFileWorkingCopyOptions {
|
|
92
|
+
/**
|
|
93
|
+
* A resource to identify the untitled file working copy
|
|
94
|
+
* to create or return if already existing.
|
|
95
|
+
*
|
|
96
|
+
* Note: the resource will not be used unless the scheme is `untitled`.
|
|
97
|
+
*/
|
|
35
98
|
untitledResource: URI;
|
|
99
|
+
/**
|
|
100
|
+
* A flag that will prevent the working copy from appearing dirty in the UI
|
|
101
|
+
* and not show a confirmation dialog when closed with unsaved content.
|
|
102
|
+
*/
|
|
36
103
|
isScratchpad?: boolean;
|
|
37
104
|
}
|
|
38
105
|
export declare class UntitledFileWorkingCopyManager<M extends IUntitledFileWorkingCopyModel> extends BaseFileWorkingCopyManager<M, IUntitledFileWorkingCopy<M>> implements IUntitledFileWorkingCopyManager<M> {
|