@codingame/monaco-vscode-extensions-service-override 3.2.3 → 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.
Files changed (108) hide show
  1. package/extensions.js +6 -87
  2. package/override/vs/platform/dialogs/common/dialogs.js +2 -0
  3. package/package.json +9 -9
  4. package/_virtual/semver.js +0 -3
  5. package/external/vscode-semver/semver.js +0 -985
  6. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
  7. package/vscode/src/vs/base/common/console.js +0 -59
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
  9. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
  10. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
  11. package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
  12. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -31
  13. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -35
  14. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -227
  15. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -68
  16. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +0 -103
  17. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -83
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -203
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +0 -201
  20. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
  21. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
  22. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -107
  23. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
  24. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -545
  25. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
  26. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
  27. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -578
  28. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -424
  29. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
  30. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
  31. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
  32. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
  33. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
  34. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
  35. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
  36. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
  37. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
  38. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -482
  39. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
  40. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
  41. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
  42. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
  43. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -374
  44. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
  45. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
  46. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
  47. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
  48. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -991
  49. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -78
  50. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -35
  51. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -78
  52. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -93
  53. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -137
  54. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -194
  55. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -123
  56. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -188
  57. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -129
  58. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -131
  59. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -374
  60. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -25
  61. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -48
  62. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -76
  63. package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +0 -38
  64. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -68
  65. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -42
  66. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -185
  67. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -30
  68. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -493
  69. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -49
  70. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -146
  71. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -70
  72. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -50
  73. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +0 -99
  74. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -53
  75. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -72
  76. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -731
  77. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -53
  78. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -408
  79. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -195
  80. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
  81. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
  82. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
  84. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
  85. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
  86. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
  87. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
  88. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
  89. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
  90. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
  91. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
  92. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
  93. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -73
  94. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
  95. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -284
  96. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
  97. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
  98. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1138
  99. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
  100. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
  101. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
  102. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
  103. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
  104. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
  105. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
  106. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
  107. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
  108. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
