@codingame/monaco-vscode-extensions-service-override 4.0.0 → 4.1.0
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 +6 -6
- package/package.json +9 -9
- package/_virtual/semver.js +0 -3
- package/external/vscode-semver/semver.js +0 -985
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
- package/vscode/src/vs/base/common/console.js +0 -62
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
- package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
- package/vscode/src/vs/workbench/api/browser/extensionHost.contribution.js +0 -104
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -254
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +0 -103
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -207
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -108
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -560
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -579
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -435
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -501
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -369
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -1016
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +0 -185
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -78
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -78
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -93
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -137
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -194
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -123
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -188
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -129
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -131
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -374
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -25
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -48
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -76
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +0 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -42
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -185
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -30
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -493
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -49
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -168
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +0 -99
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -53
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -72
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -731
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -53
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -409
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +0 -51
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -219
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -76
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -285
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1149
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { illegalArgument } from 'vscode/vscode/vs/base/common/errors';
|
|
3
|
-
import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { equals } from 'vscode/vscode/vs/base/common/objects';
|
|
5
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
7
|
-
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
8
|
-
import { EditorActivation, EditorResolution } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
9
|
-
import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
10
|
-
import { editorGroupToColumn, columnToEditorGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupColumn';
|
|
11
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
12
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
13
|
-
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
|
|
14
|
-
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService';
|
|
15
|
-
import { getCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
16
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
17
|
-
|
|
18
|
-
var MainThreadTextEditors_1;
|
|
19
|
-
let MainThreadTextEditors = class MainThreadTextEditors {
|
|
20
|
-
static { MainThreadTextEditors_1 = this; }
|
|
21
|
-
static { this.INSTANCE_COUNT = 0; }
|
|
22
|
-
constructor(_editorLocator, extHostContext, _codeEditorService, _editorService, _editorGroupService, _configurationService) {
|
|
23
|
-
this._editorLocator = _editorLocator;
|
|
24
|
-
this._codeEditorService = _codeEditorService;
|
|
25
|
-
this._editorService = _editorService;
|
|
26
|
-
this._editorGroupService = _editorGroupService;
|
|
27
|
-
this._configurationService = _configurationService;
|
|
28
|
-
this._toDispose = ( new DisposableStore());
|
|
29
|
-
this._instanceId = String(++MainThreadTextEditors_1.INSTANCE_COUNT);
|
|
30
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostEditors));
|
|
31
|
-
this._textEditorsListenersMap = Object.create(null);
|
|
32
|
-
this._editorPositionData = null;
|
|
33
|
-
this._toDispose.add(this._editorService.onDidVisibleEditorsChange(() => this._updateActiveAndVisibleTextEditors()));
|
|
34
|
-
this._toDispose.add(this._editorGroupService.onDidRemoveGroup(() => this._updateActiveAndVisibleTextEditors()));
|
|
35
|
-
this._toDispose.add(this._editorGroupService.onDidMoveGroup(() => this._updateActiveAndVisibleTextEditors()));
|
|
36
|
-
this._registeredDecorationTypes = Object.create(null);
|
|
37
|
-
}
|
|
38
|
-
dispose() {
|
|
39
|
-
( Object.keys(this._textEditorsListenersMap)).forEach((editorId) => {
|
|
40
|
-
dispose(this._textEditorsListenersMap[editorId]);
|
|
41
|
-
});
|
|
42
|
-
this._textEditorsListenersMap = Object.create(null);
|
|
43
|
-
this._toDispose.dispose();
|
|
44
|
-
for (const decorationType in this._registeredDecorationTypes) {
|
|
45
|
-
this._codeEditorService.removeDecorationType(decorationType);
|
|
46
|
-
}
|
|
47
|
-
this._registeredDecorationTypes = Object.create(null);
|
|
48
|
-
}
|
|
49
|
-
handleTextEditorAdded(textEditor) {
|
|
50
|
-
const id = textEditor.getId();
|
|
51
|
-
const toDispose = [];
|
|
52
|
-
toDispose.push(textEditor.onPropertiesChanged((data) => {
|
|
53
|
-
this._proxy.$acceptEditorPropertiesChanged(id, data);
|
|
54
|
-
}));
|
|
55
|
-
this._textEditorsListenersMap[id] = toDispose;
|
|
56
|
-
}
|
|
57
|
-
handleTextEditorRemoved(id) {
|
|
58
|
-
dispose(this._textEditorsListenersMap[id]);
|
|
59
|
-
delete this._textEditorsListenersMap[id];
|
|
60
|
-
}
|
|
61
|
-
_updateActiveAndVisibleTextEditors() {
|
|
62
|
-
const editorPositionData = this._getTextEditorPositionData();
|
|
63
|
-
if (!equals(this._editorPositionData, editorPositionData)) {
|
|
64
|
-
this._editorPositionData = editorPositionData;
|
|
65
|
-
this._proxy.$acceptEditorPositionData(this._editorPositionData);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_getTextEditorPositionData() {
|
|
69
|
-
const result = Object.create(null);
|
|
70
|
-
for (const editorPane of this._editorService.visibleEditorPanes) {
|
|
71
|
-
const id = this._editorLocator.findTextEditorIdFor(editorPane);
|
|
72
|
-
if (id) {
|
|
73
|
-
result[id] = editorGroupToColumn(this._editorGroupService, editorPane.group);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
async $tryShowTextDocument(resource, options) {
|
|
79
|
-
const uri = URI.revive(resource);
|
|
80
|
-
const editorOptions = {
|
|
81
|
-
preserveFocus: options.preserveFocus,
|
|
82
|
-
pinned: options.pinned,
|
|
83
|
-
selection: options.selection,
|
|
84
|
-
activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
|
|
85
|
-
override: EditorResolution.EXCLUSIVE_ONLY
|
|
86
|
-
};
|
|
87
|
-
const input = {
|
|
88
|
-
resource: uri,
|
|
89
|
-
options: editorOptions
|
|
90
|
-
};
|
|
91
|
-
const editor = await this._editorService.openEditor(input, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
|
|
92
|
-
if (!editor) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
const editorControl = editor.getControl();
|
|
96
|
-
const codeEditor = getCodeEditor(editorControl);
|
|
97
|
-
return codeEditor ? this._editorLocator.getIdOfCodeEditor(codeEditor) : undefined;
|
|
98
|
-
}
|
|
99
|
-
async $tryShowEditor(id, position) {
|
|
100
|
-
const mainThreadEditor = this._editorLocator.getEditor(id);
|
|
101
|
-
if (mainThreadEditor) {
|
|
102
|
-
const model = mainThreadEditor.getModel();
|
|
103
|
-
await this._editorService.openEditor({
|
|
104
|
-
resource: model.uri,
|
|
105
|
-
options: { preserveFocus: false }
|
|
106
|
-
}, columnToEditorGroup(this._editorGroupService, this._configurationService, position));
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
async $tryHideEditor(id) {
|
|
111
|
-
const mainThreadEditor = this._editorLocator.getEditor(id);
|
|
112
|
-
if (mainThreadEditor) {
|
|
113
|
-
const editorPanes = this._editorService.visibleEditorPanes;
|
|
114
|
-
for (const editorPane of editorPanes) {
|
|
115
|
-
if (mainThreadEditor.matches(editorPane)) {
|
|
116
|
-
await editorPane.group.closeEditor(editorPane.input);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
$trySetSelections(id, selections) {
|
|
123
|
-
const editor = this._editorLocator.getEditor(id);
|
|
124
|
-
if (!editor) {
|
|
125
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
126
|
-
}
|
|
127
|
-
editor.setSelections(selections);
|
|
128
|
-
return Promise.resolve(undefined);
|
|
129
|
-
}
|
|
130
|
-
$trySetDecorations(id, key, ranges) {
|
|
131
|
-
key = `${this._instanceId}-${key}`;
|
|
132
|
-
const editor = this._editorLocator.getEditor(id);
|
|
133
|
-
if (!editor) {
|
|
134
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
135
|
-
}
|
|
136
|
-
editor.setDecorations(key, ranges);
|
|
137
|
-
return Promise.resolve(undefined);
|
|
138
|
-
}
|
|
139
|
-
$trySetDecorationsFast(id, key, ranges) {
|
|
140
|
-
key = `${this._instanceId}-${key}`;
|
|
141
|
-
const editor = this._editorLocator.getEditor(id);
|
|
142
|
-
if (!editor) {
|
|
143
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
144
|
-
}
|
|
145
|
-
editor.setDecorationsFast(key, ranges);
|
|
146
|
-
return Promise.resolve(undefined);
|
|
147
|
-
}
|
|
148
|
-
$tryRevealRange(id, range, revealType) {
|
|
149
|
-
const editor = this._editorLocator.getEditor(id);
|
|
150
|
-
if (!editor) {
|
|
151
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
152
|
-
}
|
|
153
|
-
editor.revealRange(range, revealType);
|
|
154
|
-
return Promise.resolve();
|
|
155
|
-
}
|
|
156
|
-
$trySetOptions(id, options) {
|
|
157
|
-
const editor = this._editorLocator.getEditor(id);
|
|
158
|
-
if (!editor) {
|
|
159
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
160
|
-
}
|
|
161
|
-
editor.setConfiguration(options);
|
|
162
|
-
return Promise.resolve(undefined);
|
|
163
|
-
}
|
|
164
|
-
$tryApplyEdits(id, modelVersionId, edits, opts) {
|
|
165
|
-
const editor = this._editorLocator.getEditor(id);
|
|
166
|
-
if (!editor) {
|
|
167
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
168
|
-
}
|
|
169
|
-
return Promise.resolve(editor.applyEdits(modelVersionId, edits, opts));
|
|
170
|
-
}
|
|
171
|
-
$tryInsertSnippet(id, modelVersionId, template, ranges, opts) {
|
|
172
|
-
const editor = this._editorLocator.getEditor(id);
|
|
173
|
-
if (!editor) {
|
|
174
|
-
return Promise.reject(illegalArgument(`TextEditor(${id})`));
|
|
175
|
-
}
|
|
176
|
-
return Promise.resolve(editor.insertSnippet(modelVersionId, template, ranges, opts));
|
|
177
|
-
}
|
|
178
|
-
$registerTextEditorDecorationType(extensionId, key, options) {
|
|
179
|
-
key = `${this._instanceId}-${key}`;
|
|
180
|
-
this._registeredDecorationTypes[key] = true;
|
|
181
|
-
this._codeEditorService.registerDecorationType(`exthost-api-${extensionId}`, key, options);
|
|
182
|
-
}
|
|
183
|
-
$removeTextEditorDecorationType(key) {
|
|
184
|
-
key = `${this._instanceId}-${key}`;
|
|
185
|
-
delete this._registeredDecorationTypes[key];
|
|
186
|
-
this._codeEditorService.removeDecorationType(key);
|
|
187
|
-
}
|
|
188
|
-
$getDiffInformation(id) {
|
|
189
|
-
const editor = this._editorLocator.getEditor(id);
|
|
190
|
-
if (!editor) {
|
|
191
|
-
return Promise.reject(( new Error('No such TextEditor')));
|
|
192
|
-
}
|
|
193
|
-
const codeEditor = editor.getCodeEditor();
|
|
194
|
-
if (!codeEditor) {
|
|
195
|
-
return Promise.reject(( new Error('No such CodeEditor')));
|
|
196
|
-
}
|
|
197
|
-
const codeEditorId = codeEditor.getId();
|
|
198
|
-
const diffEditors = this._codeEditorService.listDiffEditors();
|
|
199
|
-
const [diffEditor] = diffEditors.filter(d => d.getOriginalEditor().getId() === codeEditorId || d.getModifiedEditor().getId() === codeEditorId);
|
|
200
|
-
if (diffEditor) {
|
|
201
|
-
return Promise.resolve(diffEditor.getLineChanges() || []);
|
|
202
|
-
}
|
|
203
|
-
const dirtyDiffContribution = codeEditor.getContribution('editor.contrib.dirtydiff');
|
|
204
|
-
if (dirtyDiffContribution) {
|
|
205
|
-
return Promise.resolve(dirtyDiffContribution.getChanges());
|
|
206
|
-
}
|
|
207
|
-
return Promise.resolve([]);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
MainThreadTextEditors = MainThreadTextEditors_1 = ( __decorate([
|
|
211
|
-
( __param(2, ICodeEditorService)),
|
|
212
|
-
( __param(3, IEditorService)),
|
|
213
|
-
( __param(4, IEditorGroupsService)),
|
|
214
|
-
( __param(5, IConfigurationService))
|
|
215
|
-
], MainThreadTextEditors));
|
|
216
|
-
CommandsRegistry.registerCommand('_workbench.revertAllDirty', async function (accessor) {
|
|
217
|
-
const environmentService = accessor.get(IEnvironmentService);
|
|
218
|
-
if (!environmentService.extensionTestsLocationURI) {
|
|
219
|
-
throw new Error('Command is only available when running extension tests.');
|
|
220
|
-
}
|
|
221
|
-
const workingCopyService = accessor.get(IWorkingCopyService);
|
|
222
|
-
for (const workingCopy of workingCopyService.dirtyWorkingCopies) {
|
|
223
|
-
await workingCopy.revert({ soft: true });
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
export { MainThreadTextEditors };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { __decorate } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { ErrorNoTelemetry, onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
3
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
4
|
-
import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
-
|
|
6
|
-
let MainThreadErrors = class MainThreadErrors {
|
|
7
|
-
dispose() {
|
|
8
|
-
}
|
|
9
|
-
$onUnexpectedError(err) {
|
|
10
|
-
if (err && err.$isError) {
|
|
11
|
-
const { name, message, stack } = err;
|
|
12
|
-
err = err.noTelemetry ? ( new ErrorNoTelemetry()) : ( new Error());
|
|
13
|
-
err.message = message;
|
|
14
|
-
err.name = name;
|
|
15
|
-
err.stack = stack;
|
|
16
|
-
}
|
|
17
|
-
onUnexpectedError(err);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
MainThreadErrors = __decorate([
|
|
21
|
-
extHostNamedCustomer(MainContext.MainThreadErrors)
|
|
22
|
-
], MainThreadErrors);
|
|
23
|
-
|
|
24
|
-
export { MainThreadErrors };
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
3
|
-
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
|
-
import { FileAccess } from 'vscode/vscode/vs/base/common/network';
|
|
5
|
-
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
6
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
7
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
8
|
-
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
9
|
-
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
10
|
-
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
11
|
-
import { WebSocketRemoteConnection, ManagedRemoteConnection } from 'vscode/vscode/vs/platform/remote/common/remoteAuthorityResolver';
|
|
12
|
-
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
13
|
-
import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
14
|
-
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
15
|
-
import { IWorkbenchExtensionEnablementService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
|
|
16
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
17
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
18
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
19
|
-
import { ITimerService } from 'vscode/vscode/vs/workbench/services/timer/browser/timerService';
|
|
20
|
-
|
|
21
|
-
let MainThreadExtensionService = class MainThreadExtensionService {
|
|
22
|
-
constructor(extHostContext, _extensionService, _notificationService, _extensionsWorkbenchService, _hostService, _extensionEnablementService, _timerService, _commandService, _environmentService) {
|
|
23
|
-
this._extensionService = _extensionService;
|
|
24
|
-
this._notificationService = _notificationService;
|
|
25
|
-
this._extensionsWorkbenchService = _extensionsWorkbenchService;
|
|
26
|
-
this._hostService = _hostService;
|
|
27
|
-
this._extensionEnablementService = _extensionEnablementService;
|
|
28
|
-
this._timerService = _timerService;
|
|
29
|
-
this._commandService = _commandService;
|
|
30
|
-
this._environmentService = _environmentService;
|
|
31
|
-
this._extensionHostKind = extHostContext.extensionHostKind;
|
|
32
|
-
const internalExtHostContext = extHostContext;
|
|
33
|
-
this._internalExtensionService = internalExtHostContext.internalExtensionService;
|
|
34
|
-
internalExtHostContext._setExtensionHostProxy(( new ExtensionHostProxy(( extHostContext.getProxy(ExtHostContext.ExtHostExtensionService)))));
|
|
35
|
-
internalExtHostContext._setAllMainProxyIdentifiers(( ( Object.keys(MainContext)).map((key) => MainContext[key])));
|
|
36
|
-
}
|
|
37
|
-
dispose() {
|
|
38
|
-
}
|
|
39
|
-
$getExtension(extensionId) {
|
|
40
|
-
return this._extensionService.getExtension(extensionId);
|
|
41
|
-
}
|
|
42
|
-
$activateExtension(extensionId, reason) {
|
|
43
|
-
return this._internalExtensionService._activateById(extensionId, reason);
|
|
44
|
-
}
|
|
45
|
-
async $onWillActivateExtension(extensionId) {
|
|
46
|
-
this._internalExtensionService._onWillActivateExtension(extensionId);
|
|
47
|
-
}
|
|
48
|
-
$onDidActivateExtension(extensionId, codeLoadingTime, activateCallTime, activateResolvedTime, activationReason) {
|
|
49
|
-
this._internalExtensionService._onDidActivateExtension(extensionId, codeLoadingTime, activateCallTime, activateResolvedTime, activationReason);
|
|
50
|
-
}
|
|
51
|
-
$onExtensionRuntimeError(extensionId, data) {
|
|
52
|
-
const error = ( new Error());
|
|
53
|
-
error.name = data.name;
|
|
54
|
-
error.message = data.message;
|
|
55
|
-
error.stack = data.stack;
|
|
56
|
-
this._internalExtensionService._onExtensionRuntimeError(extensionId, error);
|
|
57
|
-
console.error(`[${extensionId.value}]${error.message}`);
|
|
58
|
-
console.error(error.stack);
|
|
59
|
-
}
|
|
60
|
-
async $onExtensionActivationError(extensionId, data, missingExtensionDependency) {
|
|
61
|
-
const error = ( new Error());
|
|
62
|
-
error.name = data.name;
|
|
63
|
-
error.message = data.message;
|
|
64
|
-
error.stack = data.stack;
|
|
65
|
-
this._internalExtensionService._onDidActivateExtensionError(extensionId, error);
|
|
66
|
-
if (missingExtensionDependency) {
|
|
67
|
-
const extension = await this._extensionService.getExtension(extensionId.value);
|
|
68
|
-
if (extension) {
|
|
69
|
-
const local = await this._extensionsWorkbenchService.queryLocal();
|
|
70
|
-
const installedDependency = local.find(i => areSameExtensions(i.identifier, { id: missingExtensionDependency.dependency }));
|
|
71
|
-
if (installedDependency?.local) {
|
|
72
|
-
await this._handleMissingInstalledDependency(extension, installedDependency.local);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
await this._handleMissingNotInstalledDependency(extension, missingExtensionDependency.dependency);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const isDev = !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment;
|
|
82
|
-
if (isDev) {
|
|
83
|
-
this._notificationService.error(error);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
console.error(error.message);
|
|
87
|
-
}
|
|
88
|
-
async _handleMissingInstalledDependency(extension, missingInstalledDependency) {
|
|
89
|
-
const extName = extension.displayName || extension.name;
|
|
90
|
-
if (this._extensionEnablementService.isEnabled(missingInstalledDependency)) {
|
|
91
|
-
this._notificationService.notify({
|
|
92
|
-
severity: Severity$1.Error,
|
|
93
|
-
message: ( localizeWithPath(
|
|
94
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
95
|
-
'reload window',
|
|
96
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
|
|
97
|
-
extName,
|
|
98
|
-
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
99
|
-
)),
|
|
100
|
-
actions: {
|
|
101
|
-
primary: [( new Action('reload', ( localizeWithPath(
|
|
102
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
103
|
-
'reload',
|
|
104
|
-
"Reload Window"
|
|
105
|
-
)), '', true, () => this._hostService.reload()))]
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
const enablementState = this._extensionEnablementService.getEnablementState(missingInstalledDependency);
|
|
111
|
-
if (enablementState === 4 ) {
|
|
112
|
-
this._notificationService.notify({
|
|
113
|
-
severity: Severity$1.Error,
|
|
114
|
-
message: ( localizeWithPath(
|
|
115
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
116
|
-
'notSupportedInWorkspace',
|
|
117
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
|
|
118
|
-
extName,
|
|
119
|
-
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
120
|
-
)),
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
else if (enablementState === 0 ) {
|
|
124
|
-
this._notificationService.notify({
|
|
125
|
-
severity: Severity$1.Error,
|
|
126
|
-
message: ( localizeWithPath(
|
|
127
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
128
|
-
'restrictedMode',
|
|
129
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
|
|
130
|
-
extName,
|
|
131
|
-
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
132
|
-
)),
|
|
133
|
-
actions: {
|
|
134
|
-
primary: [( new Action('manageWorkspaceTrust', ( localizeWithPath(
|
|
135
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
136
|
-
'manageWorkspaceTrust',
|
|
137
|
-
"Manage Workspace Trust"
|
|
138
|
-
)), '', true, () => this._commandService.executeCommand('workbench.trust.manage')))]
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
else if (this._extensionEnablementService.canChangeEnablement(missingInstalledDependency)) {
|
|
143
|
-
this._notificationService.notify({
|
|
144
|
-
severity: Severity$1.Error,
|
|
145
|
-
message: ( localizeWithPath(
|
|
146
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
147
|
-
'disabledDep',
|
|
148
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
|
|
149
|
-
extName,
|
|
150
|
-
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
151
|
-
)),
|
|
152
|
-
actions: {
|
|
153
|
-
primary: [( new Action('enable', ( localizeWithPath(
|
|
154
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
155
|
-
'enable dep',
|
|
156
|
-
"Enable and Reload"
|
|
157
|
-
)), '', true, () => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === 6 ? 8 : 9 )
|
|
158
|
-
.then(() => this._hostService.reload(), e => this._notificationService.error(e))))]
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
this._notificationService.notify({
|
|
164
|
-
severity: Severity$1.Error,
|
|
165
|
-
message: ( localizeWithPath(
|
|
166
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
167
|
-
'disabledDepNoAction',
|
|
168
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
|
|
169
|
-
extName,
|
|
170
|
-
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
171
|
-
)),
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
async _handleMissingNotInstalledDependency(extension, missingDependency) {
|
|
177
|
-
const extName = extension.displayName || extension.name;
|
|
178
|
-
let dependencyExtension = null;
|
|
179
|
-
try {
|
|
180
|
-
dependencyExtension = (await this._extensionsWorkbenchService.getExtensions([{ id: missingDependency }], CancellationToken.None))[0];
|
|
181
|
-
}
|
|
182
|
-
catch (err) {
|
|
183
|
-
}
|
|
184
|
-
if (dependencyExtension) {
|
|
185
|
-
this._notificationService.notify({
|
|
186
|
-
severity: Severity$1.Error,
|
|
187
|
-
message: ( localizeWithPath(
|
|
188
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
189
|
-
'uninstalledDep',
|
|
190
|
-
"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
|
|
191
|
-
extName,
|
|
192
|
-
dependencyExtension.displayName,
|
|
193
|
-
dependencyExtension.publisherDisplayName
|
|
194
|
-
)),
|
|
195
|
-
actions: {
|
|
196
|
-
primary: [( new Action('install', ( localizeWithPath(
|
|
197
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
198
|
-
'install missing dep',
|
|
199
|
-
"Install and Reload"
|
|
200
|
-
)), '', true, () => this._extensionsWorkbenchService.install(dependencyExtension)
|
|
201
|
-
.then(() => this._hostService.reload(), e => this._notificationService.error(e))))]
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
this._notificationService.error(( localizeWithPath(
|
|
207
|
-
'vs/workbench/api/browser/mainThreadExtensionService',
|
|
208
|
-
'unknownDep',
|
|
209
|
-
"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
|
|
210
|
-
extName,
|
|
211
|
-
missingDependency
|
|
212
|
-
)));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
async $setPerformanceMarks(marks) {
|
|
216
|
-
if (this._extensionHostKind === 1 ) {
|
|
217
|
-
this._timerService.setPerformanceMarks('localExtHost', marks);
|
|
218
|
-
}
|
|
219
|
-
else if (this._extensionHostKind === 2 ) {
|
|
220
|
-
this._timerService.setPerformanceMarks('workerExtHost', marks);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
this._timerService.setPerformanceMarks('remoteExtHost', marks);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
async $asBrowserUri(uri) {
|
|
227
|
-
return FileAccess.uriToBrowserUri(URI.revive(uri));
|
|
228
|
-
}
|
|
229
|
-
async $getAllStaticBrowserUris() {
|
|
230
|
-
return Array.from(FileAccess.getRegisteredBrowserUris(), uri => [
|
|
231
|
-
uri,
|
|
232
|
-
FileAccess.uriToBrowserUri(uri)
|
|
233
|
-
]);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
MainThreadExtensionService = __decorate([
|
|
237
|
-
extHostNamedCustomer(MainContext.MainThreadExtensionService),
|
|
238
|
-
( __param(1, IExtensionService)),
|
|
239
|
-
( __param(2, INotificationService)),
|
|
240
|
-
( __param(3, IExtensionsWorkbenchService)),
|
|
241
|
-
( __param(4, IHostService)),
|
|
242
|
-
( __param(5, IWorkbenchExtensionEnablementService)),
|
|
243
|
-
( __param(6, ITimerService)),
|
|
244
|
-
( __param(7, ICommandService)),
|
|
245
|
-
( __param(8, IWorkbenchEnvironmentService))
|
|
246
|
-
], MainThreadExtensionService);
|
|
247
|
-
class ExtensionHostProxy {
|
|
248
|
-
constructor(_actual) {
|
|
249
|
-
this._actual = _actual;
|
|
250
|
-
}
|
|
251
|
-
async resolveAuthority(remoteAuthority, resolveAttempt) {
|
|
252
|
-
const resolved = reviveResolveAuthorityResult(await this._actual.$resolveAuthority(remoteAuthority, resolveAttempt));
|
|
253
|
-
return resolved;
|
|
254
|
-
}
|
|
255
|
-
async getCanonicalURI(remoteAuthority, uri) {
|
|
256
|
-
const uriComponents = await this._actual.$getCanonicalURI(remoteAuthority, uri);
|
|
257
|
-
return (uriComponents ? URI.revive(uriComponents) : uriComponents);
|
|
258
|
-
}
|
|
259
|
-
startExtensionHost(extensionsDelta) {
|
|
260
|
-
return this._actual.$startExtensionHost(extensionsDelta);
|
|
261
|
-
}
|
|
262
|
-
extensionTestsExecute() {
|
|
263
|
-
return this._actual.$extensionTestsExecute();
|
|
264
|
-
}
|
|
265
|
-
activateByEvent(activationEvent, activationKind) {
|
|
266
|
-
return this._actual.$activateByEvent(activationEvent, activationKind);
|
|
267
|
-
}
|
|
268
|
-
activate(extensionId, reason) {
|
|
269
|
-
return this._actual.$activate(extensionId, reason);
|
|
270
|
-
}
|
|
271
|
-
setRemoteEnvironment(env) {
|
|
272
|
-
return this._actual.$setRemoteEnvironment(env);
|
|
273
|
-
}
|
|
274
|
-
updateRemoteConnectionData(connectionData) {
|
|
275
|
-
return this._actual.$updateRemoteConnectionData(connectionData);
|
|
276
|
-
}
|
|
277
|
-
deltaExtensions(extensionsDelta) {
|
|
278
|
-
return this._actual.$deltaExtensions(extensionsDelta);
|
|
279
|
-
}
|
|
280
|
-
test_latency(n) {
|
|
281
|
-
return this._actual.$test_latency(n);
|
|
282
|
-
}
|
|
283
|
-
test_up(b) {
|
|
284
|
-
return this._actual.$test_up(b);
|
|
285
|
-
}
|
|
286
|
-
test_down(size) {
|
|
287
|
-
return this._actual.$test_down(size);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
function reviveResolveAuthorityResult(result) {
|
|
291
|
-
if (result.type === 'ok') {
|
|
292
|
-
return {
|
|
293
|
-
type: 'ok',
|
|
294
|
-
value: {
|
|
295
|
-
...result.value,
|
|
296
|
-
authority: reviveResolvedAuthority(result.value.authority),
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
return result;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
function reviveResolvedAuthority(resolvedAuthority) {
|
|
305
|
-
return {
|
|
306
|
-
...resolvedAuthority,
|
|
307
|
-
connectTo: reviveConnection(resolvedAuthority.connectTo),
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
function reviveConnection(connection) {
|
|
311
|
-
if (connection.type === 0 ) {
|
|
312
|
-
return ( new WebSocketRemoteConnection(connection.host, connection.port));
|
|
313
|
-
}
|
|
314
|
-
return ( new ManagedRemoteConnection(connection.id));
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
export { MainThreadExtensionService };
|