@codingame/monaco-vscode-extensions-service-override 38.1.3 → 39.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 +1 -0
- package/package.json +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -1
- package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.d.ts +1 -1
- package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +5 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +33 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.d.ts +19 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.js +57 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +13 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.d.ts +0 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +1 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.d.ts +2 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +9 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +8 -0
- 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/mainThreadGitExtensionService.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +7 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadGitHub.d.ts +36 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadGitHub.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +9 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +9 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +7 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.d.ts +4 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +46 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +12 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.d.ts +9 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +49 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +6 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +7 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/git/common/gitService.d.ts +12 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +13 -13
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +2 -1
- 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 +3 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +1 -0
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
- package/vscode/src/vs/workbench/api/common/shared/tasks.d.ts +0 -158
- package/vscode/src/vs/workbench/api/common/shared/tasks.js +0 -20
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
+
import { Disposable, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
|
+
import { parse, SchemaError } from '@codingame/monaco-vscode-api/vscode/vs/platform/github/common/client/schema';
|
|
8
|
+
import { withGitHubCredentialDeadline } from '@codingame/monaco-vscode-api/vscode/vs/platform/github/common/githubCredentialService';
|
|
9
|
+
import { RequestError } from '@codingame/monaco-vscode-api/vscode/vs/platform/github/common/types';
|
|
10
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
11
|
+
import { IAuthenticationAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationAccessService.service';
|
|
12
|
+
import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
13
|
+
import { extHostNamedCustomer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extHostCustomers';
|
|
14
|
+
import { IWorkbenchGitHubService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/github/common/githubService.service';
|
|
15
|
+
import { MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
16
|
+
|
|
17
|
+
const gitHubProviderId = "github";
|
|
18
|
+
class GitHubOperationError extends Error {
|
|
19
|
+
constructor(code, message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.code = code;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
let MainThreadGitHub = class MainThreadGitHub extends Disposable {
|
|
25
|
+
constructor(
|
|
26
|
+
_extHostContext,
|
|
27
|
+
_gitHubService,
|
|
28
|
+
_authenticationService,
|
|
29
|
+
_authenticationAccessService,
|
|
30
|
+
_logService
|
|
31
|
+
) {
|
|
32
|
+
super();
|
|
33
|
+
this._gitHubService = _gitHubService;
|
|
34
|
+
this._authenticationService = _authenticationService;
|
|
35
|
+
this._authenticationAccessService = _authenticationAccessService;
|
|
36
|
+
this._logService = _logService;
|
|
37
|
+
this._clients = ( new Map());
|
|
38
|
+
this._register(this._authenticationService.onDidUnregisterAuthenticationProvider((
|
|
39
|
+
{
|
|
40
|
+
id
|
|
41
|
+
}
|
|
42
|
+
) => {
|
|
43
|
+
if (id === gitHubProviderId) {
|
|
44
|
+
for (const entry of ( this._clients.values())) {
|
|
45
|
+
if (entry.sessionId !== undefined) {
|
|
46
|
+
this._invalidate(entry);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
this._register(this._authenticationAccessService.onDidChangeExtensionSessionAccess((
|
|
52
|
+
{
|
|
53
|
+
providerId,
|
|
54
|
+
accountName
|
|
55
|
+
}
|
|
56
|
+
) => {
|
|
57
|
+
if (providerId !== gitHubProviderId) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
for (const entry of ( this._clients.values())) {
|
|
61
|
+
if (entry.accountLabel === accountName && !this._hasAccess(entry)) {
|
|
62
|
+
this._invalidate(entry);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
this._register(toDisposable(() => {
|
|
67
|
+
for (const handle of [...( this._clients.keys())]) {
|
|
68
|
+
this.$releaseClient(handle);
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
async $getClient(handle, extensionId, sessionId, token) {
|
|
73
|
+
return this._acquire(handle, extensionId, sessionId, token, async (entry, signal) => {
|
|
74
|
+
const session = await this._resolveSession(extensionId, sessionId, signal);
|
|
75
|
+
signal.throwIfAborted();
|
|
76
|
+
entry.accountLabel = session.account.label;
|
|
77
|
+
return this._gitHubService.acquireAccountApiClient({
|
|
78
|
+
providerId: gitHubProviderId,
|
|
79
|
+
sessionId: session.id,
|
|
80
|
+
accountId: session.account.id,
|
|
81
|
+
scopes: [...session.scopes],
|
|
82
|
+
authorizationServer: session.authorizationServer?.toString()
|
|
83
|
+
}, signal);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async $getAnonymousClient(handle, extensionId, token) {
|
|
87
|
+
return this._acquire(
|
|
88
|
+
handle,
|
|
89
|
+
extensionId,
|
|
90
|
+
undefined,
|
|
91
|
+
token,
|
|
92
|
+
(_entry, signal) => this._gitHubService.acquireAnonymousApiClient(signal)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
$releaseClient(handle) {
|
|
96
|
+
const entry = this._clients.get(handle);
|
|
97
|
+
if (entry) {
|
|
98
|
+
this._clients.delete(handle);
|
|
99
|
+
entry.lifetime.abort();
|
|
100
|
+
entry.store.dispose();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async $getGist(handle, gistId, token) {
|
|
104
|
+
return this._run(handle, token, async (entry, client, signal) => {
|
|
105
|
+
if (typeof gistId !== "string" || !gistId) {
|
|
106
|
+
throw ( new GitHubOperationError("validation", ( localize(7818, "A gist identifier is required."))));
|
|
107
|
+
}
|
|
108
|
+
return toGistDto(await client.gist.get(gistId, signal, this._requestOptions(entry)));
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async $createGist(handle, gist, token) {
|
|
112
|
+
return this._run(handle, token, async (entry, client, signal) => {
|
|
113
|
+
if (entry.accountLabel === undefined || !isAccountClient(client)) {
|
|
114
|
+
throw ( new GitHubOperationError("authentication", ( localize(7819, "Creating a gist requires a client bound to a GitHub session."))));
|
|
115
|
+
}
|
|
116
|
+
const request = validateCreateGist(gist);
|
|
117
|
+
return toGistDto(await client.gist.create(request, signal, this._requestOptions(entry)));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async _acquire(handle, extensionId, sessionId, token, acquire) {
|
|
121
|
+
if (this._store.isDisposed || ( this._clients.has(handle))) {
|
|
122
|
+
return {
|
|
123
|
+
kind: "error",
|
|
124
|
+
error: {
|
|
125
|
+
code: "unknown",
|
|
126
|
+
message: ( localize(7820, "The GitHub client could not be created."))
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const entry = {
|
|
131
|
+
extensionId,
|
|
132
|
+
sessionId,
|
|
133
|
+
lifetime: ( new AbortController()),
|
|
134
|
+
store: ( new DisposableStore())
|
|
135
|
+
};
|
|
136
|
+
this._clients.set(handle, entry);
|
|
137
|
+
const signal = this._createSignal(entry, token);
|
|
138
|
+
try {
|
|
139
|
+
const client = await acquire(entry, signal.signal);
|
|
140
|
+
if (this._clients.get(handle) !== entry || signal.signal.aborted) {
|
|
141
|
+
client.dispose();
|
|
142
|
+
this._release(handle, entry);
|
|
143
|
+
return entry.invalidated ? {
|
|
144
|
+
kind: "error",
|
|
145
|
+
error: sessionUnavailableError()
|
|
146
|
+
} : {
|
|
147
|
+
kind: "canceled"
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
entry.client = entry.store.add(client);
|
|
151
|
+
if (isAccountClient(client)) {
|
|
152
|
+
entry.store.add(client.onDidInvalidate(() => this._invalidate(entry)));
|
|
153
|
+
}
|
|
154
|
+
if (!this._hasAccess(entry)) {
|
|
155
|
+
this._invalidate(entry);
|
|
156
|
+
}
|
|
157
|
+
signal.signal.throwIfAborted();
|
|
158
|
+
return {
|
|
159
|
+
kind: "ok",
|
|
160
|
+
value: undefined
|
|
161
|
+
};
|
|
162
|
+
} catch (error) {
|
|
163
|
+
const failure = entry.invalidated ? {
|
|
164
|
+
kind: "error",
|
|
165
|
+
error: sessionUnavailableError()
|
|
166
|
+
} : this._toFailure(error, signal.signal);
|
|
167
|
+
this._release(handle, entry);
|
|
168
|
+
return failure;
|
|
169
|
+
} finally {
|
|
170
|
+
signal.dispose();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
_release(handle, entry) {
|
|
174
|
+
if (this._clients.get(handle) === entry) {
|
|
175
|
+
this.$releaseClient(handle);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async _run(handle, token, operation) {
|
|
179
|
+
const entry = this._clients.get(handle);
|
|
180
|
+
if (!entry?.client) {
|
|
181
|
+
return {
|
|
182
|
+
kind: "error",
|
|
183
|
+
error: {
|
|
184
|
+
code: "disposed",
|
|
185
|
+
message: ( localize(7821, "The GitHub client has been disposed."))
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (entry.invalidated || !this._hasAccess(entry)) {
|
|
190
|
+
this._invalidate(entry);
|
|
191
|
+
return {
|
|
192
|
+
kind: "error",
|
|
193
|
+
error: sessionUnavailableError()
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const signal = this._createSignal(entry, token);
|
|
197
|
+
try {
|
|
198
|
+
return {
|
|
199
|
+
kind: "ok",
|
|
200
|
+
value: await operation(entry, entry.client, signal.signal)
|
|
201
|
+
};
|
|
202
|
+
} catch (error) {
|
|
203
|
+
if (entry.invalidated) {
|
|
204
|
+
return {
|
|
205
|
+
kind: "error",
|
|
206
|
+
error: sessionUnavailableError()
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (entry.lifetime.signal.aborted && !token.isCancellationRequested) {
|
|
210
|
+
return {
|
|
211
|
+
kind: "error",
|
|
212
|
+
error: {
|
|
213
|
+
code: "disposed",
|
|
214
|
+
message: ( localize(7821, "The GitHub client has been disposed."))
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return this._toFailure(error, signal.signal);
|
|
219
|
+
} finally {
|
|
220
|
+
signal.dispose();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async _resolveSession(extensionId, sessionId, signal) {
|
|
224
|
+
if (typeof sessionId !== "string" || !sessionId) {
|
|
225
|
+
throw ( new GitHubOperationError("authentication", sessionUnavailableError().message));
|
|
226
|
+
}
|
|
227
|
+
let sessions;
|
|
228
|
+
try {
|
|
229
|
+
sessions = await withGitHubCredentialDeadline(
|
|
230
|
+
signal,
|
|
231
|
+
() => this._authenticationService.getSessions(gitHubProviderId, undefined, {
|
|
232
|
+
silent: true
|
|
233
|
+
}, true)
|
|
234
|
+
);
|
|
235
|
+
} catch (error) {
|
|
236
|
+
if (signal.aborted || isCancellationError(error) || error instanceof RequestError && error.kind === "timeout") {
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
this._logService.trace("[MainThreadGitHub] Could not list GitHub sessions", error);
|
|
240
|
+
throw ( new GitHubOperationError("authentication", sessionUnavailableError().message));
|
|
241
|
+
}
|
|
242
|
+
const session = sessions.find(candidate => candidate.id === sessionId);
|
|
243
|
+
if (!session || this._authenticationAccessService.isAccessAllowed(gitHubProviderId, session.account.label, extensionId) !== true) {
|
|
244
|
+
throw ( new GitHubOperationError("authentication", sessionUnavailableError().message));
|
|
245
|
+
}
|
|
246
|
+
return session;
|
|
247
|
+
}
|
|
248
|
+
_hasAccess(entry) {
|
|
249
|
+
return entry.sessionId === undefined || entry.accountLabel !== undefined && this._authenticationAccessService.isAccessAllowed(gitHubProviderId, entry.accountLabel, entry.extensionId) === true;
|
|
250
|
+
}
|
|
251
|
+
_invalidate(entry) {
|
|
252
|
+
if (!entry.invalidated) {
|
|
253
|
+
entry.invalidated = true;
|
|
254
|
+
entry.lifetime.abort();
|
|
255
|
+
entry.store.clear();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
_createSignal(entry, token) {
|
|
259
|
+
const store = ( new DisposableStore());
|
|
260
|
+
return {
|
|
261
|
+
signal: AbortSignal.any([CancellationToken.toAbortSignal(token, store), entry.lifetime.signal]),
|
|
262
|
+
dispose: () => store.dispose()
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
_requestOptions(entry) {
|
|
266
|
+
return {
|
|
267
|
+
caller: `extension.${entry.extensionId}`
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
_toFailure(error, signal) {
|
|
271
|
+
if (signal.aborted || isCancellationError(error)) {
|
|
272
|
+
return {
|
|
273
|
+
kind: "canceled"
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
if (error instanceof GitHubOperationError) {
|
|
277
|
+
return {
|
|
278
|
+
kind: "error",
|
|
279
|
+
error: {
|
|
280
|
+
code: error.code,
|
|
281
|
+
message: error.message
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
if (error instanceof RequestError) {
|
|
286
|
+
return {
|
|
287
|
+
kind: "error",
|
|
288
|
+
error: {
|
|
289
|
+
code: toErrorCode(error.kind),
|
|
290
|
+
message: error.message,
|
|
291
|
+
status: error.statusCode
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
this._logService.error("[MainThreadGitHub] Unexpected GitHub client failure", error);
|
|
296
|
+
return {
|
|
297
|
+
kind: "error",
|
|
298
|
+
error: {
|
|
299
|
+
code: "unknown",
|
|
300
|
+
message: ( localize(7822, "The GitHub request failed."))
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
MainThreadGitHub = __decorate([extHostNamedCustomer(MainContext.MainThreadGitHub), ( __param(1, IWorkbenchGitHubService)), ( __param(2, IAuthenticationService)), ( __param(3, IAuthenticationAccessService)), ( __param(4, ILogService))], MainThreadGitHub);
|
|
306
|
+
function isAccountClient(client) {
|
|
307
|
+
return "authorization" in client;
|
|
308
|
+
}
|
|
309
|
+
function sessionUnavailableError() {
|
|
310
|
+
return {
|
|
311
|
+
code: "authentication",
|
|
312
|
+
message: ( localize(7823, "The selected GitHub session is not available to this extension."))
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function toErrorCode(kind) {
|
|
316
|
+
switch (kind) {
|
|
317
|
+
case "authentication":
|
|
318
|
+
case "authorization":
|
|
319
|
+
case "notFound":
|
|
320
|
+
case "validation":
|
|
321
|
+
case "rateLimit":
|
|
322
|
+
case "network":
|
|
323
|
+
case "timeout":
|
|
324
|
+
case "server":
|
|
325
|
+
return kind;
|
|
326
|
+
case "overloaded":
|
|
327
|
+
return "rateLimit";
|
|
328
|
+
case "schema":
|
|
329
|
+
case "malformedResponse":
|
|
330
|
+
case "responseTooLarge":
|
|
331
|
+
return "invalidResponse";
|
|
332
|
+
default:
|
|
333
|
+
return "unknown";
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const parseCreateGist = parse.copyObject({
|
|
337
|
+
public: parse.optional(parse.boolean, false),
|
|
338
|
+
files: parse.refine(parse.dictionary(parse.copyObject({
|
|
339
|
+
content: parse.string
|
|
340
|
+
})), files => {
|
|
341
|
+
const names = ( Object.keys(files));
|
|
342
|
+
return names.length > 0 && names.every(name => name.trim().length > 0 && !/[\\/]/.test(name));
|
|
343
|
+
}, ( localize(
|
|
344
|
+
7824,
|
|
345
|
+
"A gist must contain at least one file with non-empty names and no path separators."
|
|
346
|
+
)))
|
|
347
|
+
});
|
|
348
|
+
function validateCreateGist(gist) {
|
|
349
|
+
try {
|
|
350
|
+
return parseCreateGist(gist);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
if (error instanceof SchemaError) {
|
|
353
|
+
throw ( new GitHubOperationError("validation", ( localize(7825, "Invalid gist request: {0}", error.message))));
|
|
354
|
+
}
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function toGistDto(gist) {
|
|
359
|
+
return {
|
|
360
|
+
id: gist.id,
|
|
361
|
+
htmlUrl: gist.html_url,
|
|
362
|
+
files: ( Object.values(gist.files)).map(file => ({
|
|
363
|
+
content: file.content,
|
|
364
|
+
isBinary: file.encoding === "base64",
|
|
365
|
+
truncated: file.truncated
|
|
366
|
+
}))
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export { MainThreadGitHub };
|
|
@@ -80,6 +80,7 @@ export declare class MainThreadLanguageFeatures extends Disposable implements Ma
|
|
|
80
80
|
private static _reviveIndentationRule;
|
|
81
81
|
private static _reviveOnEnterRule;
|
|
82
82
|
private static _reviveOnEnterRules;
|
|
83
|
+
private static _reviveAutoClosingPairs;
|
|
83
84
|
$setLanguageConfiguration(handle: number, languageId: string, _configuration: ILanguageConfigurationDto): void;
|
|
84
85
|
$registerTypeHierarchyProvider(handle: number, selector: IDocumentFilterDto[]): void;
|
|
85
86
|
private readonly _documentOnDropEditProviders;
|
|
@@ -880,6 +880,14 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
880
880
|
static _reviveOnEnterRules(onEnterRules) {
|
|
881
881
|
return onEnterRules.map(MainThreadLanguageFeatures_1._reviveOnEnterRule);
|
|
882
882
|
}
|
|
883
|
+
static _reviveAutoClosingPairs(autoClosingPairs) {
|
|
884
|
+
return autoClosingPairs.map(autoClosingPair => ({
|
|
885
|
+
open: autoClosingPair.open,
|
|
886
|
+
close: autoClosingPair.close,
|
|
887
|
+
notIn: autoClosingPair.notIn,
|
|
888
|
+
beforeText: autoClosingPair.beforeText ? MainThreadLanguageFeatures_1._reviveRegExp(autoClosingPair.beforeText) : undefined
|
|
889
|
+
}));
|
|
890
|
+
}
|
|
883
891
|
$setLanguageConfiguration(handle, languageId, _configuration) {
|
|
884
892
|
const configuration = {
|
|
885
893
|
comments: _configuration.comments,
|
|
@@ -892,7 +900,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
892
900
|
__electricCharacterSupport: undefined
|
|
893
901
|
};
|
|
894
902
|
if (_configuration.autoClosingPairs) {
|
|
895
|
-
configuration.autoClosingPairs = _configuration.autoClosingPairs;
|
|
903
|
+
configuration.autoClosingPairs = MainThreadLanguageFeatures_1._reviveAutoClosingPairs(_configuration.autoClosingPairs);
|
|
896
904
|
} else if (_configuration.__characterPairSupport) {
|
|
897
905
|
configuration.autoClosingPairs = _configuration.__characterPairSupport.autoClosingPairs;
|
|
898
906
|
}
|
|
@@ -70,20 +70,20 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
70
70
|
sourceIsUrgent = MainThreadMessageService_1.URGENT_NOTIFICATION_SOURCES.includes(source.id);
|
|
71
71
|
}
|
|
72
72
|
if (!source) {
|
|
73
|
-
source = ( localize(
|
|
73
|
+
source = ( localize(7842, "Extension"));
|
|
74
74
|
}
|
|
75
75
|
const secondaryActions = [];
|
|
76
76
|
if (options.source) {
|
|
77
77
|
secondaryActions.push(withNotificationActionTelemetry(toAction({
|
|
78
78
|
id: options.source.identifier.value,
|
|
79
|
-
label: ( localize(
|
|
79
|
+
label: ( localize(7843, "Manage Extension")),
|
|
80
80
|
run: () => {
|
|
81
81
|
return this._commandService.executeCommand("_extensions.manage", options.source.identifier.value);
|
|
82
82
|
}
|
|
83
83
|
}), NotificationActionTelemetryId.ManageExtension));
|
|
84
84
|
}
|
|
85
85
|
const messageHandle = this._notificationService.notify({
|
|
86
|
-
telemetry: extensionNotificationTelemetry(options.source?.identifier.value, "message"),
|
|
86
|
+
telemetry: extensionNotificationTelemetry(options.source?.identifier.value, "message", options.notificationId),
|
|
87
87
|
severity,
|
|
88
88
|
message,
|
|
89
89
|
legacyExtensionLinkParsing,
|
|
@@ -117,12 +117,12 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
117
117
|
if (!cancelButton) {
|
|
118
118
|
if (buttons.length > 0) {
|
|
119
119
|
cancelButton = {
|
|
120
|
-
label: ( localize(
|
|
120
|
+
label: ( localize(7844, "Cancel")),
|
|
121
121
|
run: () => undefined
|
|
122
122
|
};
|
|
123
123
|
} else {
|
|
124
124
|
cancelButton = {
|
|
125
|
-
label: ( localize(
|
|
125
|
+
label: ( localize(7845, "&&OK")),
|
|
126
126
|
run: () => undefined
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -94,11 +94,11 @@ let MainThreadOutputService = class MainThreadOutputService extends Disposable {
|
|
|
94
94
|
}
|
|
95
95
|
_showChannelQuietly(channel) {
|
|
96
96
|
const statusProperties = {
|
|
97
|
-
name: ( localize(
|
|
97
|
+
name: ( localize(7847, "Show Output")),
|
|
98
98
|
text: "$(output)",
|
|
99
|
-
ariaLabel: ( localize(
|
|
99
|
+
ariaLabel: ( localize(7848, "Show {0} Output Channel", channel.label)),
|
|
100
100
|
command: `workbench.action.output.show.${channel.id}`,
|
|
101
|
-
tooltip: ( localize(
|
|
101
|
+
tooltip: ( localize(7849, "Show {0} Output Channel", channel.label)),
|
|
102
102
|
kind: "prominent"
|
|
103
103
|
};
|
|
104
104
|
if (!this._outputStatusItem.value) {
|
|
@@ -35,7 +35,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
35
35
|
let progressOptions = {
|
|
36
36
|
...options,
|
|
37
37
|
legacyExtensionLinkParsing,
|
|
38
|
-
telemetry: options.telemetryId ?? extensionNotificationTelemetry(extensionId, "progress")
|
|
38
|
+
telemetry: options.telemetryId ?? extensionNotificationTelemetry(extensionId, "progress", options.notificationId)
|
|
39
39
|
};
|
|
40
40
|
if (options.location === ProgressLocation.Notification && extensionId) {
|
|
41
41
|
const sourceIsUrgent = MainThreadProgress_1.URGENT_PROGRESS_SOURCES.includes(extensionId);
|
|
@@ -45,7 +45,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
45
45
|
location: ProgressLocation.Notification,
|
|
46
46
|
secondaryActions: [withNotificationActionTelemetry(toAction({
|
|
47
47
|
id: extensionId,
|
|
48
|
-
label: ( localize(
|
|
48
|
+
label: ( localize(7850, "Manage Extension")),
|
|
49
49
|
run: () => this._commandService.executeCommand("_extensions.manage", extensionId)
|
|
50
50
|
}), NotificationActionTelemetryId.ManageExtension)]
|
|
51
51
|
};
|
|
@@ -38,7 +38,7 @@ let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
|
38
38
|
session.store.dispose();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
$show(instance, options, token) {
|
|
41
|
+
async $show(instance, options, token) {
|
|
42
42
|
const contents = ( new Promise((resolve, reject) => {
|
|
43
43
|
this._items[instance] = {
|
|
44
44
|
resolve,
|
|
@@ -53,20 +53,22 @@ let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
try {
|
|
57
|
+
if (options.canPickMany) {
|
|
58
|
+
const items = await this._quickInputService.pick(contents, options, token);
|
|
58
59
|
if (items) {
|
|
59
60
|
return items.map(item => item.handle);
|
|
60
61
|
}
|
|
61
62
|
return undefined;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return this._quickInputService.pick(contents, options, token).then(item => {
|
|
63
|
+
} else {
|
|
64
|
+
const item = await this._quickInputService.pick(contents, options, token);
|
|
65
65
|
if (item) {
|
|
66
66
|
return item.handle;
|
|
67
67
|
}
|
|
68
68
|
return undefined;
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
|
+
} finally {
|
|
71
|
+
delete this._items[instance];
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
$setItems(instance, items) {
|
|
@@ -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(7851, "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")));
|
|
@@ -13,6 +13,7 @@ export declare class MainThreadSpeech implements MainThreadSpeechShape {
|
|
|
13
13
|
private readonly keywordRecognitionSessions;
|
|
14
14
|
constructor(extHostContext: IExtHostContext, speechService: ISpeechService, logService: ILogService);
|
|
15
15
|
$registerProvider(handle: number, identifier: string, metadata: ISpeechProviderMetadata): void;
|
|
16
|
+
$registerVoiceLiveSessionProvider(handle: number, identifier: string, metadata: ISpeechProviderMetadata): void;
|
|
16
17
|
$unregisterProvider(handle: number): void;
|
|
17
18
|
$emitSpeechToTextEvent(session: number, event: ISpeechToTextEvent): void;
|
|
18
19
|
$emitTextToSpeechEvent(session: number, event: ITextToSpeechEvent): void;
|
|
@@ -110,6 +110,13 @@ let MainThreadSpeech = class MainThreadSpeech {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
$registerVoiceLiveSessionProvider(handle, identifier, metadata) {
|
|
114
|
+
const registration = this.speechService.registerVoiceLiveSessionProvider(identifier, {
|
|
115
|
+
metadata,
|
|
116
|
+
createVoiceLiveSession: (sdp, token) => this.proxy.$createVoiceLiveSession(handle, sdp, token)
|
|
117
|
+
});
|
|
118
|
+
this.providerRegistrations.set(handle, registration);
|
|
119
|
+
}
|
|
113
120
|
$unregisterProvider(handle) {
|
|
114
121
|
const registration = this.providerRegistrations.get(handle);
|
|
115
122
|
if (registration) {
|
|
@@ -3,7 +3,7 @@ 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 "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extHostCustomers";
|
|
5
5
|
import { MainThreadTaskShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
6
|
-
import { ITaskExecutionDTO, ITaskDTO, ITaskHandleDTO, ITaskFilterDTO, ITaskSystemInfoDTO, ITaskProblemMatcherStarted, ITaskProblemMatcherEnded } from "
|
|
6
|
+
import { ITaskExecutionDTO, ITaskDTO, ITaskHandleDTO, ITaskFilterDTO, ITaskSystemInfoDTO, ITaskProblemMatcherStarted, ITaskProblemMatcherEnded } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/shared/tasks";
|
|
7
7
|
import { IConfigurationResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service";
|
|
8
8
|
export interface ITaskProblemMatcherStartedDto {
|
|
9
9
|
execution: ITaskExecutionDTO;
|
|
@@ -25,7 +25,10 @@ export declare class MainThreadTask extends Disposable implements MainThreadTask
|
|
|
25
25
|
private readonly _extHostContext;
|
|
26
26
|
private readonly _proxy;
|
|
27
27
|
private readonly _providers;
|
|
28
|
+
private readonly _taskStarts;
|
|
28
29
|
constructor(extHostContext: IExtHostContext, _taskService: ITaskService, _workspaceContextServer: IWorkspaceContextService, _configurationResolverService: IConfigurationResolverService);
|
|
30
|
+
private reserveCustomExecution;
|
|
31
|
+
private endCustomExecution;
|
|
29
32
|
dispose(): void;
|
|
30
33
|
$createTaskId(taskDTO: ITaskDTO): Promise<string>;
|
|
31
34
|
$registerTaskProvider(handle: number, type: string): Promise<void>;
|