@@ -1,53 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
4
- import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
5
- import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
6
- import { TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
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 };
@@ -1,408 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { DisposableStore, MutableDisposable, combinedDisposable, Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
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 'vscode/vscode/vs/base/common/uri';
6
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
7
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
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 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy';
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 'vscode/vscode/vs/base/common/platform';
17
- import { Promises } from 'vscode/vscode/vs/base/common/async';
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._linkProvider = this._store.add(( new MutableDisposable()));
42
- this._os = OS;
43
- this._proxy = ( _extHostContext.getProxy(ExtHostContext.ExtHostTerminalService));
44
- this._store.add(_terminalService.onDidCreateInstance((instance) => {
45
- this._onTerminalOpened(instance);
46
- this._onInstanceDimensionsChanged(instance);
47
- }));
48
- this._store.add(_terminalService.onDidDisposeInstance(instance => this._onTerminalDisposed(instance)));
49
- this._store.add(_terminalService.onAnyInstanceProcessIdReady(instance => this._onTerminalProcessIdReady(instance)));
50
- this._store.add(_terminalService.onDidChangeInstanceDimensions(instance => this._onInstanceDimensionsChanged(instance)));
51
- this._store.add(_terminalService.onAnyInstanceMaximumDimensionsChange(instance => this._onInstanceMaximumDimensionsChanged(instance)));
52
- this._store.add(_terminalService.onDidRequestStartExtensionTerminal(e => this._onRequestStartExtensionTerminal(e)));
53
- this._store.add(_terminalService.onDidChangeActiveInstance(instance => this._onActiveTerminalChanged(instance ? instance.instanceId : null)));
54
- this._store.add(_terminalService.onAnyInstanceTitleChange(instance => instance && this._onTitleChanged(instance.instanceId, instance.title)));
55
- this._store.add(_terminalService.onAnyInstanceDataInput(instance => this._proxy.$acceptTerminalInteraction(instance.instanceId)));
56
- this._store.add(_terminalService.onAnyInstanceSelectionChange(instance => this._proxy.$acceptTerminalSelection(instance.instanceId, instance.selection)));
57
- for (const instance of this._terminalService.instances) {
58
- this._onTerminalOpened(instance);
59
- instance.processReady.then(() => this._onTerminalProcessIdReady(instance));
60
- }
61
- const activeInstance = this._terminalService.activeInstance;
62
- if (activeInstance) {
63
- this._proxy.$acceptActiveTerminalChanged(activeInstance.instanceId);
64
- }
65
- if (this._environmentVariableService.collections.size > 0) {
66
- const collectionAsArray = [...this._environmentVariableService.collections.entries()];
67
- const serializedCollections = ( collectionAsArray.map(e => {
68
- return [e[0], serializeEnvironmentVariableCollection(e[1].map)];
69
- }));
70
- this._proxy.$initEnvironmentVariableCollections(serializedCollections);
71
- }
72
- remoteAgentService.getEnvironment().then(async (env) => {
73
- this._os = env?.os || OS;
74
- this._updateDefaultProfile();
75
- });
76
- this._store.add(this._terminalProfileService.onDidChangeAvailableProfiles(() => this._updateDefaultProfile()));
77
- }
78
- dispose() {
79
- this._store.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, shouldExecute) {
165
- const instance = await this._getTerminalInstance(id);
166
- await instance?.sendText(text, shouldExecute);
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
- if (this._sendCommandEventListener.value) {
188
- return;
189
- }
190
- const multiplexer = this._terminalService.createOnInstanceCapabilityEvent(2 , capability => capability.onCommandFinished);
191
- const sub = multiplexer.event(e => {
192
- this._onDidExecuteCommand(e.instance.instanceId, {
193
- commandLine: e.data.command,
194
- cwd: e.data.cwd,
195
- exitCode: e.data.exitCode,
196
- output: e.data.getOutput()
197
- });
198
- });
199
- this._sendCommandEventListener.value = combinedDisposable(multiplexer, sub);
200
- }
201
- $stopSendingCommandEvents() {
202
- this._sendCommandEventListener.clear();
203
- }
204
- $startLinkProvider() {
205
- this._linkProvider.value = this._terminalLinkProviderService.registerLinkProvider(( new ExtensionTerminalLinkProvider(this._proxy)));
206
- }
207
- $stopLinkProvider() {
208
- this._linkProvider.clear();
209
- }
210
- $registerProcessSupport(isSupported) {
211
- this._terminalService.registerProcessSupport(isSupported);
212
- }
213
- $registerProfileProvider(id, extensionIdentifier) {
214
- this._profileProviders.set(id, this._terminalProfileService.registerTerminalProfileProvider(extensionIdentifier, id, {
215
- createContributedTerminalProfile: async (options) => {
216
- return this._proxy.$createContributedProfileTerminal(id, options);
217
- }
218
- }));
219
- }
220
- $unregisterProfileProvider(id) {
221
- this._profileProviders.get(id)?.dispose();
222
- this._profileProviders.delete(id);
223
- }
224
- async $registerQuickFixProvider(id, extensionId) {
225
- this._quickFixProviders.set(id, this._terminalQuickFixService.registerQuickFixProvider(id, {
226
- provideTerminalQuickFixes: async (terminalCommand, lines, options, token) => {
227
- if (token.isCancellationRequested) {
228
- return;
229
- }
230
- if (options.outputMatcher?.length && options.outputMatcher.length > 40) {
231
- options.outputMatcher.length = 40;
232
- this._logService.warn('Cannot exceed output matcher length of 40');
233
- }
234
- const commandLineMatch = terminalCommand.command.match(options.commandLineMatcher);
235
- if (!commandLineMatch || !lines) {
236
- return;
237
- }
238
- const outputMatcher = options.outputMatcher;
239
- let outputMatch;
240
- if (outputMatcher) {
241
- outputMatch = getOutputMatchForLines(lines, outputMatcher);
242
- }
243
- if (!outputMatch) {
244
- return;
245
- }
246
- const matchResult = { commandLineMatch, outputMatch, commandLine: terminalCommand.command };
247
- if (matchResult) {
248
- const result = await this._proxy.$provideTerminalQuickFixes(id, matchResult, token);
249
- if (result && Array.isArray(result)) {
250
- return ( result.map(r => parseQuickFix(id, extensionId, r)));
251
- }
252
- else if (result) {
253
- return parseQuickFix(id, extensionId, result);
254
- }
255
- }
256
- return;
257
- }
258
- }));
259
- }
260
- $unregisterQuickFixProvider(id) {
261
- this._quickFixProviders.get(id)?.dispose();
262
- this._quickFixProviders.delete(id);
263
- }
264
- _onActiveTerminalChanged(terminalId) {
265
- this._proxy.$acceptActiveTerminalChanged(terminalId);
266
- }
267
- _onTerminalData(terminalId, data) {
268
- this._proxy.$acceptTerminalProcessData(terminalId, data);
269
- }
270
- _onDidExecuteCommand(terminalId, command) {
271
- this._proxy.$acceptDidExecuteCommand(terminalId, command);
272
- }
273
- _onTitleChanged(terminalId, name) {
274
- this._proxy.$acceptTerminalTitleChange(terminalId, name);
275
- }
276
- _onTerminalDisposed(terminalInstance) {
277
- this._proxy.$acceptTerminalClosed(terminalInstance.instanceId, terminalInstance.exitCode, terminalInstance.exitReason ?? TerminalExitReason.Unknown);
278
- }
279
- _onTerminalOpened(terminalInstance) {
280
- const extHostTerminalId = terminalInstance.shellLaunchConfig.extHostTerminalId;
281
- const shellLaunchConfigDto = {
282
- name: terminalInstance.shellLaunchConfig.name,
283
- executable: terminalInstance.shellLaunchConfig.executable,
284
- args: terminalInstance.shellLaunchConfig.args,
285
- cwd: terminalInstance.shellLaunchConfig.cwd,
286
- env: terminalInstance.shellLaunchConfig.env,
287
- hideFromUser: terminalInstance.shellLaunchConfig.hideFromUser
288
- };
289
- this._proxy.$acceptTerminalOpened(terminalInstance.instanceId, extHostTerminalId, terminalInstance.title, shellLaunchConfigDto);
290
- }
291
- _onTerminalProcessIdReady(terminalInstance) {
292
- if (terminalInstance.processId === undefined) {
293
- return;
294
- }
295
- this._proxy.$acceptTerminalProcessId(terminalInstance.instanceId, terminalInstance.processId);
296
- }
297
- _onInstanceDimensionsChanged(instance) {
298
- this._proxy.$acceptTerminalDimensions(instance.instanceId, instance.cols, instance.rows);
299
- }
300
- _onInstanceMaximumDimensionsChanged(instance) {
301
- this._proxy.$acceptTerminalMaximumDimensions(instance.instanceId, instance.maxCols, instance.maxRows);
302
- }
303
- _onRequestStartExtensionTerminal(request) {
304
- const proxy = request.proxy;
305
- this._terminalProcessProxies.set(proxy.instanceId, proxy);
306
- const initialDimensions = request.cols && request.rows ? {
307
- columns: request.cols,
308
- rows: request.rows
309
- } : undefined;
310
- this._proxy.$startExtensionTerminal(proxy.instanceId, initialDimensions).then(request.callback);
311
- proxy.onInput(data => this._proxy.$acceptProcessInput(proxy.instanceId, data));
312
- proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(proxy.instanceId, immediate));
313
- proxy.onRequestCwd(() => this._proxy.$acceptProcessRequestCwd(proxy.instanceId));
314
- proxy.onRequestInitialCwd(() => this._proxy.$acceptProcessRequestInitialCwd(proxy.instanceId));
315
- }
316
- $sendProcessData(terminalId, data) {
317
- this._terminalProcessProxies.get(terminalId)?.emitData(data);
318
- }
319
- $sendProcessReady(terminalId, pid, cwd, windowsPty) {
320
- this._terminalProcessProxies.get(terminalId)?.emitReady(pid, cwd, windowsPty);
321
- }
322
- $sendProcessProperty(terminalId, property) {
323
- if (property.type === "title" ) {
324
- const instance = this._terminalService.getInstanceFromId(terminalId);
325
- instance?.rename(property.value);
326
- }
327
- this._terminalProcessProxies.get(terminalId)?.emitProcessProperty(property);
328
- }
329
- $setEnvironmentVariableCollection(extensionIdentifier, persistent, collection, descriptionMap) {
330
- if (collection) {
331
- const translatedCollection = {
332
- persistent,
333
- map: deserializeEnvironmentVariableCollection(collection),
334
- descriptionMap: deserializeEnvironmentDescriptionMap(descriptionMap)
335
- };
336
- this._environmentVariableService.set(extensionIdentifier, translatedCollection);
337
- }
338
- else {
339
- this._environmentVariableService.delete(extensionIdentifier);
340
- }
341
- }
342
- };
343
- MainThreadTerminalService = __decorate([
344
- extHostNamedCustomer(MainContext.MainThreadTerminalService),
345
- ( __param(1, ITerminalService)),
346
- ( __param(2, ITerminalLinkProviderService)),
347
- ( __param(3, ITerminalQuickFixService)),
348
- ( __param(4, IInstantiationService)),
349
- ( __param(5, IEnvironmentVariableService)),
350
- ( __param(6, ILogService)),
351
- ( __param(7, ITerminalProfileResolverService)),
352
- ( __param(8, IRemoteAgentService)),
353
- ( __param(9, ITerminalGroupService)),
354
- ( __param(10, ITerminalEditorService)),
355
- ( __param(11, ITerminalProfileService))
356
- ], MainThreadTerminalService);
357
- let TerminalDataEventTracker = class TerminalDataEventTracker extends Disposable {
358
- constructor(_callback, _terminalService) {
359
- super();
360
- this._callback = _callback;
361
- this._terminalService = _terminalService;
362
- this._register(this._bufferer = ( new TerminalDataBufferer(this._callback)));
363
- for (const instance of this._terminalService.instances) {
364
- this._registerInstance(instance);
365
- }
366
- this._register(this._terminalService.onDidCreateInstance(instance => this._registerInstance(instance)));
367
- this._register(this._terminalService.onDidDisposeInstance(instance => this._bufferer.stopBuffering(instance.instanceId)));
368
- }
369
- _registerInstance(instance) {
370
- this._register(this._bufferer.startBuffering(instance.instanceId, instance.onData));
371
- }
372
- };
373
- TerminalDataEventTracker = ( __decorate([
374
- ( __param(1, ITerminalService))
375
- ], TerminalDataEventTracker));
376
- class ExtensionTerminalLinkProvider {
377
- constructor(_proxy) {
378
- this._proxy = _proxy;
379
- }
380
- async provideLinks(instance, line) {
381
- const proxy = this._proxy;
382
- const extHostLinks = await proxy.$provideLinks(instance.instanceId, line);
383
- return ( extHostLinks.map(dto => ({
384
- id: dto.id,
385
- startIndex: dto.startIndex,
386
- length: dto.length,
387
- label: dto.label,
388
- activate: () => proxy.$activateLink(instance.instanceId, dto.id)
389
- })));
390
- }
391
- }
392
- function getOutputMatchForLines(lines, outputMatcher) {
393
- const match = lines.join('\n').match(outputMatcher.lineMatcher);
394
- return match ? { regexMatch: match, outputLines: lines } : undefined;
395
- }
396
- function parseQuickFix(id, source, fix) {
397
- let type = TerminalQuickFixType.TerminalCommand;
398
- if ('uri' in fix) {
399
- fix.uri = URI.revive(fix.uri);
400
- type = TerminalQuickFixType.Opener;
401
- }
402
- else if ('id' in fix) {
403
- type = TerminalQuickFixType.VscodeCommand;
404
- }
405
- return { id, type, source, ...fix };
406
- }
407
-
408
- export { MainThreadTerminalService, getOutputMatchForLines };
@@ -1,195 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Event } from 'vscode/vscode/vs/base/common/event';
3
- import { Disposable, MutableDisposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { WellDefinedPrefixTree } from 'vscode/vscode/vs/base/common/prefixTree';
5
- import { URI } from 'vscode/vscode/vs/base/common/uri';
6
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
7
- import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
8
- import { MutableObservableValue } from 'vscode/vscode/vs/workbench/contrib/testing/common/observableValue';
9
- import { TestCoverage } from 'vscode/vscode/vs/workbench/contrib/testing/common/testCoverage';
10
- import { TestId } from 'vscode/vscode/vs/workbench/contrib/testing/common/testId';
11
- import { ITestProfileService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testProfileService';
12
- import { LiveTestResult } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResult';
13
- import { ITestResultService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResultService';
14
- import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
15
- import { ITestItem, ITestMessage, TestsDiffOp, IFileCoverage, CoverageDetails } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
16
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
17
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
18
-
19
- let MainThreadTesting = class MainThreadTesting extends Disposable {
20
- constructor(extHostContext, uriIdentityService, testService, testProfiles, resultService) {
21
- super();
22
- this.uriIdentityService = uriIdentityService;
23
- this.testService = testService;
24
- this.testProfiles = testProfiles;
25
- this.resultService = resultService;
26
- this.diffListener = this._register(( new MutableDisposable()));
27
- this.testProviderRegistrations = ( new Map());
28
- this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTesting));
29
- this._register(this.testService.onDidCancelTestRun(({ runId }) => {
30
- this.proxy.$cancelExtensionTestRun(runId);
31
- }));
32
- this._register(Event.debounce(testProfiles.onDidChange, (_last, e) => e)(() => {
33
- const obj = {};
34
- for (const { controller, profiles } of this.testProfiles.all()) {
35
- obj[controller.id] = ( profiles.filter(p => p.isDefault).map(p => p.profileId));
36
- }
37
- this.proxy.$setDefaultRunProfiles(obj);
38
- }));
39
- this._register(resultService.onResultsChanged(evt => {
40
- const results = 'completed' in evt ? evt.completed : ('inserted' in evt ? evt.inserted : undefined);
41
- const serialized = results?.toJSONWithMessages();
42
- if (serialized) {
43
- this.proxy.$publishTestResults([serialized]);
44
- }
45
- }));
46
- }
47
- $markTestRetired(testIds) {
48
- let tree;
49
- if (testIds) {
50
- tree = ( new WellDefinedPrefixTree());
51
- for (const id of testIds) {
52
- tree.insert(TestId.fromString(id).path, undefined);
53
- }
54
- }
55
- for (const result of this.resultService.results) {
56
- if (result instanceof LiveTestResult) {
57
- result.markRetired(tree);
58
- }
59
- }
60
- }
61
- $publishTestRunProfile(profile) {
62
- const controller = this.testProviderRegistrations.get(profile.controllerId);
63
- if (controller) {
64
- this.testProfiles.addProfile(controller.instance, profile);
65
- }
66
- }
67
- $updateTestRunConfig(controllerId, profileId, update) {
68
- this.testProfiles.updateProfile(controllerId, profileId, update);
69
- }
70
- $removeTestProfile(controllerId, profileId) {
71
- this.testProfiles.removeProfile(controllerId, profileId);
72
- }
73
- $addTestsToRun(controllerId, runId, tests) {
74
- this.withLiveRun(runId, r => r.addTestChainToRun(controllerId, ( tests.map(t => ITestItem.deserialize(this.uriIdentityService, t)))));
75
- }
76
- $signalCoverageAvailable(runId, taskId, available) {
77
- this.withLiveRun(runId, run => {
78
- const task = run.tasks.find(t => t.id === taskId);
79
- if (!task) {
80
- return;
81
- }
82
- const fn = available ? ((token) => TestCoverage.load(taskId, {
83
- provideFileCoverage: async (token) => await this.proxy.$provideFileCoverage(runId, taskId, token)
84
- .then(c => ( c.map(u => IFileCoverage.deserialize(this.uriIdentityService, u)))),
85
- resolveFileCoverage: (i, token) => this.proxy.$resolveFileCoverage(runId, taskId, i, token)
86
- .then(d => ( d.map(CoverageDetails.deserialize))),
87
- }, this.uriIdentityService, token)) : undefined;
88
- task.coverage.set(fn, undefined);
89
- });
90
- }
91
- $startedExtensionTestRun(req) {
92
- this.resultService.createLiveResult(req);
93
- }
94
- $startedTestRunTask(runId, task) {
95
- this.withLiveRun(runId, r => r.addTask(task));
96
- }
97
- $finishedTestRunTask(runId, taskId) {
98
- this.withLiveRun(runId, r => r.markTaskComplete(taskId));
99
- }
100
- $finishedExtensionTestRun(runId) {
101
- this.withLiveRun(runId, r => r.markComplete());
102
- }
103
- $updateTestStateInRun(runId, taskId, testId, state, duration) {
104
- this.withLiveRun(runId, r => r.updateState(testId, taskId, state, duration));
105
- }
106
- $appendOutputToRun(runId, taskId, output, locationDto, testId) {
107
- const location = locationDto && {
108
- uri: URI.revive(locationDto.uri),
109
- range: Range.lift(locationDto.range)
110
- };
111
- this.withLiveRun(runId, r => r.appendOutput(output, taskId, location, testId));
112
- }
113
- $appendTestMessagesInRun(runId, taskId, testId, messages) {
114
- const r = this.resultService.getResult(runId);
115
- if (r && r instanceof LiveTestResult) {
116
- for (const message of messages) {
117
- r.appendMessage(testId, taskId, ITestMessage.deserialize(this.uriIdentityService, message));
118
- }
119
- }
120
- }
121
- $registerTestController(controllerId, labelStr, canRefreshValue) {
122
- const disposable = ( new DisposableStore());
123
- const label = disposable.add(( new MutableObservableValue(labelStr)));
124
- const canRefresh = disposable.add(( new MutableObservableValue(canRefreshValue)));
125
- const controller = {
126
- id: controllerId,
127
- label,
128
- canRefresh,
129
- syncTests: () => this.proxy.$syncTests(),
130
- refreshTests: token => this.proxy.$refreshTests(controllerId, token),
131
- configureRunProfile: id => this.proxy.$configureRunProfile(controllerId, id),
132
- runTests: (reqs, token) => this.proxy.$runControllerTests(reqs, token),
133
- startContinuousRun: (reqs, token) => this.proxy.$startContinuousRun(reqs, token),
134
- expandTest: (testId, levels) => this.proxy.$expandTest(testId, isFinite(levels) ? levels : -1),
135
- };
136
- disposable.add(toDisposable(() => this.testProfiles.removeProfile(controllerId)));
137
- disposable.add(this.testService.registerTestController(controllerId, controller));
138
- this.testProviderRegistrations.set(controllerId, {
139
- instance: controller,
140
- label,
141
- canRefresh,
142
- disposable
143
- });
144
- }
145
- $updateController(controllerId, patch) {
146
- const controller = this.testProviderRegistrations.get(controllerId);
147
- if (!controller) {
148
- return;
149
- }
150
- if (patch.label !== undefined) {
151
- controller.label.value = patch.label;
152
- }
153
- if (patch.canRefresh !== undefined) {
154
- controller.canRefresh.value = patch.canRefresh;
155
- }
156
- }
157
- $unregisterTestController(controllerId) {
158
- this.testProviderRegistrations.get(controllerId)?.disposable.dispose();
159
- this.testProviderRegistrations.delete(controllerId);
160
- }
161
- $subscribeToDiffs() {
162
- this.proxy.$acceptDiff(( this.testService.collection.getReviverDiff().map(TestsDiffOp.serialize)));
163
- this.diffListener.value = this.testService.onDidProcessDiff(this.proxy.$acceptDiff, this.proxy);
164
- }
165
- $unsubscribeFromDiffs() {
166
- this.diffListener.clear();
167
- }
168
- $publishDiff(controllerId, diff) {
169
- this.testService.publishDiff(controllerId, ( diff.map(d => TestsDiffOp.deserialize(this.uriIdentityService, d))));
170
- }
171
- async $runTests(req, token) {
172
- const result = await this.testService.runResolvedTests(req, token);
173
- return result.id;
174
- }
175
- dispose() {
176
- super.dispose();
177
- for (const subscription of ( this.testProviderRegistrations.values())) {
178
- subscription.disposable.dispose();
179
- }
180
- this.testProviderRegistrations.clear();
181
- }
182
- withLiveRun(runId, fn) {
183
- const r = this.resultService.getResult(runId);
184
- return r && r instanceof LiveTestResult ? fn(r) : undefined;
185
- }
186
- };
187
- MainThreadTesting = __decorate([
188
- extHostNamedCustomer(MainContext.MainThreadTesting),
189
- ( __param(1, IUriIdentityService)),
190
- ( __param(2, ITestService)),
191
- ( __param(3, ITestProfileService)),
192
- ( __param(4, ITestResultService))
193
- ], MainThreadTesting);
194
-
195
- export { MainThreadTesting };