@codingame/monaco-vscode-extensions-service-override 3.2.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions.js +1 -82
- package/override/vs/platform/dialogs/common/dialogs.js +2 -0
- package/package.json +9 -9
- package/vscode/src/vs/base/common/console.js +3 -0
- package/vscode/src/vs/workbench/api/browser/extensionHost.contribution.js +104 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +75 -48
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +35 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +23 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +33 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +21 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +5 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +47 -22
- package/vscode/src/vs/workbench/api/browser/{mainThreadChatProvider.js → mainThreadLanguageModels.js} +25 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +27 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +51 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +39 -15
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +3 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +13 -2
- /package/vscode/src/vs/workbench/api/browser/{mainThreadProfilContentHandlers.js → mainThreadProfileContentHandlers.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
2
3
|
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
4
|
import { DisposableStore, DisposableMap, Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
5
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
@@ -6,33 +7,35 @@ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
|
6
7
|
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
7
8
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
8
9
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
9
|
-
import {
|
|
10
|
+
import { ILanguageModelsService } from 'vscode/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
11
|
+
import { IAuthenticationAccessService } from 'vscode/vscode/vs/workbench/services/authentication/browser/authenticationAccessService';
|
|
10
12
|
import { IAuthenticationService, INTERNAL_AUTH_PROVIDER_PREFIX } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication';
|
|
11
13
|
import { IExtensionFeaturesManagementService, Extensions } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
12
14
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
13
15
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
14
16
|
|
|
15
|
-
let
|
|
16
|
-
constructor(extHostContext, _chatProviderService, _extensionFeaturesManagementService, _logService, _authenticationService, _extensionService) {
|
|
17
|
+
let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
18
|
+
constructor(extHostContext, _chatProviderService, _extensionFeaturesManagementService, _logService, _authenticationService, _authenticationAccessService, _extensionService) {
|
|
17
19
|
this._chatProviderService = _chatProviderService;
|
|
18
20
|
this._extensionFeaturesManagementService = _extensionFeaturesManagementService;
|
|
19
21
|
this._logService = _logService;
|
|
20
22
|
this._authenticationService = _authenticationService;
|
|
23
|
+
this._authenticationAccessService = _authenticationAccessService;
|
|
21
24
|
this._extensionService = _extensionService;
|
|
22
25
|
this._store = ( new DisposableStore());
|
|
23
26
|
this._providerRegistrations = ( new DisposableMap());
|
|
24
27
|
this._pendingProgress = ( new Map());
|
|
25
28
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatProvider));
|
|
26
|
-
this._proxy.$updateLanguageModels({ added: _chatProviderService.
|
|
27
|
-
this._store.add(_chatProviderService.
|
|
29
|
+
this._proxy.$updateLanguageModels({ added: coalesce(( _chatProviderService.getLanguageModelIds().map(id => _chatProviderService.lookupLanguageModel(id)))) });
|
|
30
|
+
this._store.add(_chatProviderService.onDidChangeLanguageModels(this._proxy.$updateLanguageModels, this._proxy));
|
|
28
31
|
}
|
|
29
32
|
dispose() {
|
|
30
33
|
this._providerRegistrations.dispose();
|
|
31
34
|
this._store.dispose();
|
|
32
35
|
}
|
|
33
|
-
$
|
|
36
|
+
$registerLanguageModelProvider(handle, identifier, metadata) {
|
|
34
37
|
const dipsosables = ( new DisposableStore());
|
|
35
|
-
dipsosables.add(this._chatProviderService.
|
|
38
|
+
dipsosables.add(this._chatProviderService.registerLanguageModelChat(identifier, {
|
|
36
39
|
metadata,
|
|
37
40
|
provideChatResponse: async (messages, from, options, progress, token) => {
|
|
38
41
|
const requestId = (Math.random() * 1e6) | 0;
|
|
@@ -51,7 +54,7 @@ let MainThreadChatProvider = class MainThreadChatProvider {
|
|
|
51
54
|
dipsosables.add(( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
52
55
|
id: `lm-${identifier}`,
|
|
53
56
|
label: ( localizeWithPath(
|
|
54
|
-
'vs/workbench/api/browser/
|
|
57
|
+
'vs/workbench/api/browser/mainThreadLanguageModels',
|
|
55
58
|
'languageModels',
|
|
56
59
|
"Language Model ({0})",
|
|
57
60
|
`${identifier}`
|
|
@@ -70,20 +73,20 @@ let MainThreadChatProvider = class MainThreadChatProvider {
|
|
|
70
73
|
}
|
|
71
74
|
async $prepareChatAccess(extension, providerId, justification) {
|
|
72
75
|
const activate = this._extensionService.activateByEvent(`onLanguageModelAccess:${providerId}`);
|
|
73
|
-
const metadata = this._chatProviderService.
|
|
76
|
+
const metadata = this._chatProviderService.lookupLanguageModel(providerId);
|
|
74
77
|
if (metadata) {
|
|
75
78
|
return metadata;
|
|
76
79
|
}
|
|
77
80
|
await Promise.race([
|
|
78
81
|
activate,
|
|
79
|
-
Event.toPromise(Event.filter(this._chatProviderService.
|
|
82
|
+
Event.toPromise(Event.filter(this._chatProviderService.onDidChangeLanguageModels, e => Boolean(e.added?.some(value => value.identifier === providerId))))
|
|
80
83
|
]);
|
|
81
|
-
return this._chatProviderService.
|
|
84
|
+
return this._chatProviderService.lookupLanguageModel(providerId);
|
|
82
85
|
}
|
|
83
86
|
async $fetchResponse(extension, providerId, requestId, messages, options, token) {
|
|
84
87
|
await this._extensionFeaturesManagementService.getAccess(extension, `lm-${providerId}`);
|
|
85
88
|
this._logService.debug('[CHAT] extension request STARTED', extension.value, requestId);
|
|
86
|
-
const task = this._chatProviderService.
|
|
89
|
+
const task = this._chatProviderService.makeLanguageModelChatRequest(providerId, extension, messages, options, ( new Progress(value => {
|
|
87
90
|
this._proxy.$handleResponseFragment(requestId, value);
|
|
88
91
|
})), token);
|
|
89
92
|
task.catch(err => {
|
|
@@ -100,7 +103,7 @@ let MainThreadChatProvider = class MainThreadChatProvider {
|
|
|
100
103
|
return Disposable.None;
|
|
101
104
|
}
|
|
102
105
|
const accountLabel = auth.accountLabel ?? ( localizeWithPath(
|
|
103
|
-
'vs/workbench/api/browser/
|
|
106
|
+
'vs/workbench/api/browser/mainThreadLanguageModels',
|
|
104
107
|
'languageModelsAccountId',
|
|
105
108
|
'Language Models'
|
|
106
109
|
));
|
|
@@ -109,28 +112,8 @@ let MainThreadChatProvider = class MainThreadChatProvider {
|
|
|
109
112
|
disposables.add(toDisposable(() => {
|
|
110
113
|
this._authenticationService.unregisterAuthenticationProvider(authProviderId);
|
|
111
114
|
}));
|
|
112
|
-
disposables.add(this.
|
|
113
|
-
|
|
114
|
-
if (e.event.removed?.length) {
|
|
115
|
-
const allowedExtensions = this._authenticationService.readAllowedExtensions(authProviderId, accountLabel);
|
|
116
|
-
const extensionsToUpdateAccess = [];
|
|
117
|
-
for (const allowed of allowedExtensions) {
|
|
118
|
-
const from = await this._extensionService.getExtension(allowed.id);
|
|
119
|
-
this._authenticationService.updateAllowedExtension(authProviderId, authProviderId, allowed.id, allowed.name, false);
|
|
120
|
-
if (from) {
|
|
121
|
-
extensionsToUpdateAccess.push({
|
|
122
|
-
from: from.identifier,
|
|
123
|
-
to: extension,
|
|
124
|
-
enabled: false
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
this._proxy.$updateModelAccesslist(extensionsToUpdateAccess);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}));
|
|
132
|
-
disposables.add(this._authenticationService.onDidChangeExtensionSessionAccess(async (e) => {
|
|
133
|
-
const allowedExtensions = this._authenticationService.readAllowedExtensions(authProviderId, accountLabel);
|
|
115
|
+
disposables.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async (e) => {
|
|
116
|
+
const allowedExtensions = this._authenticationAccessService.readAllowedExtensions(authProviderId, accountLabel);
|
|
134
117
|
const accessList = [];
|
|
135
118
|
for (const allowedExtension of allowedExtensions) {
|
|
136
119
|
const from = await this._extensionService.getExtension(allowedExtension.id);
|
|
@@ -147,14 +130,15 @@ let MainThreadChatProvider = class MainThreadChatProvider {
|
|
|
147
130
|
return disposables;
|
|
148
131
|
}
|
|
149
132
|
};
|
|
150
|
-
|
|
151
|
-
extHostNamedCustomer(MainContext.
|
|
152
|
-
( __param(1,
|
|
133
|
+
MainThreadLanguageModels = __decorate([
|
|
134
|
+
extHostNamedCustomer(MainContext.MainThreadLanguageModels),
|
|
135
|
+
( __param(1, ILanguageModelsService)),
|
|
153
136
|
( __param(2, IExtensionFeaturesManagementService)),
|
|
154
137
|
( __param(3, ILogService)),
|
|
155
138
|
( __param(4, IAuthenticationService)),
|
|
156
|
-
( __param(5,
|
|
157
|
-
|
|
139
|
+
( __param(5, IAuthenticationAccessService)),
|
|
140
|
+
( __param(6, IExtensionService))
|
|
141
|
+
], MainThreadLanguageModels);
|
|
158
142
|
class LanguageModelAccessAuthProvider {
|
|
159
143
|
constructor(id, label, _accountLabel) {
|
|
160
144
|
this.id = id;
|
|
@@ -198,4 +182,4 @@ class LanguageModelAccessAuthProvider {
|
|
|
198
182
|
}
|
|
199
183
|
}
|
|
200
184
|
|
|
201
|
-
export {
|
|
185
|
+
export { MainThreadLanguageModels };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
3
|
import { DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
5
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
@@ -19,7 +19,7 @@ let MainThreadQuickDiff = class MainThreadQuickDiff {
|
|
|
19
19
|
selector,
|
|
20
20
|
isSCM: false,
|
|
21
21
|
getOriginalResource: async (uri) => {
|
|
22
|
-
return URI.revive(await this.proxy.$provideOriginalResource(handle, uri,
|
|
22
|
+
return URI.revive(await this.proxy.$provideOriginalResource(handle, uri, CancellationToken.None));
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const disposable = this.quickDiffService.addQuickDiffProvider(provider);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
3
|
-
import {
|
|
3
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { DisposableStore, dispose, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { ISCMService, ISCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
6
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
@@ -8,11 +8,14 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
|
|
|
8
8
|
import { ISearchService } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
9
9
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
10
10
|
import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
11
|
+
import { SearchContext } from 'vscode/vscode/vs/workbench/contrib/search/common/constants';
|
|
12
|
+
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
13
|
|
|
12
14
|
let MainThreadSearch = class MainThreadSearch {
|
|
13
|
-
constructor(extHostContext, _searchService, _telemetryService, _configurationService) {
|
|
15
|
+
constructor(extHostContext, _searchService, _telemetryService, _configurationService, contextKeyService) {
|
|
14
16
|
this._searchService = _searchService;
|
|
15
17
|
this._telemetryService = _telemetryService;
|
|
18
|
+
this.contextKeyService = contextKeyService;
|
|
16
19
|
this._searchProvider = ( new Map());
|
|
17
20
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostSearch));
|
|
18
21
|
this._proxy.$enableExtensionHostSearch();
|
|
@@ -30,6 +33,16 @@ let MainThreadSearch = class MainThreadSearch {
|
|
|
30
33
|
this._proxy
|
|
31
34
|
)));
|
|
32
35
|
}
|
|
36
|
+
$registerAITextSearchProvider(handle, scheme) {
|
|
37
|
+
SearchContext.hasAIResultProvider.bindTo(this.contextKeyService).set(true);
|
|
38
|
+
this._searchProvider.set(handle, ( new RemoteSearchProvider(
|
|
39
|
+
this._searchService,
|
|
40
|
+
2 ,
|
|
41
|
+
scheme,
|
|
42
|
+
handle,
|
|
43
|
+
this._proxy
|
|
44
|
+
)));
|
|
45
|
+
}
|
|
33
46
|
$registerFileSearchProvider(handle, scheme) {
|
|
34
47
|
this._searchProvider.set(handle, ( new RemoteSearchProvider(
|
|
35
48
|
this._searchService,
|
|
@@ -65,7 +78,8 @@ MainThreadSearch = __decorate([
|
|
|
65
78
|
extHostNamedCustomer(MainContext.MainThreadSearch),
|
|
66
79
|
( __param(1, ISearchService)),
|
|
67
80
|
( __param(2, ITelemetryService)),
|
|
68
|
-
( __param(3, IConfigurationService))
|
|
81
|
+
( __param(3, IConfigurationService)),
|
|
82
|
+
( __param(4, IContextKeyService))
|
|
69
83
|
], MainThreadSearch);
|
|
70
84
|
class SearchOperation {
|
|
71
85
|
static { this._idPool = 0; }
|
|
@@ -111,9 +125,7 @@ class RemoteSearchProvider {
|
|
|
111
125
|
}
|
|
112
126
|
const search = ( new SearchOperation(onProgress));
|
|
113
127
|
this._searches.set(search.id, search);
|
|
114
|
-
const searchP = query.
|
|
115
|
-
? this._proxy.$provideFileSearchResults(this._handle, search.id, query, token)
|
|
116
|
-
: this._proxy.$provideTextSearchResults(this._handle, search.id, query, token);
|
|
128
|
+
const searchP = this._provideSearchResults(query, search.id, token);
|
|
117
129
|
return Promise.resolve(searchP).then((result) => {
|
|
118
130
|
this._searches.delete(search.id);
|
|
119
131
|
return { results: Array.from(( search.matches.values())), stats: result.stats, limitHit: result.limitHit, messages: result.messages };
|
|
@@ -141,6 +153,16 @@ class RemoteSearchProvider {
|
|
|
141
153
|
}
|
|
142
154
|
});
|
|
143
155
|
}
|
|
156
|
+
_provideSearchResults(query, session, token) {
|
|
157
|
+
switch (query.type) {
|
|
158
|
+
case 1 :
|
|
159
|
+
return this._proxy.$provideFileSearchResults(this._handle, session, query, token);
|
|
160
|
+
case 2 :
|
|
161
|
+
return this._proxy.$provideTextSearchResults(this._handle, session, query, token);
|
|
162
|
+
default:
|
|
163
|
+
return this._proxy.$provideAITextSearchResults(this._handle, session, query, token);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
144
166
|
}
|
|
145
167
|
|
|
146
168
|
export { MainThreadSearch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
3
|
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
5
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
@@ -20,7 +20,7 @@ let MainThreadShare = class MainThreadShare {
|
|
|
20
20
|
selector,
|
|
21
21
|
priority,
|
|
22
22
|
provideShare: async (item) => {
|
|
23
|
-
const result = await this.proxy.$provideShare(handle, item,
|
|
23
|
+
const result = await this.proxy.$provideShare(handle, item, CancellationToken.None);
|
|
24
24
|
return typeof result === 'string' ? result : URI.revive(result);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -114,6 +114,7 @@ let MainThreadTerminalService = class MainThreadTerminalService {
|
|
|
114
114
|
? (id, cols, rows) => ( new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService))
|
|
115
115
|
: undefined,
|
|
116
116
|
extHostTerminalId,
|
|
117
|
+
forceShellIntegration: launchConfig.forceShellIntegration,
|
|
117
118
|
isFeatureTerminal: launchConfig.isFeatureTerminal,
|
|
118
119
|
isExtensionOwnedTerminal: launchConfig.isExtensionOwnedTerminal,
|
|
119
120
|
useShellEnvironment: launchConfig.useShellEnvironment,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
+
import { ITerminalService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal';
|
|
6
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
7
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
8
|
+
|
|
9
|
+
let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegration extends Disposable {
|
|
10
|
+
constructor(extHostContext, _terminalService, workbenchEnvironmentService) {
|
|
11
|
+
super();
|
|
12
|
+
this._terminalService = _terminalService;
|
|
13
|
+
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostTerminalShellIntegration));
|
|
14
|
+
const onDidAddCommandDetection = this._terminalService.createOnInstanceEvent(instance => {
|
|
15
|
+
return ( Event.map(Event.filter(instance.capabilities.onDidAddCapabilityType, e => {
|
|
16
|
+
return e === 2 ;
|
|
17
|
+
}, this._store), () => instance));
|
|
18
|
+
});
|
|
19
|
+
this._store.add(onDidAddCommandDetection(e => this._proxy.$shellIntegrationChange(e.instanceId)));
|
|
20
|
+
const commandDetectionStartEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(2 , e => e.onCommandExecuted));
|
|
21
|
+
let currentCommand;
|
|
22
|
+
this._store.add(commandDetectionStartEvent.event(e => {
|
|
23
|
+
if (e.data === currentCommand) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
currentCommand = e.data;
|
|
27
|
+
this._proxy.$shellExecutionStart(e.instance.instanceId, e.data.command, e.data.cwd);
|
|
28
|
+
}));
|
|
29
|
+
const commandDetectionEndEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(2 , e => e.onCommandFinished));
|
|
30
|
+
this._store.add(commandDetectionEndEvent.event(e => {
|
|
31
|
+
currentCommand = undefined;
|
|
32
|
+
this._proxy.$shellExecutionEnd(e.instance.instanceId, e.data.command, e.data.exitCode);
|
|
33
|
+
}));
|
|
34
|
+
const cwdChangeEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(0 , e => e.onDidChangeCwd));
|
|
35
|
+
this._store.add(cwdChangeEvent.event(e => this._proxy.$cwdChange(e.instance.instanceId, e.data)));
|
|
36
|
+
this._store.add(this._terminalService.onDidDisposeInstance(e => this._proxy.$closeTerminal(e.instanceId)));
|
|
37
|
+
if (!workbenchEnvironmentService.remoteAuthority) {
|
|
38
|
+
this._store.add(this._terminalService.onAnyInstanceData(e => this._proxy.$shellExecutionData(e.instance.instanceId, e.data)));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
$executeCommand(terminalId, commandLine) {
|
|
42
|
+
this._terminalService.getInstanceFromId(terminalId)?.runCommand(commandLine, true);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
MainThreadTerminalShellIntegration = __decorate([
|
|
46
|
+
extHostNamedCustomer(MainContext.MainThreadTerminalShellIntegration),
|
|
47
|
+
( __param(1, ITerminalService)),
|
|
48
|
+
( __param(2, IWorkbenchEnvironmentService))
|
|
49
|
+
], MainThreadTerminalShellIntegration);
|
|
50
|
+
|
|
51
|
+
export { MainThreadTerminalShellIntegration };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
3
|
import { Disposable, MutableDisposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { transaction } from 'vscode/vscode/vs/base/common/observableInternal/base';
|
|
5
|
+
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
6
|
+
import 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
7
|
+
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
8
|
+
import 'vscode/vscode/vs/base/common/cancellation';
|
|
4
9
|
import { WellDefinedPrefixTree } from 'vscode/vscode/vs/base/common/prefixTree';
|
|
5
10
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
11
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
@@ -12,7 +17,7 @@ import { ITestProfileService } from 'vscode/vscode/vs/workbench/contrib/testing/
|
|
|
12
17
|
import { LiveTestResult } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResult';
|
|
13
18
|
import { ITestResultService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testResultService';
|
|
14
19
|
import { ITestService } from 'vscode/vscode/vs/workbench/contrib/testing/common/testService';
|
|
15
|
-
import { ITestItem,
|
|
20
|
+
import { ITestItem, IFileCoverage, CoverageDetails, ITestMessage, TestsDiffOp } from 'vscode/vscode/vs/workbench/contrib/testing/common/testTypes';
|
|
16
21
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
17
22
|
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
18
23
|
|
|
@@ -31,16 +36,27 @@ let MainThreadTesting = class MainThreadTesting extends Disposable {
|
|
|
31
36
|
}));
|
|
32
37
|
this._register(Event.debounce(testProfiles.onDidChange, (_last, e) => e)(() => {
|
|
33
38
|
const obj = {};
|
|
34
|
-
for (const
|
|
35
|
-
|
|
39
|
+
for (const group of [2 , 4 , 8 ]) {
|
|
40
|
+
for (const profile of this.testProfiles.getGroupDefaultProfiles(group)) {
|
|
41
|
+
obj[profile.controllerId] ??= [];
|
|
42
|
+
obj[profile.controllerId].push(profile.profileId);
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
this.proxy.$setDefaultRunProfiles(obj);
|
|
38
46
|
}));
|
|
39
47
|
this._register(resultService.onResultsChanged(evt => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
if ('completed' in evt) {
|
|
49
|
+
const serialized = evt.completed.toJSONWithMessages();
|
|
50
|
+
if (serialized) {
|
|
51
|
+
this.proxy.$publishTestResults([serialized]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if ('removed' in evt) {
|
|
55
|
+
evt.removed.forEach(r => {
|
|
56
|
+
if (r instanceof LiveTestResult) {
|
|
57
|
+
this.proxy.$disposeRun(r.id);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
44
60
|
}
|
|
45
61
|
}));
|
|
46
62
|
}
|
|
@@ -73,19 +89,27 @@ let MainThreadTesting = class MainThreadTesting extends Disposable {
|
|
|
73
89
|
$addTestsToRun(controllerId, runId, tests) {
|
|
74
90
|
this.withLiveRun(runId, r => r.addTestChainToRun(controllerId, ( tests.map(t => ITestItem.deserialize(this.uriIdentityService, t)))));
|
|
75
91
|
}
|
|
76
|
-
$
|
|
92
|
+
$appendCoverage(runId, taskId, coverage) {
|
|
77
93
|
this.withLiveRun(runId, run => {
|
|
78
94
|
const task = run.tasks.find(t => t.id === taskId);
|
|
79
95
|
if (!task) {
|
|
80
96
|
return;
|
|
81
97
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
const deserialized = IFileCoverage.deserialize(this.uriIdentityService, coverage);
|
|
99
|
+
transaction(tx => {
|
|
100
|
+
let value = task.coverage.read(undefined);
|
|
101
|
+
if (!value) {
|
|
102
|
+
value = ( new TestCoverage(taskId, this.uriIdentityService, {
|
|
103
|
+
getCoverageDetails: (id, token) => this.proxy.$getCoverageDetails(id, token)
|
|
104
|
+
.then(r => ( r.map(CoverageDetails.deserialize))),
|
|
105
|
+
}));
|
|
106
|
+
value.append(deserialized, tx);
|
|
107
|
+
task.coverage.set(value, tx);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
value.append(deserialized, tx);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
89
113
|
});
|
|
90
114
|
}
|
|
91
115
|
$startedExtensionTestRun(req) {
|
|
@@ -23,6 +23,7 @@ import { extensionRunningPreferenceToString, extensionHostKindToString } from 'v
|
|
|
23
23
|
import { IExtensionManifestPropertiesService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService';
|
|
24
24
|
import { filterExtensionDescriptions } from '../common/extensionRunningLocationTracker.js';
|
|
25
25
|
import { toExtensionDescription, ExtensionHostExtensions } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
26
|
+
import '../common/extensionsProposedApi.js';
|
|
26
27
|
import { dedupExtensions } from '../common/extensionsUtil.js';
|
|
27
28
|
import { RemoteExtensionHost } from '../common/remoteExtensionHost.js';
|
|
28
29
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
@@ -128,10 +128,18 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
128
128
|
this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(added, removed)));
|
|
129
129
|
}
|
|
130
130
|
}));
|
|
131
|
+
this._register(this._extensionManagementService.onDidEnableExtensions(extensions => {
|
|
132
|
+
if (extensions.length) {
|
|
133
|
+
if (isCI) {
|
|
134
|
+
this._logService.info(`AbstractExtensionService.onDidEnableExtensions fired`);
|
|
135
|
+
}
|
|
136
|
+
this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(extensions, [])));
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
131
139
|
this._register(this._extensionManagementService.onDidInstallExtensions((result) => {
|
|
132
140
|
const extensions = [];
|
|
133
141
|
for (const { local, operation } of result) {
|
|
134
|
-
if (local && operation !== 4 && this._safeInvokeIsEnabled(local)) {
|
|
142
|
+
if (local && local.isValid && operation !== 4 && this._safeInvokeIsEnabled(local)) {
|
|
135
143
|
extensions.push(local);
|
|
136
144
|
}
|
|
137
145
|
}
|
|
@@ -739,8 +747,11 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
739
747
|
this._logService.error(`Extension host (${extensionHost.friendyName}) terminated unexpectedly. No extensions were activated.`);
|
|
740
748
|
}
|
|
741
749
|
}
|
|
742
|
-
async startExtensionHosts() {
|
|
750
|
+
async startExtensionHosts(updates) {
|
|
743
751
|
this._doStopExtensionHosts();
|
|
752
|
+
if (updates) {
|
|
753
|
+
await this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(updates.toAdd, updates.toRemove)));
|
|
754
|
+
}
|
|
744
755
|
const lock = await this._registry.acquireLock('startExtensionHosts');
|
|
745
756
|
try {
|
|
746
757
|
this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
|