@codingame/monaco-vscode-extensions-service-override 15.0.3 → 16.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/index.js +3 -1
- package/package.json +35 -28
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +33 -29
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.d.ts +2 -2
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +6 -5
- package/vscode/src/vs/platform/remote/common/managedSocket.d.ts +1 -1
- package/vscode/src/vs/platform/remote/common/managedSocket.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +10 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +4 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +35 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +4 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +11 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +166 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.d.ts +14 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +46 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +15 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.d.ts +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +18 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +6 -6
- package/vscode/src/vs/workbench/api/common/shared/tasks.d.ts +144 -0
- package/vscode/src/vs/workbench/api/common/shared/tasks.js +20 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +1 -1
- /package/{assets → vscode/src/vs/workbench/services/extensions/worker}/webWorkerExtensionHostIframe.html +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { Disposable, DisposableMap, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
+
import { LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log';
|
|
9
|
+
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
10
|
+
import { mcpEnabledSection } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
11
|
+
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
12
|
+
import { McpServerTransportType, McpServerDefinition, McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
13
|
+
import { ExtensionHostKind, extensionHostKindToString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionHostKind';
|
|
14
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
15
|
+
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
16
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
17
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
18
|
+
|
|
19
|
+
let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
20
|
+
constructor(_extHostContext, _mcpRegistry, configurationService) {
|
|
21
|
+
super();
|
|
22
|
+
this._extHostContext = _extHostContext;
|
|
23
|
+
this._mcpRegistry = _mcpRegistry;
|
|
24
|
+
this._serverIdCounter = 0;
|
|
25
|
+
this._servers = ( new Map());
|
|
26
|
+
this._collectionDefinitions = this._register(( new DisposableMap()));
|
|
27
|
+
const proxy = ( _extHostContext.getProxy(ExtHostContext.ExtHostMcp));
|
|
28
|
+
this._mcpEnabled = observableConfigValue(mcpEnabledSection, true, configurationService);
|
|
29
|
+
this._register(this._mcpRegistry.registerDelegate({
|
|
30
|
+
priority: _extHostContext.extensionHostKind === ExtensionHostKind.LocalWebWorker ? 0 : 1,
|
|
31
|
+
waitForInitialProviderPromises() {
|
|
32
|
+
return proxy.$waitForInitialCollectionProviders();
|
|
33
|
+
},
|
|
34
|
+
canStart(collection, serverDefinition) {
|
|
35
|
+
if (collection.remoteAuthority !== _extHostContext.remoteAuthority) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (serverDefinition.launch.type === McpServerTransportType.Stdio && _extHostContext.extensionHostKind === ExtensionHostKind.LocalWebWorker) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
start: (collection, _serverDefiniton, resolveLaunch) => {
|
|
44
|
+
const id = ++this._serverIdCounter;
|
|
45
|
+
const launch = ( new ExtHostMcpServerLaunch(
|
|
46
|
+
_extHostContext.extensionHostKind,
|
|
47
|
+
() => proxy.$stopMcp(id),
|
|
48
|
+
msg => proxy.$sendMessage(id, JSON.stringify(msg))
|
|
49
|
+
));
|
|
50
|
+
this._servers.set(id, launch);
|
|
51
|
+
proxy.$startMcp(id, resolveLaunch);
|
|
52
|
+
return launch;
|
|
53
|
+
},
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
$upsertMcpCollection(collection, serversDto) {
|
|
57
|
+
const servers = ( serversDto.map(McpServerDefinition.fromSerialized));
|
|
58
|
+
const existing = this._collectionDefinitions.get(collection.id);
|
|
59
|
+
if (existing) {
|
|
60
|
+
existing.servers.set(servers, undefined);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const serverDefinitions = observableValue('mcpServers', servers);
|
|
64
|
+
const store = ( new DisposableStore());
|
|
65
|
+
const handle = store.add(( new MutableDisposable()));
|
|
66
|
+
store.add(autorun(reader => {
|
|
67
|
+
if (this._mcpEnabled.read(reader)) {
|
|
68
|
+
handle.value = this._mcpRegistry.registerCollection({
|
|
69
|
+
...collection,
|
|
70
|
+
remoteAuthority: this._extHostContext.remoteAuthority,
|
|
71
|
+
serverDefinitions,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
handle.clear();
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
this._collectionDefinitions.set(collection.id, {
|
|
79
|
+
fromExtHost: collection,
|
|
80
|
+
servers: serverDefinitions,
|
|
81
|
+
dispose: () => store.dispose(),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
$deleteMcpCollection(collectionId) {
|
|
86
|
+
this._collectionDefinitions.deleteAndDispose(collectionId);
|
|
87
|
+
}
|
|
88
|
+
$onDidChangeState(id, update) {
|
|
89
|
+
const server = this._servers.get(id);
|
|
90
|
+
if (!server) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
server.state.set(update, undefined);
|
|
94
|
+
if (!McpConnectionState.isRunning(update)) {
|
|
95
|
+
server.dispose();
|
|
96
|
+
this._servers.delete(id);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
$onDidPublishLog(id, level, log) {
|
|
100
|
+
if (typeof level === 'string') {
|
|
101
|
+
level = LogLevel.Info;
|
|
102
|
+
log = level;
|
|
103
|
+
}
|
|
104
|
+
this._servers.get(id)?.pushLog(level, log);
|
|
105
|
+
}
|
|
106
|
+
$onDidReceiveMessage(id, message) {
|
|
107
|
+
this._servers.get(id)?.pushMessage(message);
|
|
108
|
+
}
|
|
109
|
+
dispose() {
|
|
110
|
+
for (const server of ( this._servers.values())) {
|
|
111
|
+
server.extHostDispose();
|
|
112
|
+
}
|
|
113
|
+
this._servers.clear();
|
|
114
|
+
super.dispose();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
MainThreadMcp = __decorate([
|
|
118
|
+
extHostNamedCustomer(MainContext.MainThreadMcp),
|
|
119
|
+
( __param(1, IMcpRegistry)),
|
|
120
|
+
( __param(2, IConfigurationService))
|
|
121
|
+
], MainThreadMcp);
|
|
122
|
+
class ExtHostMcpServerLaunch extends Disposable {
|
|
123
|
+
pushLog(level, message) {
|
|
124
|
+
this._onDidLog.fire({ message, level });
|
|
125
|
+
}
|
|
126
|
+
pushMessage(message) {
|
|
127
|
+
let parsed;
|
|
128
|
+
try {
|
|
129
|
+
parsed = JSON.parse(message);
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
this.pushLog(LogLevel.Warning, `Failed to parse message: ${JSON.stringify(message)}`);
|
|
133
|
+
}
|
|
134
|
+
if (parsed) {
|
|
135
|
+
this._onDidReceiveMessage.fire(parsed);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
constructor(extHostKind, stop, send) {
|
|
139
|
+
super();
|
|
140
|
+
this.stop = stop;
|
|
141
|
+
this.send = send;
|
|
142
|
+
this.state = observableValue('mcpServerState', { state: McpConnectionState.Kind.Starting });
|
|
143
|
+
this._onDidLog = this._register(( new Emitter()));
|
|
144
|
+
this.onDidLog = this._onDidLog.event;
|
|
145
|
+
this._onDidReceiveMessage = this._register(( new Emitter()));
|
|
146
|
+
this.onDidReceiveMessage = this._onDidReceiveMessage.event;
|
|
147
|
+
this._register(disposableTimeout(() => {
|
|
148
|
+
this.pushLog(LogLevel.Info, `Starting server from ${extensionHostKindToString(extHostKind)} extension host`);
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
extHostDispose() {
|
|
152
|
+
if (McpConnectionState.isRunning(this.state.get())) {
|
|
153
|
+
this.pushLog(LogLevel.Warning, 'Extension host shut down, server will stop.');
|
|
154
|
+
this.state.set({ state: McpConnectionState.Kind.Stopped }, undefined);
|
|
155
|
+
}
|
|
156
|
+
this.dispose();
|
|
157
|
+
}
|
|
158
|
+
dispose() {
|
|
159
|
+
if (McpConnectionState.isRunning(this.state.get())) {
|
|
160
|
+
this.stop();
|
|
161
|
+
}
|
|
162
|
+
super.dispose();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export { MainThreadMcp };
|
|
@@ -51,13 +51,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
if (!source) {
|
|
54
|
-
source = ( localize(
|
|
54
|
+
source = ( localize(2408, "Extension"));
|
|
55
55
|
}
|
|
56
56
|
const secondaryActions = [];
|
|
57
57
|
if (options.source) {
|
|
58
58
|
secondaryActions.push(toAction({
|
|
59
59
|
id: options.source.identifier.value,
|
|
60
|
-
label: ( localize(
|
|
60
|
+
label: ( localize(2409, "Manage Extension")),
|
|
61
61
|
run: () => {
|
|
62
62
|
return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
|
|
63
63
|
}
|
|
@@ -92,13 +92,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
92
92
|
if (!cancelButton) {
|
|
93
93
|
if (buttons.length > 0) {
|
|
94
94
|
cancelButton = {
|
|
95
|
-
label: ( localize(
|
|
95
|
+
label: ( localize(2410, "Cancel")),
|
|
96
96
|
run: () => undefined
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
100
|
cancelButton = {
|
|
101
|
-
label: ( localize(
|
|
101
|
+
label: ( localize(2411, "&&OK")),
|
|
102
102
|
run: () => undefined
|
|
103
103
|
};
|
|
104
104
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
4
|
import { DisposableStore, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
5
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
5
6
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -93,7 +94,7 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
93
94
|
async $tryCreateNotebook(options) {
|
|
94
95
|
if (options.content) {
|
|
95
96
|
const ref = await this._notebookEditorModelResolverService.resolve({ untitledResource: undefined }, options.viewType);
|
|
96
|
-
ref.object.notebook.onWillDispose(() => {
|
|
97
|
+
Event.once(ref.object.notebook.onWillDispose)(() => {
|
|
97
98
|
ref.dispose();
|
|
98
99
|
});
|
|
99
100
|
this._proxy.$acceptDirtyStateChanged(ref.object.resource, true);
|
|
@@ -6,7 +6,7 @@ import { extHostCustomer } from '../../services/extensions/common/extHostCustome
|
|
|
6
6
|
import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
7
|
import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
8
8
|
import { IWorkingCopyFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
9
|
-
import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-
|
|
9
|
+
import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-897bebad-39df-57cb-8a57-36a271d038be-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
|
|
10
10
|
|
|
11
11
|
class ExtHostNotebookDocumentSaveParticipant {
|
|
12
12
|
constructor(extHostContext) {
|
|
@@ -18,7 +18,7 @@ class ExtHostNotebookDocumentSaveParticipant {
|
|
|
18
18
|
}
|
|
19
19
|
let _warningTimeout;
|
|
20
20
|
const p = ( new Promise((resolve, reject) => {
|
|
21
|
-
_warningTimeout = setTimeout(() => reject(( new Error(( localize(
|
|
21
|
+
_warningTimeout = setTimeout(() => reject(( new Error(( localize(2412, "Aborted onWillSaveNotebookDocument-event after 1750ms"))))), 1750);
|
|
22
22
|
this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
|
|
23
23
|
clearTimeout(_warningTimeout);
|
|
24
24
|
return undefined;
|
|
@@ -69,11 +69,11 @@ let MainThreadOutputService = class MainThreadOutputService extends Disposable {
|
|
|
69
69
|
}
|
|
70
70
|
_showChannelQuietly(channel) {
|
|
71
71
|
const statusProperties = {
|
|
72
|
-
name: ( localize(
|
|
72
|
+
name: ( localize(2413, "Show Output")),
|
|
73
73
|
text: '$(output)',
|
|
74
|
-
ariaLabel: ( localize(
|
|
74
|
+
ariaLabel: ( localize(2414, "Show {0} Output Channel", channel.label)),
|
|
75
75
|
command: `workbench.action.output.show.${channel.id}`,
|
|
76
|
-
tooltip: ( localize(
|
|
76
|
+
tooltip: ( localize(2415, "Show {0} Output Channel", channel.label)),
|
|
77
77
|
kind: 'prominent'
|
|
78
78
|
};
|
|
79
79
|
if (!this._outputStatusItem.value) {
|
|
@@ -28,7 +28,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
28
28
|
location: ProgressLocation.Notification,
|
|
29
29
|
secondaryActions: [toAction({
|
|
30
30
|
id: extensionId,
|
|
31
|
-
label: ( localize(
|
|
31
|
+
label: ( localize(2416, "Manage Extension")),
|
|
32
32
|
run: () => this._commandService.executeCommand('_extensions.manage', extensionId)
|
|
33
33
|
})]
|
|
34
34
|
};
|
|
@@ -17,7 +17,7 @@ class ExtHostSaveParticipant {
|
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
19
|
const p = ( new Promise((resolve, reject) => {
|
|
20
|
-
setTimeout(() => reject(( new Error(( localize(
|
|
20
|
+
setTimeout(() => reject(( new Error(( localize(2417, "Aborted onWillSaveTextDocument-event after 1750ms"))))), 1750);
|
|
21
21
|
this._proxy.$participateInSave(editorModel.resource, context.reason).then(values => {
|
|
22
22
|
if (!values.every(success => success)) {
|
|
23
23
|
return Promise.reject(( new Error('listener failed')));
|
|
@@ -3,8 +3,21 @@ import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs
|
|
|
3
3
|
import { ITaskService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService.service";
|
|
4
4
|
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
5
5
|
import { MainThreadTaskShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
6
|
-
import { ITaskExecutionDTO, ITaskDTO, ITaskHandleDTO, ITaskFilterDTO, ITaskSystemInfoDTO } from "
|
|
6
|
+
import { ITaskExecutionDTO, ITaskDTO, ITaskHandleDTO, ITaskFilterDTO, ITaskSystemInfoDTO, ITaskProblemMatcherStarted, ITaskProblemMatcherEnded } from "../common/shared/tasks.js";
|
|
7
7
|
import { IConfigurationResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service";
|
|
8
|
+
export interface ITaskProblemMatcherStartedDto {
|
|
9
|
+
execution: ITaskExecutionDTO;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace TaskProblemMatcherStartedDto {
|
|
12
|
+
function from(value: ITaskProblemMatcherStarted): ITaskProblemMatcherStartedDto;
|
|
13
|
+
}
|
|
14
|
+
export interface ITaskProblemMatcherEndedDto {
|
|
15
|
+
execution: ITaskExecutionDTO;
|
|
16
|
+
hasErrors: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace TaskProblemMatcherEndedDto {
|
|
19
|
+
function from(value: ITaskProblemMatcherEnded): ITaskProblemMatcherEndedDto;
|
|
20
|
+
}
|
|
8
21
|
export declare class MainThreadTask extends Disposable implements MainThreadTaskShape {
|
|
9
22
|
private readonly _taskService;
|
|
10
23
|
private readonly _workspaceContextServer;
|
|
@@ -7,12 +7,14 @@ import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/typ
|
|
|
7
7
|
import { platform, Platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
8
8
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
9
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
10
|
-
import { TaskDefinition, PresentationOptions, RunOptions, CommandOptions, RuntimeType, TaskSourceKind, TaskScope, CustomTask, ContributedTask, ConfiguringTask
|
|
10
|
+
import { TaskDefinition, PresentationOptions, RunOptions, CommandOptions, RuntimeType, TaskSourceKind, TaskScope, CustomTask, ContributedTask, ConfiguringTask } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/tasks';
|
|
11
11
|
import { ITaskService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService.service';
|
|
12
12
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
13
13
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
14
|
+
import { TaskEventKind } from '../common/shared/tasks.js';
|
|
14
15
|
import { IConfigurationResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
|
|
15
16
|
import { ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
17
|
+
import { ConfigurationResolverExpression } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolverExpression';
|
|
16
18
|
|
|
17
19
|
var TaskExecutionDTO;
|
|
18
20
|
(function (TaskExecutionDTO) {
|
|
@@ -24,6 +26,31 @@ var TaskExecutionDTO;
|
|
|
24
26
|
}
|
|
25
27
|
TaskExecutionDTO.from = from;
|
|
26
28
|
})(TaskExecutionDTO || (TaskExecutionDTO = {}));
|
|
29
|
+
var TaskProblemMatcherStartedDto;
|
|
30
|
+
(function (TaskProblemMatcherStartedDto) {
|
|
31
|
+
function from(value) {
|
|
32
|
+
return {
|
|
33
|
+
execution: {
|
|
34
|
+
id: value.execution.id,
|
|
35
|
+
task: TaskDTO.from(value.execution.task)
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
TaskProblemMatcherStartedDto.from = from;
|
|
40
|
+
})(TaskProblemMatcherStartedDto || (TaskProblemMatcherStartedDto = {}));
|
|
41
|
+
var TaskProblemMatcherEndedDto;
|
|
42
|
+
(function (TaskProblemMatcherEndedDto) {
|
|
43
|
+
function from(value) {
|
|
44
|
+
return {
|
|
45
|
+
execution: {
|
|
46
|
+
id: value.execution.id,
|
|
47
|
+
task: TaskDTO.from(value.execution.task)
|
|
48
|
+
},
|
|
49
|
+
hasErrors: value.hasErrors
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
TaskProblemMatcherEndedDto.from = from;
|
|
53
|
+
})(TaskProblemMatcherEndedDto || (TaskProblemMatcherEndedDto = {}));
|
|
27
54
|
var TaskProcessStartedDTO;
|
|
28
55
|
(function (TaskProcessStartedDTO) {
|
|
29
56
|
function from(value, processId) {
|
|
@@ -378,7 +405,7 @@ var TaskDTO;
|
|
|
378
405
|
}
|
|
379
406
|
command.presentation = TaskPresentationOptionsDTO.to(task.presentationOptions);
|
|
380
407
|
const source = TaskSourceDTO.to(task.source, workspace);
|
|
381
|
-
const label = ( localize(
|
|
408
|
+
const label = ( localize(2418, '{0}: {1}', source.label, task.name));
|
|
382
409
|
const definition = TaskDefinitionDTO.to(task.definition, executeOnly);
|
|
383
410
|
const id = (CustomExecutionDTO.is(task.execution) && task._id) ? task._id : `${task.source.extensionId}.${definition._key}`;
|
|
384
411
|
const result = ( new ContributedTask(
|
|
@@ -437,11 +464,14 @@ let MainThreadTask = class MainThreadTask extends Disposable {
|
|
|
437
464
|
const execution = TaskExecutionDTO.from(task.getTaskExecution());
|
|
438
465
|
let resolvedDefinition = execution.task.definition;
|
|
439
466
|
if (execution.task?.execution && CustomExecutionDTO.is(execution.task.execution) && event.resolvedVariables) {
|
|
440
|
-
const
|
|
441
|
-
for (const
|
|
442
|
-
|
|
467
|
+
const expr = ConfigurationResolverExpression.parse(execution.task.definition);
|
|
468
|
+
for (const replacement of expr.unresolved()) {
|
|
469
|
+
const value = event.resolvedVariables.get(replacement.inner);
|
|
470
|
+
if (value !== undefined) {
|
|
471
|
+
expr.resolve(replacement, value);
|
|
472
|
+
}
|
|
443
473
|
}
|
|
444
|
-
resolvedDefinition = await this._configurationResolverService.
|
|
474
|
+
resolvedDefinition = await this._configurationResolverService.resolveAsync(task.getWorkspaceFolder(), expr);
|
|
445
475
|
}
|
|
446
476
|
this._proxy.$onDidStartTask(execution, event.terminalId, resolvedDefinition);
|
|
447
477
|
}
|
|
@@ -454,6 +484,15 @@ let MainThreadTask = class MainThreadTask extends Disposable {
|
|
|
454
484
|
else if (event.kind === TaskEventKind.End) {
|
|
455
485
|
this._proxy.$OnDidEndTask(TaskExecutionDTO.from(task.getTaskExecution()));
|
|
456
486
|
}
|
|
487
|
+
else if (event.kind === TaskEventKind.ProblemMatcherStarted) {
|
|
488
|
+
this._proxy.$onDidStartTaskProblemMatchers(TaskProblemMatcherStartedDto.from({ execution: task.getTaskExecution() }));
|
|
489
|
+
}
|
|
490
|
+
else if (event.kind === TaskEventKind.ProblemMatcherEnded) {
|
|
491
|
+
this._proxy.$onDidEndTaskProblemMatchers(TaskProblemMatcherEndedDto.from({ execution: task.getTaskExecution(), hasErrors: false }));
|
|
492
|
+
}
|
|
493
|
+
else if (event.kind === TaskEventKind.ProblemMatcherFoundErrors) {
|
|
494
|
+
this._proxy.$onDidEndTaskProblemMatchers(TaskProblemMatcherEndedDto.from({ execution: task.getTaskExecution(), hasErrors: true }));
|
|
495
|
+
}
|
|
457
496
|
}));
|
|
458
497
|
}
|
|
459
498
|
dispose() {
|
|
@@ -730,4 +769,4 @@ MainThreadTask = __decorate([
|
|
|
730
769
|
( __param(3, IConfigurationResolverService))
|
|
731
770
|
], MainThreadTask);
|
|
732
771
|
|
|
733
|
-
export { MainThreadTask };
|
|
772
|
+
export { MainThreadTask, TaskProblemMatcherEndedDto, TaskProblemMatcherStartedDto };
|
|
@@ -9,4 +9,5 @@ export declare class MainThreadTerminalShellIntegration extends Disposable imple
|
|
|
9
9
|
constructor(extHostContext: IExtHostContext, _terminalService: ITerminalService, workbenchEnvironmentService: IWorkbenchEnvironmentService);
|
|
10
10
|
$executeCommand(terminalId: number, commandLine: string): void;
|
|
11
11
|
private _convertCwdToUri;
|
|
12
|
+
private _enableShellIntegration;
|
|
12
13
|
}
|
|
@@ -22,20 +22,18 @@ let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegratio
|
|
|
22
22
|
}
|
|
23
23
|
}));
|
|
24
24
|
for (const terminal of this._terminalService.instances) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (cwdDetection) {
|
|
29
|
-
this._proxy.$cwdChange(terminal.instanceId, this._convertCwdToUri(cwdDetection.getCwd()));
|
|
30
|
-
}
|
|
25
|
+
const cmdDetection = terminal.capabilities.get(TerminalCapability.CommandDetection);
|
|
26
|
+
if (cmdDetection) {
|
|
27
|
+
this._enableShellIntegration(terminal);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
const onDidAddCommandDetection = this._store.add(this._terminalService.createOnInstanceEvent(instance => {
|
|
34
|
-
return ( Event.map(
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
return ( Event.map(
|
|
32
|
+
Event.filter(instance.capabilities.onDidAddCapabilityType, e => e === TerminalCapability.CommandDetection),
|
|
33
|
+
() => instance
|
|
34
|
+
));
|
|
37
35
|
})).event;
|
|
38
|
-
this._store.add(onDidAddCommandDetection(e => this.
|
|
36
|
+
this._store.add(onDidAddCommandDetection(e => this._enableShellIntegration(e)));
|
|
39
37
|
const cwdChangeEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TerminalCapability.CwdDetection, e => e.onDidChangeCwd));
|
|
40
38
|
this._store.add(cwdChangeEvent.event(e => {
|
|
41
39
|
this._proxy.$cwdChange(e.instance.instanceId, this._convertCwdToUri(e.data));
|
|
@@ -78,6 +76,13 @@ let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegratio
|
|
|
78
76
|
_convertCwdToUri(cwd) {
|
|
79
77
|
return cwd ? URI.file(cwd) : undefined;
|
|
80
78
|
}
|
|
79
|
+
_enableShellIntegration(instance) {
|
|
80
|
+
this._proxy.$shellIntegrationChange(instance.instanceId);
|
|
81
|
+
const cwdDetection = instance.capabilities.get(TerminalCapability.CwdDetection);
|
|
82
|
+
if (cwdDetection) {
|
|
83
|
+
this._proxy.$cwdChange(instance.instanceId, this._convertCwdToUri(cwdDetection.getCwd()));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
81
86
|
};
|
|
82
87
|
MainThreadTerminalShellIntegration = __decorate([
|
|
83
88
|
extHostNamedCustomer(MainContext.MainThreadTerminalShellIntegration),
|
|
@@ -112,13 +112,13 @@ let MainThreadTunnelService = class MainThreadTunnelService extends Disposable {
|
|
|
112
112
|
}
|
|
113
113
|
async elevationPrompt(tunnelOptions, tunnel, source) {
|
|
114
114
|
return this.notificationService.prompt(Severity.Info, ( localize(
|
|
115
|
-
|
|
115
|
+
2419,
|
|
116
116
|
"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",
|
|
117
117
|
source,
|
|
118
118
|
tunnelOptions.remoteAddress.port,
|
|
119
119
|
tunnelOptions.localAddressPort
|
|
120
120
|
)), [{
|
|
121
|
-
label: ( localize(
|
|
121
|
+
label: ( localize(2420, "Use Port {0} as Sudo...", tunnel.tunnelRemotePort)),
|
|
122
122
|
run: async () => {
|
|
123
123
|
this.elevateionRetry = true;
|
|
124
124
|
await this.remoteExplorerService.close({ host: tunnel.tunnelRemoteHost, port: tunnel.tunnelRemotePort }, TunnelCloseReason.Other);
|
|
@@ -10,7 +10,7 @@ import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/pla
|
|
|
10
10
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
11
11
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
12
12
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
13
|
-
import { defaultExternalUriOpenerId } from '@codingame/monaco-vscode-
|
|
13
|
+
import { defaultExternalUriOpenerId } from '@codingame/monaco-vscode-2a94c04a-b85b-5669-b06b-89c1bfa11cb9-common/vscode/vs/workbench/contrib/externalUriOpener/common/configuration';
|
|
14
14
|
import { ContributedExternalUriOpenersStore } from '../../contrib/externalUriOpener/common/contributedOpeners.js';
|
|
15
15
|
import { IExternalUriOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.service';
|
|
16
16
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
@@ -52,7 +52,7 @@ let MainThreadUriOpeners = class MainThreadUriOpeners extends Disposable {
|
|
|
52
52
|
}
|
|
53
53
|
catch (e) {
|
|
54
54
|
if (!isCancellationError(e)) {
|
|
55
|
-
const openDefaultAction = ( new Action('default', ( localize(
|
|
55
|
+
const openDefaultAction = ( new Action('default', ( localize(2421, "Open using default opener")), undefined, undefined, async () => {
|
|
56
56
|
await this.openerService.open(uri, {
|
|
57
57
|
allowTunneling: false,
|
|
58
58
|
allowContributedOpeners: defaultExternalUriOpenerId,
|
|
@@ -61,7 +61,7 @@ let MainThreadUriOpeners = class MainThreadUriOpeners extends Disposable {
|
|
|
61
61
|
openDefaultAction.tooltip = ( uri.toString());
|
|
62
62
|
this.notificationService.notify({
|
|
63
63
|
severity: Severity.Error,
|
|
64
|
-
message: ( localize(
|
|
64
|
+
message: ( localize(2422, 'Could not open uri with \'{0}\': {1}', id, (e.toString()))),
|
|
65
65
|
actions: {
|
|
66
66
|
primary: [
|
|
67
67
|
openDefaultAction
|
|
@@ -2,14 +2,16 @@ import { MainThreadUrlsShape } from "@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
2
2
|
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
3
3
|
import { IURLService } from "@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service";
|
|
4
4
|
import { URI, UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
5
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
5
6
|
import { IExtensionUrlHandler } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/browser/extensionUrlHandler.service";
|
|
6
7
|
import { ExtensionIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions";
|
|
7
|
-
|
|
8
|
+
import { ITrustedDomainService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomainService.service";
|
|
9
|
+
export declare class MainThreadUrls extends Disposable implements MainThreadUrlsShape {
|
|
8
10
|
private readonly urlService;
|
|
9
11
|
private readonly extensionUrlHandler;
|
|
10
12
|
private readonly proxy;
|
|
11
|
-
private handlers;
|
|
12
|
-
constructor(context: IExtHostContext, urlService: IURLService, extensionUrlHandler: IExtensionUrlHandler);
|
|
13
|
+
private readonly handlers;
|
|
14
|
+
constructor(context: IExtHostContext, trustedDomainService: ITrustedDomainService, urlService: IURLService, extensionUrlHandler: IExtensionUrlHandler);
|
|
13
15
|
$registerUriHandler(handle: number, extensionId: ExtensionIdentifier, extensionDisplayName: string): Promise<void>;
|
|
14
16
|
$unregisterUriHandler(handle: number): Promise<void>;
|
|
15
17
|
$createAppUri(uri: UriComponents): Promise<URI>;
|
|
@@ -3,8 +3,10 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
4
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
5
|
import { IURLService } from '@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
7
|
import { IExtensionUrlHandler } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/browser/extensionUrlHandler.service';
|
|
7
8
|
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
9
|
+
import { ITrustedDomainService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/browser/trustedDomainService.service';
|
|
8
10
|
|
|
9
11
|
class ExtensionUrlHandler {
|
|
10
12
|
constructor(proxy, handle, extensionId, extensionDisplayName) {
|
|
@@ -13,50 +15,54 @@ class ExtensionUrlHandler {
|
|
|
13
15
|
this.extensionId = extensionId;
|
|
14
16
|
this.extensionDisplayName = extensionDisplayName;
|
|
15
17
|
}
|
|
16
|
-
handleURL(uri, options) {
|
|
18
|
+
async handleURL(uri, options) {
|
|
17
19
|
if (!ExtensionIdentifier.equals(this.extensionId, uri.authority)) {
|
|
18
|
-
return
|
|
20
|
+
return false;
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
await this.proxy.$handleExternalUri(this.handle, uri);
|
|
23
|
+
return true;
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
|
-
let MainThreadUrls = class MainThreadUrls {
|
|
24
|
-
constructor(context, urlService, extensionUrlHandler) {
|
|
26
|
+
let MainThreadUrls = class MainThreadUrls extends Disposable {
|
|
27
|
+
constructor(context, trustedDomainService, urlService, extensionUrlHandler) {
|
|
28
|
+
super();
|
|
25
29
|
this.urlService = urlService;
|
|
26
30
|
this.extensionUrlHandler = extensionUrlHandler;
|
|
27
31
|
this.handlers = ( new Map());
|
|
28
32
|
this.proxy = ( context.getProxy(ExtHostContext.ExtHostUrls));
|
|
29
33
|
}
|
|
30
|
-
$registerUriHandler(handle, extensionId, extensionDisplayName) {
|
|
34
|
+
async $registerUriHandler(handle, extensionId, extensionDisplayName) {
|
|
31
35
|
const handler = ( new ExtensionUrlHandler(this.proxy, handle, extensionId, extensionDisplayName));
|
|
32
36
|
const disposable = this.urlService.registerHandler(handler);
|
|
33
37
|
this.handlers.set(handle, { extensionId, disposable });
|
|
34
38
|
this.extensionUrlHandler.registerExtensionHandler(extensionId, handler);
|
|
35
|
-
return
|
|
39
|
+
return undefined;
|
|
36
40
|
}
|
|
37
|
-
$unregisterUriHandler(handle) {
|
|
41
|
+
async $unregisterUriHandler(handle) {
|
|
38
42
|
const tuple = this.handlers.get(handle);
|
|
39
43
|
if (!tuple) {
|
|
40
|
-
return
|
|
44
|
+
return undefined;
|
|
41
45
|
}
|
|
42
46
|
const { extensionId, disposable } = tuple;
|
|
43
47
|
this.extensionUrlHandler.unregisterExtensionHandler(extensionId);
|
|
44
48
|
this.handlers.delete(handle);
|
|
45
49
|
disposable.dispose();
|
|
46
|
-
return
|
|
50
|
+
return undefined;
|
|
47
51
|
}
|
|
48
52
|
async $createAppUri(uri) {
|
|
49
53
|
return this.urlService.create(uri);
|
|
50
54
|
}
|
|
51
55
|
dispose() {
|
|
56
|
+
super.dispose();
|
|
52
57
|
this.handlers.forEach(({ disposable }) => disposable.dispose());
|
|
53
58
|
this.handlers.clear();
|
|
54
59
|
}
|
|
55
60
|
};
|
|
56
61
|
MainThreadUrls = __decorate([
|
|
57
62
|
extHostNamedCustomer(MainContext.MainThreadUrls),
|
|
58
|
-
( __param(1,
|
|
59
|
-
( __param(2,
|
|
63
|
+
( __param(1, ITrustedDomainService)),
|
|
64
|
+
( __param(2, IURLService)),
|
|
65
|
+
( __param(3, IExtensionUrlHandler))
|
|
60
66
|
], MainThreadUrls);
|
|
61
67
|
|
|
62
68
|
export { MainThreadUrls };
|
|
@@ -96,7 +96,8 @@ let MainThreadWebviewPanels = class MainThreadWebviewPanels extends Disposable {
|
|
|
96
96
|
addWebviewInput(handle, input, options) {
|
|
97
97
|
this._webviewInputs.add(handle, input);
|
|
98
98
|
this._mainThreadWebviews.addWebview(handle, input.webview, options);
|
|
99
|
-
input.webview.onDidDispose(() => {
|
|
99
|
+
const disposeSub = input.webview.onDidDispose(() => {
|
|
100
|
+
disposeSub.dispose();
|
|
100
101
|
this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => {
|
|
101
102
|
this._webviewInputs.delete(handle);
|
|
102
103
|
});
|
|
@@ -104,7 +104,7 @@ let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
|
104
104
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
105
105
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none';">
|
|
106
106
|
</head>
|
|
107
|
-
<body>${( localize(
|
|
107
|
+
<body>${( localize(2423, "An error occurred while loading view: {0}", escape(viewType)))}</body>
|
|
108
108
|
</html>`;
|
|
109
109
|
}
|
|
110
110
|
};
|