@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9
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/assets/webWorkerExtensionHostIframe.html +123 -0
- package/extensions.d.ts +12 -13
- package/extensions.js +456 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +5 -3
- package/tools/url.js +10 -0
- package/tools.js +5 -0
- package/vscode/src/vs/base/common/console.js +59 -0
- package/vscode/src/vs/base/common/prefixTree.js +131 -0
- package/vscode/src/vs/platform/files/common/watcher.js +71 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/log/browser/log.js +26 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
- package/vscode-proposed.d.ts +0 -3872
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
4
|
+
import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
|
|
5
|
+
import { IProductService } from 'monaco-editor/esm/vs/platform/product/common/productService.js';
|
|
6
|
+
import { TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
7
|
+
import { supportsTelemetry } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
8
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
9
|
+
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
10
|
+
|
|
11
|
+
var MainThreadTelemetry_1;
|
|
12
|
+
let MainThreadTelemetry = class MainThreadTelemetry extends Disposable {
|
|
13
|
+
static { MainThreadTelemetry_1 = this; }
|
|
14
|
+
static { this._name = 'pluginHostTelemetry'; }
|
|
15
|
+
constructor(extHostContext, _telemetryService, _configurationService, _environmentService, _productService) {
|
|
16
|
+
super();
|
|
17
|
+
this._telemetryService = _telemetryService;
|
|
18
|
+
this._configurationService = _configurationService;
|
|
19
|
+
this._environmentService = _environmentService;
|
|
20
|
+
this._productService = _productService;
|
|
21
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTelemetry));
|
|
22
|
+
if (supportsTelemetry(this._productService, this._environmentService)) {
|
|
23
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
24
|
+
if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID)) {
|
|
25
|
+
this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel);
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
this._proxy.$initializeTelemetryLevel(this.telemetryLevel, supportsTelemetry(this._productService, this._environmentService), this._productService.enabledTelemetryLevels);
|
|
30
|
+
}
|
|
31
|
+
get telemetryLevel() {
|
|
32
|
+
if (!supportsTelemetry(this._productService, this._environmentService)) {
|
|
33
|
+
return 0 ;
|
|
34
|
+
}
|
|
35
|
+
return this._telemetryService.telemetryLevel;
|
|
36
|
+
}
|
|
37
|
+
$publicLog(eventName, data = Object.create(null)) {
|
|
38
|
+
data[MainThreadTelemetry_1._name] = true;
|
|
39
|
+
this._telemetryService.publicLog(eventName, data);
|
|
40
|
+
}
|
|
41
|
+
$publicLog2(eventName, data) {
|
|
42
|
+
this.$publicLog(eventName, data);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
MainThreadTelemetry = MainThreadTelemetry_1 = __decorate([
|
|
46
|
+
extHostNamedCustomer(MainContext.MainThreadTelemetry),
|
|
47
|
+
( __param(1, ITelemetryService)),
|
|
48
|
+
( __param(2, IConfigurationService)),
|
|
49
|
+
( __param(3, IEnvironmentService)),
|
|
50
|
+
( __param(4, IProductService))
|
|
51
|
+
], MainThreadTelemetry);
|
|
52
|
+
|
|
53
|
+
export { MainThreadTelemetry };
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { DisposableStore, MutableDisposable, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
6
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
7
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
8
|
+
import { TerminalLocation, TerminalExitReason } from 'vscode/vscode/vs/platform/terminal/common/terminal';
|
|
9
|
+
import { TerminalDataBufferer } from 'vscode/vscode/vs/platform/terminal/common/terminalDataBuffering';
|
|
10
|
+
import { ITerminalService, ITerminalGroupService, ITerminalEditorService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal';
|
|
11
|
+
import { TerminalProcessExtHostProxy } from '../../contrib/terminal/browser/terminalProcessExtHostProxy.js';
|
|
12
|
+
import { IEnvironmentVariableService } from 'vscode/vscode/vs/workbench/contrib/terminal/common/environmentVariable';
|
|
13
|
+
import { serializeEnvironmentVariableCollection, deserializeEnvironmentVariableCollection, deserializeEnvironmentDescriptionMap } from 'vscode/vscode/vs/platform/terminal/common/environmentVariableShared';
|
|
14
|
+
import { ITerminalProfileResolverService, ITerminalProfileService } from 'vscode/vscode/vs/workbench/contrib/terminal/common/terminal';
|
|
15
|
+
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
|
|
16
|
+
import { OS } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
17
|
+
import { Promises } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
18
|
+
import { ITerminalLinkProviderService } from 'vscode/vscode/vs/workbench/contrib/terminalContrib/links/browser/links';
|
|
19
|
+
import { ITerminalQuickFixService, TerminalQuickFixType } from 'vscode/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix';
|
|
20
|
+
|
|
21
|
+
let MainThreadTerminalService = class MainThreadTerminalService {
|
|
22
|
+
constructor(_extHostContext, _terminalService, _terminalLinkProviderService, _terminalQuickFixService, _instantiationService, _environmentVariableService, _logService, _terminalProfileResolverService, remoteAgentService, _terminalGroupService, _terminalEditorService, _terminalProfileService) {
|
|
23
|
+
this._extHostContext = _extHostContext;
|
|
24
|
+
this._terminalService = _terminalService;
|
|
25
|
+
this._terminalLinkProviderService = _terminalLinkProviderService;
|
|
26
|
+
this._terminalQuickFixService = _terminalQuickFixService;
|
|
27
|
+
this._instantiationService = _instantiationService;
|
|
28
|
+
this._environmentVariableService = _environmentVariableService;
|
|
29
|
+
this._logService = _logService;
|
|
30
|
+
this._terminalProfileResolverService = _terminalProfileResolverService;
|
|
31
|
+
this._terminalGroupService = _terminalGroupService;
|
|
32
|
+
this._terminalEditorService = _terminalEditorService;
|
|
33
|
+
this._terminalProfileService = _terminalProfileService;
|
|
34
|
+
this._store = ( new DisposableStore());
|
|
35
|
+
this._extHostTerminals = ( new Map());
|
|
36
|
+
this._terminalProcessProxies = ( new Map());
|
|
37
|
+
this._profileProviders = ( new Map());
|
|
38
|
+
this._quickFixProviders = ( new Map());
|
|
39
|
+
this._dataEventTracker = ( new MutableDisposable());
|
|
40
|
+
this._sendCommandEventListener = ( new MutableDisposable());
|
|
41
|
+
this._os = OS;
|
|
42
|
+
this._proxy = ( _extHostContext.getProxy(ExtHostContext.ExtHostTerminalService));
|
|
43
|
+
this._store.add(_terminalService.onDidCreateInstance((instance) => {
|
|
44
|
+
this._onTerminalOpened(instance);
|
|
45
|
+
this._onInstanceDimensionsChanged(instance);
|
|
46
|
+
}));
|
|
47
|
+
this._store.add(_terminalService.onDidDisposeInstance(instance => this._onTerminalDisposed(instance)));
|
|
48
|
+
this._store.add(_terminalService.onDidReceiveProcessId(instance => this._onTerminalProcessIdReady(instance)));
|
|
49
|
+
this._store.add(_terminalService.onDidChangeInstanceDimensions(instance => this._onInstanceDimensionsChanged(instance)));
|
|
50
|
+
this._store.add(_terminalService.onDidMaximumDimensionsChange(instance => this._onInstanceMaximumDimensionsChanged(instance)));
|
|
51
|
+
this._store.add(_terminalService.onDidRequestStartExtensionTerminal(e => this._onRequestStartExtensionTerminal(e)));
|
|
52
|
+
this._store.add(_terminalService.onDidChangeActiveInstance(instance => this._onActiveTerminalChanged(instance ? instance.instanceId : null)));
|
|
53
|
+
this._store.add(_terminalService.onDidChangeInstanceTitle(instance => instance && this._onTitleChanged(instance.instanceId, instance.title)));
|
|
54
|
+
this._store.add(_terminalService.onDidInputInstanceData(instance => this._proxy.$acceptTerminalInteraction(instance.instanceId)));
|
|
55
|
+
this._store.add(_terminalService.onDidChangeSelection(instance => this._proxy.$acceptTerminalSelection(instance.instanceId, instance.selection)));
|
|
56
|
+
for (const instance of this._terminalService.instances) {
|
|
57
|
+
this._onTerminalOpened(instance);
|
|
58
|
+
instance.processReady.then(() => this._onTerminalProcessIdReady(instance));
|
|
59
|
+
}
|
|
60
|
+
const activeInstance = this._terminalService.activeInstance;
|
|
61
|
+
if (activeInstance) {
|
|
62
|
+
this._proxy.$acceptActiveTerminalChanged(activeInstance.instanceId);
|
|
63
|
+
}
|
|
64
|
+
if (this._environmentVariableService.collections.size > 0) {
|
|
65
|
+
const collectionAsArray = [...this._environmentVariableService.collections.entries()];
|
|
66
|
+
const serializedCollections = ( collectionAsArray.map(e => {
|
|
67
|
+
return [e[0], serializeEnvironmentVariableCollection(e[1].map)];
|
|
68
|
+
}));
|
|
69
|
+
this._proxy.$initEnvironmentVariableCollections(serializedCollections);
|
|
70
|
+
}
|
|
71
|
+
remoteAgentService.getEnvironment().then(async (env) => {
|
|
72
|
+
this._os = env?.os || OS;
|
|
73
|
+
this._updateDefaultProfile();
|
|
74
|
+
});
|
|
75
|
+
this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(() => this._updateDefaultProfile()));
|
|
76
|
+
}
|
|
77
|
+
dispose() {
|
|
78
|
+
this._store.dispose();
|
|
79
|
+
this._linkProvider?.dispose();
|
|
80
|
+
for (const provider of ( this._profileProviders.values())) {
|
|
81
|
+
provider.dispose();
|
|
82
|
+
}
|
|
83
|
+
for (const provider of ( this._quickFixProviders.values())) {
|
|
84
|
+
provider.dispose();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async _updateDefaultProfile() {
|
|
88
|
+
const remoteAuthority = this._extHostContext.remoteAuthority ?? undefined;
|
|
89
|
+
const defaultProfile = this._terminalProfileResolverService.getDefaultProfile({ remoteAuthority, os: this._os });
|
|
90
|
+
const defaultAutomationProfile = this._terminalProfileResolverService.getDefaultProfile({ remoteAuthority, os: this._os, allowAutomationShell: true });
|
|
91
|
+
this._proxy.$acceptDefaultProfile(...(await Promise.all([defaultProfile, defaultAutomationProfile])));
|
|
92
|
+
}
|
|
93
|
+
async _getTerminalInstance(id) {
|
|
94
|
+
if (typeof id === 'string') {
|
|
95
|
+
return this._extHostTerminals.get(id);
|
|
96
|
+
}
|
|
97
|
+
return this._terminalService.getInstanceFromId(id);
|
|
98
|
+
}
|
|
99
|
+
async $createTerminal(extHostTerminalId, launchConfig) {
|
|
100
|
+
const shellLaunchConfig = {
|
|
101
|
+
name: launchConfig.name,
|
|
102
|
+
executable: launchConfig.shellPath,
|
|
103
|
+
args: launchConfig.shellArgs,
|
|
104
|
+
cwd: typeof launchConfig.cwd === 'string' ? launchConfig.cwd : URI.revive(launchConfig.cwd),
|
|
105
|
+
icon: launchConfig.icon,
|
|
106
|
+
color: launchConfig.color,
|
|
107
|
+
initialText: launchConfig.initialText,
|
|
108
|
+
waitOnExit: launchConfig.waitOnExit,
|
|
109
|
+
ignoreConfigurationCwd: true,
|
|
110
|
+
env: launchConfig.env,
|
|
111
|
+
strictEnv: launchConfig.strictEnv,
|
|
112
|
+
hideFromUser: launchConfig.hideFromUser,
|
|
113
|
+
customPtyImplementation: launchConfig.isExtensionCustomPtyTerminal
|
|
114
|
+
? (id, cols, rows) => ( new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService))
|
|
115
|
+
: undefined,
|
|
116
|
+
extHostTerminalId,
|
|
117
|
+
isFeatureTerminal: launchConfig.isFeatureTerminal,
|
|
118
|
+
isExtensionOwnedTerminal: launchConfig.isExtensionOwnedTerminal,
|
|
119
|
+
useShellEnvironment: launchConfig.useShellEnvironment,
|
|
120
|
+
isTransient: launchConfig.isTransient
|
|
121
|
+
};
|
|
122
|
+
const terminal = Promises.withAsyncBody(async (r) => {
|
|
123
|
+
const terminal = await this._terminalService.createTerminal({
|
|
124
|
+
config: shellLaunchConfig,
|
|
125
|
+
location: await this._deserializeParentTerminal(launchConfig.location)
|
|
126
|
+
});
|
|
127
|
+
r(terminal);
|
|
128
|
+
});
|
|
129
|
+
this._extHostTerminals.set(extHostTerminalId, terminal);
|
|
130
|
+
const terminalInstance = await terminal;
|
|
131
|
+
this._store.add(terminalInstance.onDisposed(() => {
|
|
132
|
+
this._extHostTerminals.delete(extHostTerminalId);
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
async _deserializeParentTerminal(location) {
|
|
136
|
+
if (typeof location === 'object' && 'parentTerminal' in location) {
|
|
137
|
+
const parentTerminal = await this._extHostTerminals.get(( location.parentTerminal.toString()));
|
|
138
|
+
return parentTerminal ? { parentTerminal } : undefined;
|
|
139
|
+
}
|
|
140
|
+
return location;
|
|
141
|
+
}
|
|
142
|
+
async $show(id, preserveFocus) {
|
|
143
|
+
const terminalInstance = await this._getTerminalInstance(id);
|
|
144
|
+
if (terminalInstance) {
|
|
145
|
+
this._terminalService.setActiveInstance(terminalInstance);
|
|
146
|
+
if (terminalInstance.target === TerminalLocation.Editor) {
|
|
147
|
+
await this._terminalEditorService.revealActiveEditor(preserveFocus);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
await this._terminalGroupService.showPanel(!preserveFocus);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async $hide(id) {
|
|
155
|
+
const instanceToHide = await this._getTerminalInstance(id);
|
|
156
|
+
const activeInstance = this._terminalService.activeInstance;
|
|
157
|
+
if (activeInstance && activeInstance.instanceId === instanceToHide?.instanceId && activeInstance.target !== TerminalLocation.Editor) {
|
|
158
|
+
this._terminalGroupService.hidePanel();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async $dispose(id) {
|
|
162
|
+
(await this._getTerminalInstance(id))?.dispose(TerminalExitReason.Extension);
|
|
163
|
+
}
|
|
164
|
+
async $sendText(id, text, addNewLine) {
|
|
165
|
+
const instance = await this._getTerminalInstance(id);
|
|
166
|
+
await instance?.sendText(text, addNewLine);
|
|
167
|
+
}
|
|
168
|
+
$sendProcessExit(terminalId, exitCode) {
|
|
169
|
+
this._terminalProcessProxies.get(terminalId)?.emitExit(exitCode);
|
|
170
|
+
}
|
|
171
|
+
$startSendingDataEvents() {
|
|
172
|
+
if (!this._dataEventTracker.value) {
|
|
173
|
+
this._dataEventTracker.value = this._instantiationService.createInstance(TerminalDataEventTracker, (id, data) => {
|
|
174
|
+
this._onTerminalData(id, data);
|
|
175
|
+
});
|
|
176
|
+
for (const instance of this._terminalService.instances) {
|
|
177
|
+
for (const data of instance.initialDataEvents || []) {
|
|
178
|
+
this._onTerminalData(instance.instanceId, data);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
$stopSendingDataEvents() {
|
|
184
|
+
this._dataEventTracker.clear();
|
|
185
|
+
}
|
|
186
|
+
$startSendingCommandEvents() {
|
|
187
|
+
this._logService.info('$startSendingCommandEvents');
|
|
188
|
+
if (this._sendCommandEventListener.value) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const multiplexer = this._terminalService.onInstanceCapabilityEvent(2 , capability => capability.onCommandFinished);
|
|
192
|
+
multiplexer.event(e => {
|
|
193
|
+
this._onDidExecuteCommand(e.instance.instanceId, {
|
|
194
|
+
commandLine: e.data.command,
|
|
195
|
+
cwd: e.data.cwd,
|
|
196
|
+
exitCode: e.data.exitCode,
|
|
197
|
+
output: e.data.getOutput()
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
this._sendCommandEventListener.value = multiplexer;
|
|
201
|
+
}
|
|
202
|
+
$stopSendingCommandEvents() {
|
|
203
|
+
this._logService.info('$stopSendingCommandEvents');
|
|
204
|
+
this._sendCommandEventListener.clear();
|
|
205
|
+
}
|
|
206
|
+
$startLinkProvider() {
|
|
207
|
+
this._linkProvider?.dispose();
|
|
208
|
+
this._linkProvider = this._terminalLinkProviderService.registerLinkProvider(( new ExtensionTerminalLinkProvider(this._proxy)));
|
|
209
|
+
}
|
|
210
|
+
$stopLinkProvider() {
|
|
211
|
+
this._linkProvider?.dispose();
|
|
212
|
+
this._linkProvider = undefined;
|
|
213
|
+
}
|
|
214
|
+
$registerProcessSupport(isSupported) {
|
|
215
|
+
this._terminalService.registerProcessSupport(isSupported);
|
|
216
|
+
}
|
|
217
|
+
$registerProfileProvider(id, extensionIdentifier) {
|
|
218
|
+
this._profileProviders.set(id, this._terminalProfileService.registerTerminalProfileProvider(extensionIdentifier, id, {
|
|
219
|
+
createContributedTerminalProfile: async (options) => {
|
|
220
|
+
return this._proxy.$createContributedProfileTerminal(id, options);
|
|
221
|
+
}
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
$unregisterProfileProvider(id) {
|
|
225
|
+
this._profileProviders.get(id)?.dispose();
|
|
226
|
+
this._profileProviders.delete(id);
|
|
227
|
+
}
|
|
228
|
+
async $registerQuickFixProvider(id, extensionId) {
|
|
229
|
+
this._quickFixProviders.set(id, this._terminalQuickFixService.registerQuickFixProvider(id, {
|
|
230
|
+
provideTerminalQuickFixes: async (terminalCommand, lines, options, token) => {
|
|
231
|
+
if (token.isCancellationRequested) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (options.outputMatcher?.length && options.outputMatcher.length > 40) {
|
|
235
|
+
options.outputMatcher.length = 40;
|
|
236
|
+
this._logService.warn('Cannot exceed output matcher length of 40');
|
|
237
|
+
}
|
|
238
|
+
const commandLineMatch = terminalCommand.command.match(options.commandLineMatcher);
|
|
239
|
+
if (!commandLineMatch || !lines) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const outputMatcher = options.outputMatcher;
|
|
243
|
+
let outputMatch;
|
|
244
|
+
if (outputMatcher) {
|
|
245
|
+
outputMatch = getOutputMatchForLines(lines, outputMatcher);
|
|
246
|
+
}
|
|
247
|
+
if (!outputMatch) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const matchResult = { commandLineMatch, outputMatch, commandLine: terminalCommand.command };
|
|
251
|
+
if (matchResult) {
|
|
252
|
+
const result = await this._proxy.$provideTerminalQuickFixes(id, matchResult, token);
|
|
253
|
+
if (result && Array.isArray(result)) {
|
|
254
|
+
return ( result.map(r => parseQuickFix(id, extensionId, r)));
|
|
255
|
+
}
|
|
256
|
+
else if (result) {
|
|
257
|
+
return parseQuickFix(id, extensionId, result);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
$unregisterQuickFixProvider(id) {
|
|
265
|
+
this._quickFixProviders.get(id)?.dispose();
|
|
266
|
+
this._quickFixProviders.delete(id);
|
|
267
|
+
}
|
|
268
|
+
_onActiveTerminalChanged(terminalId) {
|
|
269
|
+
this._proxy.$acceptActiveTerminalChanged(terminalId);
|
|
270
|
+
}
|
|
271
|
+
_onTerminalData(terminalId, data) {
|
|
272
|
+
this._proxy.$acceptTerminalProcessData(terminalId, data);
|
|
273
|
+
}
|
|
274
|
+
_onDidExecuteCommand(terminalId, command) {
|
|
275
|
+
this._proxy.$acceptDidExecuteCommand(terminalId, command);
|
|
276
|
+
}
|
|
277
|
+
_onTitleChanged(terminalId, name) {
|
|
278
|
+
this._proxy.$acceptTerminalTitleChange(terminalId, name);
|
|
279
|
+
}
|
|
280
|
+
_onTerminalDisposed(terminalInstance) {
|
|
281
|
+
this._proxy.$acceptTerminalClosed(terminalInstance.instanceId, terminalInstance.exitCode, terminalInstance.exitReason ?? TerminalExitReason.Unknown);
|
|
282
|
+
}
|
|
283
|
+
_onTerminalOpened(terminalInstance) {
|
|
284
|
+
const extHostTerminalId = terminalInstance.shellLaunchConfig.extHostTerminalId;
|
|
285
|
+
const shellLaunchConfigDto = {
|
|
286
|
+
name: terminalInstance.shellLaunchConfig.name,
|
|
287
|
+
executable: terminalInstance.shellLaunchConfig.executable,
|
|
288
|
+
args: terminalInstance.shellLaunchConfig.args,
|
|
289
|
+
cwd: terminalInstance.shellLaunchConfig.cwd,
|
|
290
|
+
env: terminalInstance.shellLaunchConfig.env,
|
|
291
|
+
hideFromUser: terminalInstance.shellLaunchConfig.hideFromUser
|
|
292
|
+
};
|
|
293
|
+
this._proxy.$acceptTerminalOpened(terminalInstance.instanceId, extHostTerminalId, terminalInstance.title, shellLaunchConfigDto);
|
|
294
|
+
}
|
|
295
|
+
_onTerminalProcessIdReady(terminalInstance) {
|
|
296
|
+
if (terminalInstance.processId === undefined) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this._proxy.$acceptTerminalProcessId(terminalInstance.instanceId, terminalInstance.processId);
|
|
300
|
+
}
|
|
301
|
+
_onInstanceDimensionsChanged(instance) {
|
|
302
|
+
this._proxy.$acceptTerminalDimensions(instance.instanceId, instance.cols, instance.rows);
|
|
303
|
+
}
|
|
304
|
+
_onInstanceMaximumDimensionsChanged(instance) {
|
|
305
|
+
this._proxy.$acceptTerminalMaximumDimensions(instance.instanceId, instance.maxCols, instance.maxRows);
|
|
306
|
+
}
|
|
307
|
+
_onRequestStartExtensionTerminal(request) {
|
|
308
|
+
const proxy = request.proxy;
|
|
309
|
+
this._terminalProcessProxies.set(proxy.instanceId, proxy);
|
|
310
|
+
const initialDimensions = request.cols && request.rows ? {
|
|
311
|
+
columns: request.cols,
|
|
312
|
+
rows: request.rows
|
|
313
|
+
} : undefined;
|
|
314
|
+
this._proxy.$startExtensionTerminal(proxy.instanceId, initialDimensions).then(request.callback);
|
|
315
|
+
proxy.onInput(data => this._proxy.$acceptProcessInput(proxy.instanceId, data));
|
|
316
|
+
proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(proxy.instanceId, immediate));
|
|
317
|
+
proxy.onRequestCwd(() => this._proxy.$acceptProcessRequestCwd(proxy.instanceId));
|
|
318
|
+
proxy.onRequestInitialCwd(() => this._proxy.$acceptProcessRequestInitialCwd(proxy.instanceId));
|
|
319
|
+
}
|
|
320
|
+
$sendProcessData(terminalId, data) {
|
|
321
|
+
this._terminalProcessProxies.get(terminalId)?.emitData(data);
|
|
322
|
+
}
|
|
323
|
+
$sendProcessReady(terminalId, pid, cwd, windowsPty) {
|
|
324
|
+
this._terminalProcessProxies.get(terminalId)?.emitReady(pid, cwd, windowsPty);
|
|
325
|
+
}
|
|
326
|
+
$sendProcessProperty(terminalId, property) {
|
|
327
|
+
if (property.type === "title" ) {
|
|
328
|
+
const instance = this._terminalService.getInstanceFromId(terminalId);
|
|
329
|
+
instance?.rename(property.value);
|
|
330
|
+
}
|
|
331
|
+
this._terminalProcessProxies.get(terminalId)?.emitProcessProperty(property);
|
|
332
|
+
}
|
|
333
|
+
$setEnvironmentVariableCollection(extensionIdentifier, persistent, collection, descriptionMap) {
|
|
334
|
+
if (collection) {
|
|
335
|
+
const translatedCollection = {
|
|
336
|
+
persistent,
|
|
337
|
+
map: deserializeEnvironmentVariableCollection(collection),
|
|
338
|
+
descriptionMap: deserializeEnvironmentDescriptionMap(descriptionMap)
|
|
339
|
+
};
|
|
340
|
+
this._environmentVariableService.set(extensionIdentifier, translatedCollection);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this._environmentVariableService.delete(extensionIdentifier);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
MainThreadTerminalService = __decorate([
|
|
348
|
+
extHostNamedCustomer(MainContext.MainThreadTerminalService),
|
|
349
|
+
( __param(1, ITerminalService)),
|
|
350
|
+
( __param(2, ITerminalLinkProviderService)),
|
|
351
|
+
( __param(3, ITerminalQuickFixService)),
|
|
352
|
+
( __param(4, IInstantiationService)),
|
|
353
|
+
( __param(5, IEnvironmentVariableService)),
|
|
354
|
+
( __param(6, ILogService)),
|
|
355
|
+
( __param(7, ITerminalProfileResolverService)),
|
|
356
|
+
( __param(8, IRemoteAgentService)),
|
|
357
|
+
( __param(9, ITerminalGroupService)),
|
|
358
|
+
( __param(10, ITerminalEditorService)),
|
|
359
|
+
( __param(11, ITerminalProfileService))
|
|
360
|
+
], MainThreadTerminalService);
|
|
361
|
+
let TerminalDataEventTracker = class TerminalDataEventTracker extends Disposable {
|
|
362
|
+
constructor(_callback, _terminalService) {
|
|
363
|
+
super();
|
|
364
|
+
this._callback = _callback;
|
|
365
|
+
this._terminalService = _terminalService;
|
|
366
|
+
this._register(this._bufferer = ( new TerminalDataBufferer(this._callback)));
|
|
367
|
+
for (const instance of this._terminalService.instances) {
|
|
368
|
+
this._registerInstance(instance);
|
|
369
|
+
}
|
|
370
|
+
this._register(this._terminalService.onDidCreateInstance(instance => this._registerInstance(instance)));
|
|
371
|
+
this._register(this._terminalService.onDidDisposeInstance(instance => this._bufferer.stopBuffering(instance.instanceId)));
|
|
372
|
+
}
|
|
373
|
+
_registerInstance(instance) {
|
|
374
|
+
this._register(this._bufferer.startBuffering(instance.instanceId, instance.onData));
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
TerminalDataEventTracker = ( __decorate([
|
|
378
|
+
( __param(1, ITerminalService))
|
|
379
|
+
], TerminalDataEventTracker));
|
|
380
|
+
class ExtensionTerminalLinkProvider {
|
|
381
|
+
constructor(_proxy) {
|
|
382
|
+
this._proxy = _proxy;
|
|
383
|
+
}
|
|
384
|
+
async provideLinks(instance, line) {
|
|
385
|
+
const proxy = this._proxy;
|
|
386
|
+
const extHostLinks = await proxy.$provideLinks(instance.instanceId, line);
|
|
387
|
+
return ( extHostLinks.map(dto => ({
|
|
388
|
+
id: dto.id,
|
|
389
|
+
startIndex: dto.startIndex,
|
|
390
|
+
length: dto.length,
|
|
391
|
+
label: dto.label,
|
|
392
|
+
activate: () => proxy.$activateLink(instance.instanceId, dto.id)
|
|
393
|
+
})));
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function getOutputMatchForLines(lines, outputMatcher) {
|
|
397
|
+
const match = lines.join('\n').match(outputMatcher.lineMatcher);
|
|
398
|
+
return match ? { regexMatch: match, outputLines: lines } : undefined;
|
|
399
|
+
}
|
|
400
|
+
function parseQuickFix(id, source, fix) {
|
|
401
|
+
let type = TerminalQuickFixType.TerminalCommand;
|
|
402
|
+
if ('uri' in fix) {
|
|
403
|
+
fix.uri = URI.revive(fix.uri);
|
|
404
|
+
type = TerminalQuickFixType.Opener;
|
|
405
|
+
}
|
|
406
|
+
else if ('id' in fix) {
|
|
407
|
+
type = TerminalQuickFixType.VscodeCommand;
|
|
408
|
+
}
|
|
409
|
+
return { id, type, source, ...fix };
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export { MainThreadTerminalService, getOutputMatchForLines };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, MutableDisposable, DisposableStore, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { revive } from 'monaco-editor/esm/vs/base/common/marshalling.js';
|
|
4
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
5
|
+
import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
|
|
6
|
+
import { MutableObservableValue } from '../../contrib/testing/common/observableValue.js';
|
|
7
|
+
import { ITestItem, ITestMessage, TestsDiffOp } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
8
|
+
import { TestCoverage } from '../../contrib/testing/common/testCoverage.js';
|
|
9
|
+
import { ITestProfileService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testProfileService';
|
|
10
|
+
import { LiveTestResult } from '../../contrib/testing/common/testResult.js';
|
|
11
|
+
import { ITestResultService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResultService';
|
|
12
|
+
import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
|
|
13
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
14
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
15
|
+
import { WellDefinedPrefixTree } from '../../../base/common/prefixTree.js';
|
|
16
|
+
import { TestId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testId';
|
|
17
|
+
|
|
18
|
+
let MainThreadTesting = class MainThreadTesting extends Disposable {
|
|
19
|
+
constructor(extHostContext, testService, testProfiles, resultService) {
|
|
20
|
+
super();
|
|
21
|
+
this.testService = testService;
|
|
22
|
+
this.testProfiles = testProfiles;
|
|
23
|
+
this.resultService = resultService;
|
|
24
|
+
this.diffListener = this._register(( new MutableDisposable()));
|
|
25
|
+
this.testProviderRegistrations = ( new Map());
|
|
26
|
+
this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTesting));
|
|
27
|
+
this._register(this.testService.onDidCancelTestRun(({ runId }) => {
|
|
28
|
+
this.proxy.$cancelExtensionTestRun(runId);
|
|
29
|
+
}));
|
|
30
|
+
this._register(resultService.onResultsChanged(evt => {
|
|
31
|
+
const results = 'completed' in evt ? evt.completed : ('inserted' in evt ? evt.inserted : undefined);
|
|
32
|
+
const serialized = results?.toJSONWithMessages();
|
|
33
|
+
if (serialized) {
|
|
34
|
+
this.proxy.$publishTestResults([serialized]);
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
$markTestRetired(testIds) {
|
|
39
|
+
let tree;
|
|
40
|
+
if (testIds) {
|
|
41
|
+
tree = ( new WellDefinedPrefixTree());
|
|
42
|
+
for (const id of testIds) {
|
|
43
|
+
tree.insert(TestId.fromString(id).path, undefined);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const result of this.resultService.results) {
|
|
47
|
+
if (result instanceof LiveTestResult) {
|
|
48
|
+
result.markRetired(tree);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
$publishTestRunProfile(profile) {
|
|
53
|
+
const controller = this.testProviderRegistrations.get(profile.controllerId);
|
|
54
|
+
if (controller) {
|
|
55
|
+
this.testProfiles.addProfile(controller.instance, profile);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
$updateTestRunConfig(controllerId, profileId, update) {
|
|
59
|
+
this.testProfiles.updateProfile(controllerId, profileId, update);
|
|
60
|
+
}
|
|
61
|
+
$removeTestProfile(controllerId, profileId) {
|
|
62
|
+
this.testProfiles.removeProfile(controllerId, profileId);
|
|
63
|
+
}
|
|
64
|
+
$addTestsToRun(controllerId, runId, tests) {
|
|
65
|
+
this.withLiveRun(runId, r => r.addTestChainToRun(controllerId, ( tests.map(ITestItem.deserialize))));
|
|
66
|
+
}
|
|
67
|
+
$signalCoverageAvailable(runId, taskId) {
|
|
68
|
+
this.withLiveRun(runId, run => {
|
|
69
|
+
const task = run.tasks.find(t => t.id === taskId);
|
|
70
|
+
if (!task) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
task.coverage.value = ( new TestCoverage({
|
|
74
|
+
provideFileCoverage: async (token) => revive(await this.proxy.$provideFileCoverage(runId, taskId, token)),
|
|
75
|
+
resolveFileCoverage: (i, token) => this.proxy.$resolveFileCoverage(runId, taskId, i, token),
|
|
76
|
+
}));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
$startedExtensionTestRun(req) {
|
|
80
|
+
this.resultService.createLiveResult(req);
|
|
81
|
+
}
|
|
82
|
+
$startedTestRunTask(runId, task) {
|
|
83
|
+
this.withLiveRun(runId, r => r.addTask(task));
|
|
84
|
+
}
|
|
85
|
+
$finishedTestRunTask(runId, taskId) {
|
|
86
|
+
this.withLiveRun(runId, r => r.markTaskComplete(taskId));
|
|
87
|
+
}
|
|
88
|
+
$finishedExtensionTestRun(runId) {
|
|
89
|
+
this.withLiveRun(runId, r => r.markComplete());
|
|
90
|
+
}
|
|
91
|
+
$updateTestStateInRun(runId, taskId, testId, state, duration) {
|
|
92
|
+
this.withLiveRun(runId, r => r.updateState(testId, taskId, state, duration));
|
|
93
|
+
}
|
|
94
|
+
$appendOutputToRun(runId, taskId, output, locationDto, testId) {
|
|
95
|
+
const location = locationDto && {
|
|
96
|
+
uri: URI.revive(locationDto.uri),
|
|
97
|
+
range: Range.lift(locationDto.range)
|
|
98
|
+
};
|
|
99
|
+
this.withLiveRun(runId, r => r.appendOutput(output, taskId, location, testId));
|
|
100
|
+
}
|
|
101
|
+
$appendTestMessagesInRun(runId, taskId, testId, messages) {
|
|
102
|
+
const r = this.resultService.getResult(runId);
|
|
103
|
+
if (r && r instanceof LiveTestResult) {
|
|
104
|
+
for (const message of messages) {
|
|
105
|
+
r.appendMessage(testId, taskId, ITestMessage.deserialize(message));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
$registerTestController(controllerId, labelStr, canRefreshValue) {
|
|
110
|
+
const disposable = ( new DisposableStore());
|
|
111
|
+
const label = disposable.add(( new MutableObservableValue(labelStr)));
|
|
112
|
+
const canRefresh = disposable.add(( new MutableObservableValue(canRefreshValue)));
|
|
113
|
+
const controller = {
|
|
114
|
+
id: controllerId,
|
|
115
|
+
label,
|
|
116
|
+
canRefresh,
|
|
117
|
+
syncTests: () => this.proxy.$syncTests(),
|
|
118
|
+
refreshTests: token => this.proxy.$refreshTests(controllerId, token),
|
|
119
|
+
configureRunProfile: id => this.proxy.$configureRunProfile(controllerId, id),
|
|
120
|
+
runTests: (reqs, token) => this.proxy.$runControllerTests(reqs, token),
|
|
121
|
+
startContinuousRun: (reqs, token) => this.proxy.$startContinuousRun(reqs, token),
|
|
122
|
+
expandTest: (testId, levels) => this.proxy.$expandTest(testId, isFinite(levels) ? levels : -1),
|
|
123
|
+
};
|
|
124
|
+
disposable.add(toDisposable(() => this.testProfiles.removeProfile(controllerId)));
|
|
125
|
+
disposable.add(this.testService.registerTestController(controllerId, controller));
|
|
126
|
+
this.testProviderRegistrations.set(controllerId, {
|
|
127
|
+
instance: controller,
|
|
128
|
+
label,
|
|
129
|
+
canRefresh,
|
|
130
|
+
disposable
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
$updateController(controllerId, patch) {
|
|
134
|
+
const controller = this.testProviderRegistrations.get(controllerId);
|
|
135
|
+
if (!controller) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (patch.label !== undefined) {
|
|
139
|
+
controller.label.value = patch.label;
|
|
140
|
+
}
|
|
141
|
+
if (patch.canRefresh !== undefined) {
|
|
142
|
+
controller.canRefresh.value = patch.canRefresh;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
$unregisterTestController(controllerId) {
|
|
146
|
+
this.testProviderRegistrations.get(controllerId)?.disposable.dispose();
|
|
147
|
+
this.testProviderRegistrations.delete(controllerId);
|
|
148
|
+
}
|
|
149
|
+
$subscribeToDiffs() {
|
|
150
|
+
this.proxy.$acceptDiff(( this.testService.collection.getReviverDiff().map(TestsDiffOp.serialize)));
|
|
151
|
+
this.diffListener.value = this.testService.onDidProcessDiff(this.proxy.$acceptDiff, this.proxy);
|
|
152
|
+
}
|
|
153
|
+
$unsubscribeFromDiffs() {
|
|
154
|
+
this.diffListener.clear();
|
|
155
|
+
}
|
|
156
|
+
$publishDiff(controllerId, diff) {
|
|
157
|
+
this.testService.publishDiff(controllerId, ( diff.map(TestsDiffOp.deserialize)));
|
|
158
|
+
}
|
|
159
|
+
async $runTests(req, token) {
|
|
160
|
+
const result = await this.testService.runResolvedTests(req, token);
|
|
161
|
+
return result.id;
|
|
162
|
+
}
|
|
163
|
+
dispose() {
|
|
164
|
+
super.dispose();
|
|
165
|
+
for (const subscription of ( this.testProviderRegistrations.values())) {
|
|
166
|
+
subscription.disposable.dispose();
|
|
167
|
+
}
|
|
168
|
+
this.testProviderRegistrations.clear();
|
|
169
|
+
}
|
|
170
|
+
withLiveRun(runId, fn) {
|
|
171
|
+
const r = this.resultService.getResult(runId);
|
|
172
|
+
return r && r instanceof LiveTestResult ? fn(r) : undefined;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
MainThreadTesting = __decorate([
|
|
176
|
+
extHostNamedCustomer(MainContext.MainThreadTesting),
|
|
177
|
+
( __param(1, ITestService)),
|
|
178
|
+
( __param(2, ITestProfileService)),
|
|
179
|
+
( __param(3, ITestResultService))
|
|
180
|
+
], MainThreadTesting);
|
|
181
|
+
|
|
182
|
+
export { MainThreadTesting };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
3
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
4
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
5
|
+
|
|
6
|
+
let MainThreadTheming = class MainThreadTheming {
|
|
7
|
+
constructor(extHostContext, themeService) {
|
|
8
|
+
this._themeService = themeService;
|
|
9
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTheming));
|
|
10
|
+
this._themeChangeListener = this._themeService.onDidColorThemeChange(e => {
|
|
11
|
+
this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type);
|
|
12
|
+
});
|
|
13
|
+
this._proxy.$onColorThemeChange(this._themeService.getColorTheme().type);
|
|
14
|
+
}
|
|
15
|
+
dispose() {
|
|
16
|
+
this._themeChangeListener.dispose();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
MainThreadTheming = __decorate([
|
|
20
|
+
extHostNamedCustomer(MainContext.MainThreadTheming),
|
|
21
|
+
( __param(1, IThemeService))
|
|
22
|
+
], MainThreadTheming);
|
|
23
|
+
|
|
24
|
+
export { MainThreadTheming };
|