@codingame/monaco-vscode-api 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +1 -1
- package/assets/continue-tb.png +0 -0
- package/assets/pause-tb.png +0 -0
- package/assets/restart-tb.png +0 -0
- package/assets/run-with-debugging-tb.png +0 -0
- package/assets/stepinto-tb.png +0 -0
- package/assets/stepout-tb.png +0 -0
- package/assets/stepover-tb.png +0 -0
- package/assets/stop-tb.png +0 -0
- package/contributions.js +2 -0
- package/missing-services.js +17 -2
- package/package.json +8 -8
- package/service-override/tools/editorAssets.js +3 -0
- package/services.d.ts +6 -3
- package/services.js +17 -3
- package/vscode/src/vs/base/common/lifecycle.js +158 -1
- package/vscode/src/vs/base/common/observableInternal/autorun.js +3 -1
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +267 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebookDocument.js +1 -11
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +703 -0
- package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +300 -0
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +83 -0
- package/vscode/src/vs/workbench/browser/dnd.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +323 -8
- package/vscode/src/vs/workbench/common/contributions.d.ts +44 -1
- package/vscode/src/vs/workbench/common/contributions.js +8 -1
- package/vscode/src/vs/workbench/common/views.js +1 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/media/all.png.js +11 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.editorPane.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/logs/common/defaultLogLevels.js +140 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceIdentityService.js +102 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -430
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -510
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
1
2
|
import { Emitter } from '../../../base/common/event.js';
|
|
3
|
+
import { IConfigurationService } from '../../configuration/common/configuration.js';
|
|
2
4
|
import { createDecorator } from '../../instantiation/common/instantiation.js';
|
|
5
|
+
import { ILogService } from '../../log/common/log.js';
|
|
3
6
|
const ITunnelService = ( createDecorator('tunnelService'));
|
|
4
7
|
var TunnelProtocol;
|
|
5
8
|
( (function(TunnelProtocol) {
|
|
@@ -12,6 +15,9 @@ var TunnelPrivacyId;
|
|
|
12
15
|
TunnelPrivacyId["Private"] = "private";
|
|
13
16
|
TunnelPrivacyId["Public"] = "public";
|
|
14
17
|
})(TunnelPrivacyId || (TunnelPrivacyId = {})));
|
|
18
|
+
function isTunnelProvider(addressOrTunnelProvider) {
|
|
19
|
+
return !!addressOrTunnelProvider.forwardPort;
|
|
20
|
+
}
|
|
15
21
|
var ProvidedOnAutoForward;
|
|
16
22
|
( (function(ProvidedOnAutoForward) {
|
|
17
23
|
ProvidedOnAutoForward[ProvidedOnAutoForward["Notify"] = 1] = "Notify";
|
|
@@ -55,4 +61,264 @@ class DisposableTunnel {
|
|
|
55
61
|
return this._dispose();
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
|
|
64
|
+
let AbstractTunnelService = class AbstractTunnelService {
|
|
65
|
+
constructor(logService, configurationService) {
|
|
66
|
+
this.logService = logService;
|
|
67
|
+
this.configurationService = configurationService;
|
|
68
|
+
this._onTunnelOpened = ( new Emitter());
|
|
69
|
+
this.onTunnelOpened = this._onTunnelOpened.event;
|
|
70
|
+
this._onTunnelClosed = ( new Emitter());
|
|
71
|
+
this.onTunnelClosed = this._onTunnelClosed.event;
|
|
72
|
+
this._onAddedTunnelProvider = ( new Emitter());
|
|
73
|
+
this.onAddedTunnelProvider = this._onAddedTunnelProvider.event;
|
|
74
|
+
this._tunnels = ( new Map());
|
|
75
|
+
this._canElevate = false;
|
|
76
|
+
this._canChangeProtocol = true;
|
|
77
|
+
this._privacyOptions = [];
|
|
78
|
+
this._factoryInProgress = ( new Set());
|
|
79
|
+
}
|
|
80
|
+
get hasTunnelProvider() {
|
|
81
|
+
return !!this._tunnelProvider;
|
|
82
|
+
}
|
|
83
|
+
get defaultTunnelHost() {
|
|
84
|
+
const settingValue = this.configurationService.getValue('remote.localPortHost');
|
|
85
|
+
return (!settingValue || settingValue === 'localhost') ? '127.0.0.1' : '0.0.0.0';
|
|
86
|
+
}
|
|
87
|
+
setTunnelProvider(provider) {
|
|
88
|
+
this._tunnelProvider = provider;
|
|
89
|
+
if (!provider) {
|
|
90
|
+
this._canElevate = false;
|
|
91
|
+
this._privacyOptions = [];
|
|
92
|
+
this._onAddedTunnelProvider.fire();
|
|
93
|
+
return {
|
|
94
|
+
dispose: () => { }
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
this._onAddedTunnelProvider.fire();
|
|
98
|
+
return {
|
|
99
|
+
dispose: () => {
|
|
100
|
+
this._tunnelProvider = undefined;
|
|
101
|
+
this._canElevate = false;
|
|
102
|
+
this._privacyOptions = [];
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
setTunnelFeatures(features) {
|
|
107
|
+
this._canElevate = features.elevation;
|
|
108
|
+
this._privacyOptions = features.privacyOptions;
|
|
109
|
+
this._canChangeProtocol = features.protocol;
|
|
110
|
+
}
|
|
111
|
+
get canChangeProtocol() {
|
|
112
|
+
return this._canChangeProtocol;
|
|
113
|
+
}
|
|
114
|
+
get canElevate() {
|
|
115
|
+
return this._canElevate;
|
|
116
|
+
}
|
|
117
|
+
get canChangePrivacy() {
|
|
118
|
+
return this._privacyOptions.length > 0;
|
|
119
|
+
}
|
|
120
|
+
get privacyOptions() {
|
|
121
|
+
return this._privacyOptions;
|
|
122
|
+
}
|
|
123
|
+
get tunnels() {
|
|
124
|
+
return this.getTunnels();
|
|
125
|
+
}
|
|
126
|
+
async getTunnels() {
|
|
127
|
+
const tunnels = [];
|
|
128
|
+
const tunnelArray = Array.from(( this._tunnels.values()));
|
|
129
|
+
for (const portMap of tunnelArray) {
|
|
130
|
+
const portArray = Array.from(( portMap.values()));
|
|
131
|
+
for (const x of portArray) {
|
|
132
|
+
const tunnelValue = await x.value;
|
|
133
|
+
if (tunnelValue && (typeof tunnelValue !== 'string')) {
|
|
134
|
+
tunnels.push(tunnelValue);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return tunnels;
|
|
139
|
+
}
|
|
140
|
+
async dispose() {
|
|
141
|
+
for (const portMap of ( this._tunnels.values())) {
|
|
142
|
+
for (const { value } of ( portMap.values())) {
|
|
143
|
+
await value.then(tunnel => typeof tunnel !== 'string' ? tunnel?.dispose() : undefined);
|
|
144
|
+
}
|
|
145
|
+
portMap.clear();
|
|
146
|
+
}
|
|
147
|
+
this._tunnels.clear();
|
|
148
|
+
}
|
|
149
|
+
setEnvironmentTunnel(remoteHost, remotePort, localAddress, privacy, protocol) {
|
|
150
|
+
this.addTunnelToMap(remoteHost, remotePort, Promise.resolve({
|
|
151
|
+
tunnelRemoteHost: remoteHost,
|
|
152
|
+
tunnelRemotePort: remotePort,
|
|
153
|
+
localAddress,
|
|
154
|
+
privacy,
|
|
155
|
+
protocol,
|
|
156
|
+
dispose: () => Promise.resolve()
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
async getExistingTunnel(remoteHost, remotePort) {
|
|
160
|
+
if (isAllInterfaces(remoteHost) || isLocalhost(remoteHost)) {
|
|
161
|
+
remoteHost = LOCALHOST_ADDRESSES[0];
|
|
162
|
+
}
|
|
163
|
+
const existing = this.getTunnelFromMap(remoteHost, remotePort);
|
|
164
|
+
if (existing) {
|
|
165
|
+
++existing.refcount;
|
|
166
|
+
return existing.value;
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
openTunnel(addressProvider, remoteHost, remotePort, localHost, localPort, elevateIfNeeded = false, privacy, protocol) {
|
|
171
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${remoteHost}:${remotePort} on local port ${localPort}.`);
|
|
172
|
+
const addressOrTunnelProvider = this._tunnelProvider ?? addressProvider;
|
|
173
|
+
if (!addressOrTunnelProvider) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
if (!remoteHost) {
|
|
177
|
+
remoteHost = 'localhost';
|
|
178
|
+
}
|
|
179
|
+
if (!localHost) {
|
|
180
|
+
localHost = this.defaultTunnelHost;
|
|
181
|
+
}
|
|
182
|
+
if (this._tunnelProvider && ( this._factoryInProgress.has(remotePort))) {
|
|
183
|
+
this.logService.debug(`ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const resolvedTunnel = this.retainOrCreateTunnel(addressOrTunnelProvider, remoteHost, remotePort, localHost, localPort, elevateIfNeeded, privacy, protocol);
|
|
187
|
+
if (!resolvedTunnel) {
|
|
188
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel was not created.`);
|
|
189
|
+
return resolvedTunnel;
|
|
190
|
+
}
|
|
191
|
+
return resolvedTunnel.then(tunnel => {
|
|
192
|
+
if (!tunnel) {
|
|
193
|
+
this.logService.trace('ForwardedPorts: (TunnelService) New tunnel is undefined.');
|
|
194
|
+
this.removeEmptyOrErrorTunnelFromMap(remoteHost, remotePort);
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
else if (typeof tunnel === 'string') {
|
|
198
|
+
this.logService.trace('ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel.');
|
|
199
|
+
this.removeEmptyOrErrorTunnelFromMap(remoteHost, remotePort);
|
|
200
|
+
return tunnel;
|
|
201
|
+
}
|
|
202
|
+
this.logService.trace('ForwardedPorts: (TunnelService) New tunnel established.');
|
|
203
|
+
const newTunnel = this.makeTunnel(tunnel);
|
|
204
|
+
if (tunnel.tunnelRemoteHost !== remoteHost || tunnel.tunnelRemotePort !== remotePort) {
|
|
205
|
+
this.logService.warn('ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch.');
|
|
206
|
+
}
|
|
207
|
+
if (privacy && tunnel.privacy !== privacy) {
|
|
208
|
+
this.logService.warn('ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch.');
|
|
209
|
+
}
|
|
210
|
+
this._onTunnelOpened.fire(newTunnel);
|
|
211
|
+
return newTunnel;
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
makeTunnel(tunnel) {
|
|
215
|
+
return {
|
|
216
|
+
tunnelRemotePort: tunnel.tunnelRemotePort,
|
|
217
|
+
tunnelRemoteHost: tunnel.tunnelRemoteHost,
|
|
218
|
+
tunnelLocalPort: tunnel.tunnelLocalPort,
|
|
219
|
+
localAddress: tunnel.localAddress,
|
|
220
|
+
privacy: tunnel.privacy,
|
|
221
|
+
protocol: tunnel.protocol,
|
|
222
|
+
dispose: async () => {
|
|
223
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${tunnel.tunnelRemoteHost}:${tunnel.tunnelRemotePort} `);
|
|
224
|
+
const existingHost = this._tunnels.get(tunnel.tunnelRemoteHost);
|
|
225
|
+
if (existingHost) {
|
|
226
|
+
const existing = existingHost.get(tunnel.tunnelRemotePort);
|
|
227
|
+
if (existing) {
|
|
228
|
+
existing.refcount--;
|
|
229
|
+
await this.tryDisposeTunnel(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort, existing);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
async tryDisposeTunnel(remoteHost, remotePort, tunnel) {
|
|
236
|
+
if (tunnel.refcount <= 0) {
|
|
237
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${remoteHost}:${remotePort}.`);
|
|
238
|
+
const disposePromise = tunnel.value.then(async (tunnel) => {
|
|
239
|
+
if (tunnel && (typeof tunnel !== 'string')) {
|
|
240
|
+
await tunnel.dispose(true);
|
|
241
|
+
this._onTunnelClosed.fire({ host: tunnel.tunnelRemoteHost, port: tunnel.tunnelRemotePort });
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
if (( this._tunnels.has(remoteHost))) {
|
|
245
|
+
this._tunnels.get(remoteHost).delete(remotePort);
|
|
246
|
+
}
|
|
247
|
+
return disposePromise;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
async closeTunnel(remoteHost, remotePort) {
|
|
251
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${remoteHost}:${remotePort} `);
|
|
252
|
+
const portMap = this._tunnels.get(remoteHost);
|
|
253
|
+
if (portMap && ( portMap.has(remotePort))) {
|
|
254
|
+
const value = portMap.get(remotePort);
|
|
255
|
+
value.refcount = 0;
|
|
256
|
+
await this.tryDisposeTunnel(remoteHost, remotePort, value);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
addTunnelToMap(remoteHost, remotePort, tunnel) {
|
|
260
|
+
if (!( this._tunnels.has(remoteHost))) {
|
|
261
|
+
this._tunnels.set(remoteHost, ( new Map()));
|
|
262
|
+
}
|
|
263
|
+
this._tunnels.get(remoteHost).set(remotePort, { refcount: 1, value: tunnel });
|
|
264
|
+
}
|
|
265
|
+
async removeEmptyOrErrorTunnelFromMap(remoteHost, remotePort) {
|
|
266
|
+
const hostMap = this._tunnels.get(remoteHost);
|
|
267
|
+
if (hostMap) {
|
|
268
|
+
const tunnel = hostMap.get(remotePort);
|
|
269
|
+
const tunnelResult = tunnel ? await tunnel.value : undefined;
|
|
270
|
+
if (!tunnelResult || (typeof tunnelResult === 'string')) {
|
|
271
|
+
hostMap.delete(remotePort);
|
|
272
|
+
}
|
|
273
|
+
if (hostMap.size === 0) {
|
|
274
|
+
this._tunnels.delete(remoteHost);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
getTunnelFromMap(remoteHost, remotePort) {
|
|
279
|
+
const hosts = [remoteHost];
|
|
280
|
+
if (isLocalhost(remoteHost)) {
|
|
281
|
+
hosts.push(...LOCALHOST_ADDRESSES);
|
|
282
|
+
hosts.push(...ALL_INTERFACES_ADDRESSES);
|
|
283
|
+
}
|
|
284
|
+
else if (isAllInterfaces(remoteHost)) {
|
|
285
|
+
hosts.push(...ALL_INTERFACES_ADDRESSES);
|
|
286
|
+
}
|
|
287
|
+
const existingPortMaps = ( hosts.map(host => this._tunnels.get(host)));
|
|
288
|
+
for (const map of existingPortMaps) {
|
|
289
|
+
const existingTunnel = map?.get(remotePort);
|
|
290
|
+
if (existingTunnel) {
|
|
291
|
+
return existingTunnel;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
canTunnel(uri) {
|
|
297
|
+
return !!extractLocalHostUriMetaDataForPortMapping(uri);
|
|
298
|
+
}
|
|
299
|
+
createWithProvider(tunnelProvider, remoteHost, remotePort, localPort, elevateIfNeeded, privacy, protocol) {
|
|
300
|
+
this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${remoteHost}:${remotePort} on local port ${localPort}.`);
|
|
301
|
+
const key = remotePort;
|
|
302
|
+
this._factoryInProgress.add(key);
|
|
303
|
+
const preferredLocalPort = localPort === undefined ? remotePort : localPort;
|
|
304
|
+
const creationInfo = { elevationRequired: elevateIfNeeded ? this.isPortPrivileged(preferredLocalPort) : false };
|
|
305
|
+
const tunnelOptions = { remoteAddress: { host: remoteHost, port: remotePort }, localAddressPort: localPort, privacy, public: privacy ? (privacy !== TunnelPrivacyId.Private) : undefined, protocol };
|
|
306
|
+
const tunnel = tunnelProvider.forwardPort(tunnelOptions, creationInfo);
|
|
307
|
+
if (tunnel) {
|
|
308
|
+
this.addTunnelToMap(remoteHost, remotePort, tunnel);
|
|
309
|
+
tunnel.finally(() => {
|
|
310
|
+
this.logService.trace('ForwardedPorts: (TunnelService) Tunnel created by provider.');
|
|
311
|
+
this._factoryInProgress.delete(key);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
this._factoryInProgress.delete(key);
|
|
316
|
+
}
|
|
317
|
+
return tunnel;
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
AbstractTunnelService = ( __decorate([
|
|
321
|
+
( __param(0, ILogService)),
|
|
322
|
+
( __param(1, IConfigurationService))
|
|
323
|
+
], AbstractTunnelService));
|
|
324
|
+
export { ALL_INTERFACES_ADDRESSES, AbstractTunnelService, DisposableTunnel, ITunnelService, LOCALHOST_ADDRESSES, ProvidedOnAutoForward, TunnelPrivacyId, TunnelProtocol, extractLocalHostUriMetaDataForPortMapping, isAllInterfaces, isLocalhost, isTunnelProvider };
|
|
@@ -529,7 +529,7 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
529
529
|
const interalSelector = LanguageSelector.from(selector);
|
|
530
530
|
let notebook;
|
|
531
531
|
if (targetsNotebooks(interalSelector)) {
|
|
532
|
-
notebook = extHostNotebook.notebookDocuments.find(value =>
|
|
532
|
+
notebook = extHostNotebook.notebookDocuments.find(value => value.apiNotebook.getCells().find(c => c.document === document))?.apiNotebook;
|
|
533
533
|
}
|
|
534
534
|
return score(interalSelector, document.uri, document.languageId, true, notebook?.uri, notebook?.notebookType);
|
|
535
535
|
},
|
|
@@ -2,7 +2,7 @@ import { Schemas } from '../../../base/common/network.js';
|
|
|
2
2
|
import { URI } from '../../../base/common/uri.js';
|
|
3
3
|
import { NotebookCellOutput, NotebookCellExecutionSummary, NotebookCellKind, NotebookCellOutputItem } from './extHostTypeConverters.js';
|
|
4
4
|
import { NotebookRange } from './extHostTypes.js';
|
|
5
|
-
import { isTextStreamMime, compressOutputItemStreams, NotebookCellsChangeType
|
|
5
|
+
import { isTextStreamMime, compressOutputItemStreams, NotebookCellsChangeType } from '../../contrib/notebook/common/notebookCommon.js';
|
|
6
6
|
class RawContentChangeEvent {
|
|
7
7
|
constructor(start, deletedCount, deletedItems, items) {
|
|
8
8
|
this.start = start;
|
|
@@ -357,16 +357,6 @@ class ExtHostNotebookDocument {
|
|
|
357
357
|
return this._cells[index];
|
|
358
358
|
}
|
|
359
359
|
getCell(cellHandle) {
|
|
360
|
-
if (URI.isUri(cellHandle)) {
|
|
361
|
-
const data = CellUri.parse(cellHandle);
|
|
362
|
-
if (!data) {
|
|
363
|
-
return undefined;
|
|
364
|
-
}
|
|
365
|
-
if (( data.notebook.toString()) !== ( this.uri.toString())) {
|
|
366
|
-
return undefined;
|
|
367
|
-
}
|
|
368
|
-
cellHandle = data.handle;
|
|
369
|
-
}
|
|
370
360
|
return this._cells.find(cell => cell.handle === cellHandle);
|
|
371
361
|
}
|
|
372
362
|
getCellIndex(cell) {
|