@codingame/monaco-vscode-extensions-service-override 1.85.0 → 1.85.2
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/extensions.js +3 -3
- package/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +2 -2
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +1 -1
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +0 -141
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +0 -342
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +0 -1197
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +0 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +0 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +0 -543
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +0 -292
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +0 -169
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +0 -255
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +0 -195
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +0 -260
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +0 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +0 -63
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +0 -51
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +0 -649
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +0 -302
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +0 -62
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +0 -251
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +0 -109
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +0 -335
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +0 -101
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +0 -57
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +0 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +0 -144
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +0 -482
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +0 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +0 -92
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +0 -56
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +0 -110
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +0 -260
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +0 -616
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +0 -309
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +0 -38
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +0 -167
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +0 -80
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +0 -70
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +0 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -108
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +0 -506
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +0 -132
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +0 -79
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { bufferToStream, streamToBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
2
|
-
import { CancellationError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
3
|
-
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
|
-
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
-
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
6
|
-
import { filter } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
7
|
-
import { NotebookCellsChangeType, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
8
|
-
import { SimpleNotebookProviderInfo } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
9
|
-
|
|
10
|
-
class NotebookFileWorkingCopyModel extends Disposable {
|
|
11
|
-
constructor(_notebookModel, _notebookService, _configurationService) {
|
|
12
|
-
super();
|
|
13
|
-
this._notebookModel = _notebookModel;
|
|
14
|
-
this._notebookService = _notebookService;
|
|
15
|
-
this._configurationService = _configurationService;
|
|
16
|
-
this._onDidChangeContent = this._register(( new Emitter()));
|
|
17
|
-
this.onDidChangeContent = this._onDidChangeContent.event;
|
|
18
|
-
this.configuration = undefined;
|
|
19
|
-
this.onWillDispose = _notebookModel.onWillDispose.bind(_notebookModel);
|
|
20
|
-
this._register(_notebookModel.onDidChangeContent(e => {
|
|
21
|
-
for (const rawEvent of e.rawEvents) {
|
|
22
|
-
if (rawEvent.kind === NotebookCellsChangeType.Initialize) {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
if (rawEvent.transient) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
this._onDidChangeContent.fire({
|
|
29
|
-
isRedoing: false,
|
|
30
|
-
isUndoing: false,
|
|
31
|
-
isInitial: false,
|
|
32
|
-
});
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
if (_notebookModel.uri.scheme === Schemas.vscodeRemote) {
|
|
37
|
-
this.configuration = {
|
|
38
|
-
backupDelay: 10000
|
|
39
|
-
};
|
|
40
|
-
if (this._configurationService.getValue(NotebookSetting.remoteSaving)) {
|
|
41
|
-
this.save = async (options, token) => {
|
|
42
|
-
const serializer = await this.getNotebookSerializer();
|
|
43
|
-
if (token.isCancellationRequested) {
|
|
44
|
-
throw new CancellationError();
|
|
45
|
-
}
|
|
46
|
-
const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token);
|
|
47
|
-
return stat;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
dispose() {
|
|
53
|
-
this._notebookModel.dispose();
|
|
54
|
-
super.dispose();
|
|
55
|
-
}
|
|
56
|
-
get notebookModel() {
|
|
57
|
-
return this._notebookModel;
|
|
58
|
-
}
|
|
59
|
-
async snapshot(token) {
|
|
60
|
-
const serializer = await this.getNotebookSerializer();
|
|
61
|
-
const data = {
|
|
62
|
-
metadata: filter(this._notebookModel.metadata, key => !serializer.options.transientDocumentMetadata[key]),
|
|
63
|
-
cells: [],
|
|
64
|
-
};
|
|
65
|
-
for (const cell of this._notebookModel.cells) {
|
|
66
|
-
const cellData = {
|
|
67
|
-
cellKind: cell.cellKind,
|
|
68
|
-
language: cell.language,
|
|
69
|
-
mime: cell.mime,
|
|
70
|
-
source: cell.getValue(),
|
|
71
|
-
outputs: [],
|
|
72
|
-
internalMetadata: cell.internalMetadata
|
|
73
|
-
};
|
|
74
|
-
cellData.outputs = !serializer.options.transientOutputs ? cell.outputs : [];
|
|
75
|
-
cellData.metadata = filter(cell.metadata, key => !serializer.options.transientCellMetadata[key]);
|
|
76
|
-
data.cells.push(cellData);
|
|
77
|
-
}
|
|
78
|
-
const bytes = await serializer.notebookToData(data);
|
|
79
|
-
if (token.isCancellationRequested) {
|
|
80
|
-
throw new CancellationError();
|
|
81
|
-
}
|
|
82
|
-
return bufferToStream(bytes);
|
|
83
|
-
}
|
|
84
|
-
async update(stream, token) {
|
|
85
|
-
const serializer = await this.getNotebookSerializer();
|
|
86
|
-
const bytes = await streamToBuffer(stream);
|
|
87
|
-
const data = await serializer.dataToNotebook(bytes);
|
|
88
|
-
if (token.isCancellationRequested) {
|
|
89
|
-
throw new CancellationError();
|
|
90
|
-
}
|
|
91
|
-
this._notebookModel.reset(data.cells, data.metadata, serializer.options);
|
|
92
|
-
}
|
|
93
|
-
async getNotebookSerializer() {
|
|
94
|
-
const info = await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);
|
|
95
|
-
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
96
|
-
throw new Error('CANNOT open file notebook with this provider');
|
|
97
|
-
}
|
|
98
|
-
return info.serializer;
|
|
99
|
-
}
|
|
100
|
-
get versionId() {
|
|
101
|
-
return this._notebookModel.alternativeVersionId;
|
|
102
|
-
}
|
|
103
|
-
pushStackElement() {
|
|
104
|
-
this._notebookModel.pushStackElement('save', undefined, undefined);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export { NotebookFileWorkingCopyModel };
|
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
-
import * as types from 'monaco-editor/esm/vs/base/common/types.js';
|
|
3
|
-
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
4
|
-
import * as objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
5
|
-
import { TaskDefinitionRegistry } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
|
|
6
|
-
|
|
7
|
-
const USER_TASKS_GROUP_KEY = 'settings';
|
|
8
|
-
const CUSTOMIZED_TASK_TYPE = '$customized';
|
|
9
|
-
var CommandOptions;
|
|
10
|
-
( (function(CommandOptions) {
|
|
11
|
-
CommandOptions.defaults = { cwd: '${workspaceFolder}' };
|
|
12
|
-
})(CommandOptions || (CommandOptions = {})));
|
|
13
|
-
var RevealKind;
|
|
14
|
-
( (function(RevealKind) {
|
|
15
|
-
RevealKind[RevealKind["Always"] = 1] = "Always";
|
|
16
|
-
RevealKind[RevealKind["Silent"] = 2] = "Silent";
|
|
17
|
-
RevealKind[RevealKind["Never"] = 3] = "Never";
|
|
18
|
-
})(RevealKind || (RevealKind = {})));
|
|
19
|
-
( (function(RevealKind) {
|
|
20
|
-
function fromString(value) {
|
|
21
|
-
switch (value.toLowerCase()) {
|
|
22
|
-
case 'always':
|
|
23
|
-
return RevealKind.Always;
|
|
24
|
-
case 'silent':
|
|
25
|
-
return RevealKind.Silent;
|
|
26
|
-
case 'never':
|
|
27
|
-
return RevealKind.Never;
|
|
28
|
-
default:
|
|
29
|
-
return RevealKind.Always;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
RevealKind.fromString = fromString;
|
|
33
|
-
})(RevealKind || (RevealKind = {})));
|
|
34
|
-
var RevealProblemKind;
|
|
35
|
-
( (function(RevealProblemKind) {
|
|
36
|
-
RevealProblemKind[RevealProblemKind["Never"] = 1] = "Never";
|
|
37
|
-
RevealProblemKind[RevealProblemKind["OnProblem"] = 2] = "OnProblem";
|
|
38
|
-
RevealProblemKind[RevealProblemKind["Always"] = 3] = "Always";
|
|
39
|
-
})(RevealProblemKind || (RevealProblemKind = {})));
|
|
40
|
-
( (function(RevealProblemKind) {
|
|
41
|
-
function fromString(value) {
|
|
42
|
-
switch (value.toLowerCase()) {
|
|
43
|
-
case 'always':
|
|
44
|
-
return RevealProblemKind.Always;
|
|
45
|
-
case 'never':
|
|
46
|
-
return RevealProblemKind.Never;
|
|
47
|
-
case 'onproblem':
|
|
48
|
-
return RevealProblemKind.OnProblem;
|
|
49
|
-
default:
|
|
50
|
-
return RevealProblemKind.OnProblem;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
RevealProblemKind.fromString = fromString;
|
|
54
|
-
})(RevealProblemKind || (RevealProblemKind = {})));
|
|
55
|
-
var PanelKind;
|
|
56
|
-
( (function(PanelKind) {
|
|
57
|
-
PanelKind[PanelKind["Shared"] = 1] = "Shared";
|
|
58
|
-
PanelKind[PanelKind["Dedicated"] = 2] = "Dedicated";
|
|
59
|
-
PanelKind[PanelKind["New"] = 3] = "New";
|
|
60
|
-
})(PanelKind || (PanelKind = {})));
|
|
61
|
-
( (function(PanelKind) {
|
|
62
|
-
function fromString(value) {
|
|
63
|
-
switch (value.toLowerCase()) {
|
|
64
|
-
case 'shared':
|
|
65
|
-
return PanelKind.Shared;
|
|
66
|
-
case 'dedicated':
|
|
67
|
-
return PanelKind.Dedicated;
|
|
68
|
-
case 'new':
|
|
69
|
-
return PanelKind.New;
|
|
70
|
-
default:
|
|
71
|
-
return PanelKind.Shared;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
PanelKind.fromString = fromString;
|
|
75
|
-
})(PanelKind || (PanelKind = {})));
|
|
76
|
-
var PresentationOptions;
|
|
77
|
-
( (function(PresentationOptions) {
|
|
78
|
-
PresentationOptions.defaults = {
|
|
79
|
-
echo: true, reveal: RevealKind.Always, revealProblems: RevealProblemKind.Never, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clear: false
|
|
80
|
-
};
|
|
81
|
-
})(PresentationOptions || (PresentationOptions = {})));
|
|
82
|
-
var RuntimeType;
|
|
83
|
-
( (function(RuntimeType) {
|
|
84
|
-
RuntimeType[RuntimeType["Shell"] = 1] = "Shell";
|
|
85
|
-
RuntimeType[RuntimeType["Process"] = 2] = "Process";
|
|
86
|
-
RuntimeType[RuntimeType["CustomExecution"] = 3] = "CustomExecution";
|
|
87
|
-
})(RuntimeType || (RuntimeType = {})));
|
|
88
|
-
( (function(RuntimeType) {
|
|
89
|
-
function fromString(value) {
|
|
90
|
-
switch (value.toLowerCase()) {
|
|
91
|
-
case 'shell':
|
|
92
|
-
return RuntimeType.Shell;
|
|
93
|
-
case 'process':
|
|
94
|
-
return RuntimeType.Process;
|
|
95
|
-
case 'customExecution':
|
|
96
|
-
return RuntimeType.CustomExecution;
|
|
97
|
-
default:
|
|
98
|
-
return RuntimeType.Process;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
RuntimeType.fromString = fromString;
|
|
102
|
-
function toString(value) {
|
|
103
|
-
switch (value) {
|
|
104
|
-
case RuntimeType.Shell: return 'shell';
|
|
105
|
-
case RuntimeType.Process: return 'process';
|
|
106
|
-
case RuntimeType.CustomExecution: return 'customExecution';
|
|
107
|
-
default: return 'process';
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
RuntimeType.toString = toString;
|
|
111
|
-
})(RuntimeType || (RuntimeType = {})));
|
|
112
|
-
var TaskSourceKind;
|
|
113
|
-
( (function(TaskSourceKind) {
|
|
114
|
-
TaskSourceKind.Workspace = 'workspace';
|
|
115
|
-
TaskSourceKind.Extension = 'extension';
|
|
116
|
-
TaskSourceKind.InMemory = 'inMemory';
|
|
117
|
-
TaskSourceKind.WorkspaceFile = 'workspaceFile';
|
|
118
|
-
TaskSourceKind.User = 'user';
|
|
119
|
-
function toConfigurationTarget(kind) {
|
|
120
|
-
switch (kind) {
|
|
121
|
-
case TaskSourceKind.User: return 2 ;
|
|
122
|
-
case TaskSourceKind.WorkspaceFile: return 5 ;
|
|
123
|
-
default: return 6 ;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
TaskSourceKind.toConfigurationTarget = toConfigurationTarget;
|
|
127
|
-
})(TaskSourceKind || (TaskSourceKind = {})));
|
|
128
|
-
var RunOnOptions;
|
|
129
|
-
( (function(RunOnOptions) {
|
|
130
|
-
RunOnOptions[RunOnOptions["default"] = 1] = "default";
|
|
131
|
-
RunOnOptions[RunOnOptions["folderOpen"] = 2] = "folderOpen";
|
|
132
|
-
})(RunOnOptions || (RunOnOptions = {})));
|
|
133
|
-
var RunOptions;
|
|
134
|
-
( (function(RunOptions) {
|
|
135
|
-
RunOptions.defaults = { reevaluateOnRerun: true, runOn: RunOnOptions.default, instanceLimit: 1 };
|
|
136
|
-
})(RunOptions || (RunOptions = {})));
|
|
137
|
-
class CommonTask {
|
|
138
|
-
constructor(id, label, type, runOptions, configurationProperties, source) {
|
|
139
|
-
this._label = '';
|
|
140
|
-
this._id = id;
|
|
141
|
-
if (label) {
|
|
142
|
-
this._label = label;
|
|
143
|
-
}
|
|
144
|
-
if (type) {
|
|
145
|
-
this.type = type;
|
|
146
|
-
}
|
|
147
|
-
this.runOptions = runOptions;
|
|
148
|
-
this.configurationProperties = configurationProperties;
|
|
149
|
-
this._source = source;
|
|
150
|
-
}
|
|
151
|
-
getDefinition(useSource) {
|
|
152
|
-
return undefined;
|
|
153
|
-
}
|
|
154
|
-
getMapKey() {
|
|
155
|
-
return this._id;
|
|
156
|
-
}
|
|
157
|
-
getKey() {
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
getCommonTaskId() {
|
|
161
|
-
const key = { folder: this.getFolderId(), id: this._id };
|
|
162
|
-
return JSON.stringify(key);
|
|
163
|
-
}
|
|
164
|
-
clone() {
|
|
165
|
-
return this.fromObject(Object.assign({}, this));
|
|
166
|
-
}
|
|
167
|
-
getWorkspaceFolder() {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
getWorkspaceFileName() {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
getTelemetryKind() {
|
|
174
|
-
return 'unknown';
|
|
175
|
-
}
|
|
176
|
-
matches(key, compareId = false) {
|
|
177
|
-
if (key === undefined) {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
if (types.isString(key)) {
|
|
181
|
-
return key === this._label || key === this.configurationProperties.identifier || (compareId && key === this._id);
|
|
182
|
-
}
|
|
183
|
-
const identifier = this.getDefinition(true);
|
|
184
|
-
return identifier !== undefined && identifier._key === key._key;
|
|
185
|
-
}
|
|
186
|
-
getQualifiedLabel() {
|
|
187
|
-
const workspaceFolder = this.getWorkspaceFolder();
|
|
188
|
-
if (workspaceFolder) {
|
|
189
|
-
return `${this._label} (${workspaceFolder.name})`;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
return this._label;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
getTaskExecution() {
|
|
196
|
-
const result = {
|
|
197
|
-
id: this._id,
|
|
198
|
-
task: this
|
|
199
|
-
};
|
|
200
|
-
return result;
|
|
201
|
-
}
|
|
202
|
-
addTaskLoadMessages(messages) {
|
|
203
|
-
if (this._taskLoadMessages === undefined) {
|
|
204
|
-
this._taskLoadMessages = [];
|
|
205
|
-
}
|
|
206
|
-
if (messages) {
|
|
207
|
-
this._taskLoadMessages = this._taskLoadMessages.concat(messages);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
get taskLoadMessages() {
|
|
211
|
-
return this._taskLoadMessages;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
class CustomTask extends CommonTask {
|
|
215
|
-
constructor(id, source, label, type, command, hasDefinedMatchers, runOptions, configurationProperties) {
|
|
216
|
-
super(id, label, undefined, runOptions, configurationProperties, source);
|
|
217
|
-
this.command = {};
|
|
218
|
-
this._source = source;
|
|
219
|
-
this.hasDefinedMatchers = hasDefinedMatchers;
|
|
220
|
-
if (command) {
|
|
221
|
-
this.command = command;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
clone() {
|
|
225
|
-
return ( new CustomTask(
|
|
226
|
-
this._id,
|
|
227
|
-
this._source,
|
|
228
|
-
this._label,
|
|
229
|
-
this.type,
|
|
230
|
-
this.command,
|
|
231
|
-
this.hasDefinedMatchers,
|
|
232
|
-
this.runOptions,
|
|
233
|
-
this.configurationProperties
|
|
234
|
-
));
|
|
235
|
-
}
|
|
236
|
-
customizes() {
|
|
237
|
-
if (this._source && this._source.customizes) {
|
|
238
|
-
return this._source.customizes;
|
|
239
|
-
}
|
|
240
|
-
return undefined;
|
|
241
|
-
}
|
|
242
|
-
getDefinition(useSource = false) {
|
|
243
|
-
if (useSource && this._source.customizes !== undefined) {
|
|
244
|
-
return this._source.customizes;
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
let type;
|
|
248
|
-
const commandRuntime = this.command ? this.command.runtime : undefined;
|
|
249
|
-
switch (commandRuntime) {
|
|
250
|
-
case RuntimeType.Shell:
|
|
251
|
-
type = 'shell';
|
|
252
|
-
break;
|
|
253
|
-
case RuntimeType.Process:
|
|
254
|
-
type = 'process';
|
|
255
|
-
break;
|
|
256
|
-
case RuntimeType.CustomExecution:
|
|
257
|
-
type = 'customExecution';
|
|
258
|
-
break;
|
|
259
|
-
case undefined:
|
|
260
|
-
type = '$composite';
|
|
261
|
-
break;
|
|
262
|
-
default:
|
|
263
|
-
throw new Error('Unexpected task runtime');
|
|
264
|
-
}
|
|
265
|
-
const result = {
|
|
266
|
-
type,
|
|
267
|
-
_key: this._id,
|
|
268
|
-
id: this._id
|
|
269
|
-
};
|
|
270
|
-
return result;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
static is(value) {
|
|
274
|
-
return value instanceof CustomTask;
|
|
275
|
-
}
|
|
276
|
-
getMapKey() {
|
|
277
|
-
const workspaceFolder = this._source.config.workspaceFolder;
|
|
278
|
-
return workspaceFolder ? `${( workspaceFolder.uri.toString())}|${this._id}|${this.instance}` : `${this._id}|${this.instance}`;
|
|
279
|
-
}
|
|
280
|
-
getFolderId() {
|
|
281
|
-
return this._source.kind === TaskSourceKind.User ? USER_TASKS_GROUP_KEY : this._source.config.workspaceFolder?.uri.toString();
|
|
282
|
-
}
|
|
283
|
-
getCommonTaskId() {
|
|
284
|
-
return this._source.customizes ? super.getCommonTaskId() : (this.getKey() ?? super.getCommonTaskId());
|
|
285
|
-
}
|
|
286
|
-
getKey() {
|
|
287
|
-
const workspaceFolder = this.getFolderId();
|
|
288
|
-
if (!workspaceFolder) {
|
|
289
|
-
return undefined;
|
|
290
|
-
}
|
|
291
|
-
let id = this.configurationProperties.identifier;
|
|
292
|
-
if (this._source.kind !== TaskSourceKind.Workspace) {
|
|
293
|
-
id += this._source.kind;
|
|
294
|
-
}
|
|
295
|
-
const key = { type: CUSTOMIZED_TASK_TYPE, folder: workspaceFolder, id };
|
|
296
|
-
return JSON.stringify(key);
|
|
297
|
-
}
|
|
298
|
-
getWorkspaceFolder() {
|
|
299
|
-
return this._source.config.workspaceFolder;
|
|
300
|
-
}
|
|
301
|
-
getWorkspaceFileName() {
|
|
302
|
-
return (this._source.config.workspace && this._source.config.workspace.configuration) ? resources.basename(this._source.config.workspace.configuration) : undefined;
|
|
303
|
-
}
|
|
304
|
-
getTelemetryKind() {
|
|
305
|
-
if (this._source.customizes) {
|
|
306
|
-
return 'workspace>extension';
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
return 'workspace';
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
fromObject(object) {
|
|
313
|
-
return ( new CustomTask(
|
|
314
|
-
object._id,
|
|
315
|
-
object._source,
|
|
316
|
-
object._label,
|
|
317
|
-
object.type,
|
|
318
|
-
object.command,
|
|
319
|
-
object.hasDefinedMatchers,
|
|
320
|
-
object.runOptions,
|
|
321
|
-
object.configurationProperties
|
|
322
|
-
));
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
class ConfiguringTask extends CommonTask {
|
|
326
|
-
constructor(id, source, label, type, configures, runOptions, configurationProperties) {
|
|
327
|
-
super(id, label, type, runOptions, configurationProperties, source);
|
|
328
|
-
this._source = source;
|
|
329
|
-
this.configures = configures;
|
|
330
|
-
}
|
|
331
|
-
static is(value) {
|
|
332
|
-
return value instanceof ConfiguringTask;
|
|
333
|
-
}
|
|
334
|
-
fromObject(object) {
|
|
335
|
-
return object;
|
|
336
|
-
}
|
|
337
|
-
getDefinition() {
|
|
338
|
-
return this.configures;
|
|
339
|
-
}
|
|
340
|
-
getWorkspaceFileName() {
|
|
341
|
-
return (this._source.config.workspace && this._source.config.workspace.configuration) ? resources.basename(this._source.config.workspace.configuration) : undefined;
|
|
342
|
-
}
|
|
343
|
-
getWorkspaceFolder() {
|
|
344
|
-
return this._source.config.workspaceFolder;
|
|
345
|
-
}
|
|
346
|
-
getFolderId() {
|
|
347
|
-
return this._source.kind === TaskSourceKind.User ? USER_TASKS_GROUP_KEY : this._source.config.workspaceFolder?.uri.toString();
|
|
348
|
-
}
|
|
349
|
-
getKey() {
|
|
350
|
-
const workspaceFolder = this.getFolderId();
|
|
351
|
-
if (!workspaceFolder) {
|
|
352
|
-
return undefined;
|
|
353
|
-
}
|
|
354
|
-
let id = this.configurationProperties.identifier;
|
|
355
|
-
if (this._source.kind !== TaskSourceKind.Workspace) {
|
|
356
|
-
id += this._source.kind;
|
|
357
|
-
}
|
|
358
|
-
const key = { type: CUSTOMIZED_TASK_TYPE, folder: workspaceFolder, id };
|
|
359
|
-
return JSON.stringify(key);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
class ContributedTask extends CommonTask {
|
|
363
|
-
constructor(id, source, label, type, defines, command, hasDefinedMatchers, runOptions, configurationProperties) {
|
|
364
|
-
super(id, label, type, runOptions, configurationProperties, source);
|
|
365
|
-
this.defines = defines;
|
|
366
|
-
this.hasDefinedMatchers = hasDefinedMatchers;
|
|
367
|
-
this.command = command;
|
|
368
|
-
this.icon = configurationProperties.icon;
|
|
369
|
-
this.hide = configurationProperties.hide;
|
|
370
|
-
}
|
|
371
|
-
clone() {
|
|
372
|
-
return ( new ContributedTask(
|
|
373
|
-
this._id,
|
|
374
|
-
this._source,
|
|
375
|
-
this._label,
|
|
376
|
-
this.type,
|
|
377
|
-
this.defines,
|
|
378
|
-
this.command,
|
|
379
|
-
this.hasDefinedMatchers,
|
|
380
|
-
this.runOptions,
|
|
381
|
-
this.configurationProperties
|
|
382
|
-
));
|
|
383
|
-
}
|
|
384
|
-
getDefinition() {
|
|
385
|
-
return this.defines;
|
|
386
|
-
}
|
|
387
|
-
static is(value) {
|
|
388
|
-
return value instanceof ContributedTask;
|
|
389
|
-
}
|
|
390
|
-
getMapKey() {
|
|
391
|
-
const workspaceFolder = this._source.workspaceFolder;
|
|
392
|
-
return workspaceFolder
|
|
393
|
-
? `${( this._source.scope.toString())}|${( workspaceFolder.uri.toString())}|${this._id}|${this.instance}`
|
|
394
|
-
: `${( this._source.scope.toString())}|${this._id}|${this.instance}`;
|
|
395
|
-
}
|
|
396
|
-
getFolderId() {
|
|
397
|
-
if (this._source.scope === 3 && this._source.workspaceFolder) {
|
|
398
|
-
return ( this._source.workspaceFolder.uri.toString());
|
|
399
|
-
}
|
|
400
|
-
return undefined;
|
|
401
|
-
}
|
|
402
|
-
getKey() {
|
|
403
|
-
const key = { type: 'contributed', scope: this._source.scope, id: this._id };
|
|
404
|
-
key.folder = this.getFolderId();
|
|
405
|
-
return JSON.stringify(key);
|
|
406
|
-
}
|
|
407
|
-
getWorkspaceFolder() {
|
|
408
|
-
return this._source.workspaceFolder;
|
|
409
|
-
}
|
|
410
|
-
getTelemetryKind() {
|
|
411
|
-
return 'extension';
|
|
412
|
-
}
|
|
413
|
-
fromObject(object) {
|
|
414
|
-
return ( new ContributedTask(
|
|
415
|
-
object._id,
|
|
416
|
-
object._source,
|
|
417
|
-
object._label,
|
|
418
|
-
object.type,
|
|
419
|
-
object.defines,
|
|
420
|
-
object.command,
|
|
421
|
-
object.hasDefinedMatchers,
|
|
422
|
-
object.runOptions,
|
|
423
|
-
object.configurationProperties
|
|
424
|
-
));
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
var KeyedTaskIdentifier;
|
|
428
|
-
( (function(KeyedTaskIdentifier) {
|
|
429
|
-
function sortedStringify(literal) {
|
|
430
|
-
const keys = ( Object.keys(literal)).sort();
|
|
431
|
-
let result = '';
|
|
432
|
-
for (const key of keys) {
|
|
433
|
-
let stringified = literal[key];
|
|
434
|
-
if (stringified instanceof Object) {
|
|
435
|
-
stringified = sortedStringify(stringified);
|
|
436
|
-
}
|
|
437
|
-
else if (typeof stringified === 'string') {
|
|
438
|
-
stringified = stringified.replace(/,/g, ',,');
|
|
439
|
-
}
|
|
440
|
-
result += key + ',' + stringified + ',';
|
|
441
|
-
}
|
|
442
|
-
return result;
|
|
443
|
-
}
|
|
444
|
-
function create(value) {
|
|
445
|
-
const resultKey = sortedStringify(value);
|
|
446
|
-
const result = { _key: resultKey, type: value.taskType };
|
|
447
|
-
Object.assign(result, value);
|
|
448
|
-
return result;
|
|
449
|
-
}
|
|
450
|
-
KeyedTaskIdentifier.create = create;
|
|
451
|
-
})(KeyedTaskIdentifier || (KeyedTaskIdentifier = {})));
|
|
452
|
-
var TaskDefinition;
|
|
453
|
-
( (function(TaskDefinition) {
|
|
454
|
-
function createTaskIdentifier(external, reporter) {
|
|
455
|
-
const definition = TaskDefinitionRegistry.get(external.type);
|
|
456
|
-
if (definition === undefined) {
|
|
457
|
-
const copy = objects.deepClone(external);
|
|
458
|
-
delete copy._key;
|
|
459
|
-
return KeyedTaskIdentifier.create(copy);
|
|
460
|
-
}
|
|
461
|
-
const literal = Object.create(null);
|
|
462
|
-
literal.type = definition.taskType;
|
|
463
|
-
const required = ( new Set());
|
|
464
|
-
definition.required.forEach(element => required.add(element));
|
|
465
|
-
const properties = definition.properties;
|
|
466
|
-
for (const property of ( Object.keys(properties))) {
|
|
467
|
-
const value = external[property];
|
|
468
|
-
if (value !== undefined && value !== null) {
|
|
469
|
-
literal[property] = value;
|
|
470
|
-
}
|
|
471
|
-
else if (( required.has(property))) {
|
|
472
|
-
const schema = properties[property];
|
|
473
|
-
if (schema.default !== undefined) {
|
|
474
|
-
literal[property] = objects.deepClone(schema.default);
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
switch (schema.type) {
|
|
478
|
-
case 'boolean':
|
|
479
|
-
literal[property] = false;
|
|
480
|
-
break;
|
|
481
|
-
case 'number':
|
|
482
|
-
case 'integer':
|
|
483
|
-
literal[property] = 0;
|
|
484
|
-
break;
|
|
485
|
-
case 'string':
|
|
486
|
-
literal[property] = '';
|
|
487
|
-
break;
|
|
488
|
-
default:
|
|
489
|
-
reporter.error(( nls.localizeWithPath(
|
|
490
|
-
'vs/workbench/contrib/tasks/common/tasks',
|
|
491
|
-
'TaskDefinition.missingRequiredProperty',
|
|
492
|
-
'Error: the task identifier \'{0}\' is missing the required property \'{1}\'. The task identifier will be ignored.',
|
|
493
|
-
JSON.stringify(external, undefined, 0),
|
|
494
|
-
property
|
|
495
|
-
)));
|
|
496
|
-
return undefined;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return KeyedTaskIdentifier.create(literal);
|
|
502
|
-
}
|
|
503
|
-
TaskDefinition.createTaskIdentifier = createTaskIdentifier;
|
|
504
|
-
})(TaskDefinition || (TaskDefinition = {})));
|
|
505
|
-
|
|
506
|
-
export { CUSTOMIZED_TASK_TYPE, CommandOptions, CommonTask, ConfiguringTask, ContributedTask, CustomTask, KeyedTaskIdentifier, PanelKind, PresentationOptions, RevealKind, RevealProblemKind, RunOnOptions, RunOptions, RuntimeType, TaskDefinition, TaskSourceKind, USER_TASKS_GROUP_KEY };
|