@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,45 +1,60 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { localizeWithPath } from '../../../nls.js';
|
|
3
3
|
import { ActionBar } from '../../../base/browser/ui/actionbar/actionbar.js';
|
|
4
|
-
import { GLOBAL_ACTIVITY_ID } from '../../common/activity.js';
|
|
4
|
+
import { GLOBAL_ACTIVITY_ID, ACCOUNTS_ACTIVITY_ID } from '../../common/activity.js';
|
|
5
5
|
import { NumberBadge, IActivityService } from '../../services/activity/common/activity.js';
|
|
6
6
|
import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js';
|
|
7
7
|
import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js';
|
|
8
8
|
import { IThemeService } from '../../../platform/theme/common/themeService.js';
|
|
9
|
+
import { IStorageService } from '../../../platform/storage/common/storage.js';
|
|
10
|
+
import { IExtensionService } from '../../services/extensions/common/extensions.js';
|
|
9
11
|
import { CompositeBarAction, CompositeBarActionViewItem } from './compositeBarActions.js';
|
|
10
12
|
import { Codicon } from '../../../base/common/codicons.js';
|
|
11
13
|
import { ThemeIcon } from '../../../base/common/themables.js';
|
|
12
14
|
import { registerIcon } from '../../../platform/theme/common/iconRegistry.js';
|
|
13
|
-
import { Action } from '../../../base/common/actions.js';
|
|
15
|
+
import { Action, toAction, Separator, SubmenuAction } from '../../../base/common/actions.js';
|
|
14
16
|
import { MenuId, IMenuService } from '../../../platform/actions/common/actions.js';
|
|
15
|
-
import { append, $, clearNode, hide, show, addDisposableListener, EventHelper, EventType
|
|
17
|
+
import { runWhenWindowIdle, getWindow, append, $, clearNode, hide, show, addDisposableListener, EventHelper, EventType } from '../../../base/browser/dom.js';
|
|
16
18
|
import { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';
|
|
17
19
|
import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';
|
|
18
20
|
import { EventType as EventType$1 } from '../../../base/browser/touch.js';
|
|
21
|
+
import { Lazy } from '../../../base/common/lazy.js';
|
|
19
22
|
import { createAndFillInActionBarActions } from '../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
20
23
|
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
|
|
21
24
|
import { IContextKeyService } from '../../../platform/contextkey/common/contextkey.js';
|
|
22
25
|
import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js';
|
|
23
26
|
import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js';
|
|
27
|
+
import { ILogService } from '../../../platform/log/common/log.js';
|
|
28
|
+
import { IProductService } from '../../../platform/product/common/productService.js';
|
|
29
|
+
import { ISecretStorageService } from '../../../platform/secrets/common/secrets.js';
|
|
30
|
+
import { getCurrentAuthenticationSessionInfo } from '../../services/authentication/browser/authenticationService.js';
|
|
31
|
+
import { IAuthenticationService } from '../../services/authentication/common/authentication.js';
|
|
24
32
|
import { IWorkbenchEnvironmentService } from '../../services/environment/common/environmentService.js';
|
|
25
33
|
import { IHoverService } from '../../../platform/hover/browser/hover.js';
|
|
34
|
+
import { ILifecycleService } from '../../services/lifecycle/common/lifecycle.js';
|
|
26
35
|
import { IUserDataProfileService } from '../../services/userDataProfile/common/userDataProfile.js';
|
|
27
36
|
import { DEFAULT_ICON } from '../../services/userDataProfile/common/userDataProfileIcons.js';
|
|
28
37
|
import { isString } from '../../../base/common/types.js';
|
|
29
38
|
import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND } from '../../common/theme.js';
|
|
39
|
+
var GlobalCompositeBar_1;
|
|
30
40
|
let GlobalCompositeBar = class GlobalCompositeBar extends Disposable {
|
|
41
|
+
static { GlobalCompositeBar_1 = this; }
|
|
42
|
+
static { this.ACCOUNTS_ACTION_INDEX = 0; }
|
|
31
43
|
static { this.ACCOUNTS_ICON = registerIcon('accounts-view-bar-icon', Codicon.account, ( localizeWithPath(
|
|
32
44
|
'vs/workbench/browser/parts/globalCompositeBar',
|
|
33
45
|
'accountsViewBarIcon',
|
|
34
46
|
"Accounts icon in the view bar."
|
|
35
47
|
))); }
|
|
36
|
-
constructor(contextMenuActionsProvider, colors, activityHoverOptions, configurationService, instantiationService) {
|
|
48
|
+
constructor(contextMenuActionsProvider, colors, activityHoverOptions, configurationService, instantiationService, storageService, extensionService) {
|
|
37
49
|
super();
|
|
38
50
|
this.contextMenuActionsProvider = contextMenuActionsProvider;
|
|
39
51
|
this.colors = colors;
|
|
40
52
|
this.activityHoverOptions = activityHoverOptions;
|
|
41
53
|
this.instantiationService = instantiationService;
|
|
54
|
+
this.storageService = storageService;
|
|
55
|
+
this.extensionService = extensionService;
|
|
42
56
|
this.globalActivityAction = this._register(( new Action(GLOBAL_ACTIVITY_ID)));
|
|
57
|
+
this.accountAction = this._register(( new Action(ACCOUNTS_ACTIVITY_ID)));
|
|
43
58
|
this.element = document.createElement('div');
|
|
44
59
|
const contextMenuAlignmentOptions = () => ({
|
|
45
60
|
anchorAlignment: configurationService.getValue('workbench.sideBar.location') === 'left' ? 1 : 0 ,
|
|
@@ -50,13 +65,39 @@ let GlobalCompositeBar = class GlobalCompositeBar extends Disposable {
|
|
|
50
65
|
if (action.id === GLOBAL_ACTIVITY_ID) {
|
|
51
66
|
return this.instantiationService.createInstance(GlobalActivityActionViewItem, this.contextMenuActionsProvider, { colors: this.colors, hoverOptions: this.activityHoverOptions }, contextMenuAlignmentOptions);
|
|
52
67
|
}
|
|
68
|
+
if (action.id === ACCOUNTS_ACTIVITY_ID) {
|
|
69
|
+
return this.instantiationService.createInstance(AccountsActivityActionViewItem, this.contextMenuActionsProvider, {
|
|
70
|
+
colors: this.colors,
|
|
71
|
+
hoverOptions: this.activityHoverOptions
|
|
72
|
+
}, contextMenuAlignmentOptions, (actions) => {
|
|
73
|
+
actions.unshift(...[
|
|
74
|
+
toAction({ id: 'hideAccounts', label: ( localizeWithPath(
|
|
75
|
+
'vs/workbench/browser/parts/globalCompositeBar',
|
|
76
|
+
'hideAccounts',
|
|
77
|
+
"Hide Accounts"
|
|
78
|
+
)), run: () => this.storageService.store(AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, false, 0 , 0 ) }),
|
|
79
|
+
( new Separator())
|
|
80
|
+
]);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
53
83
|
throw new Error(`No view item for action '${action.id}'`);
|
|
54
84
|
},
|
|
55
85
|
orientation: 1 ,
|
|
56
86
|
ariaLabel: ( localizeWithPath('vs/workbench/browser/parts/globalCompositeBar', 'manage', "Manage")),
|
|
57
87
|
preventLoopNavigation: true
|
|
58
88
|
})));
|
|
89
|
+
if (this.accountsVisibilityPreference) {
|
|
90
|
+
this.globalActivityActionBar.push(this.accountAction, { index: GlobalCompositeBar_1.ACCOUNTS_ACTION_INDEX });
|
|
91
|
+
}
|
|
59
92
|
this.globalActivityActionBar.push(this.globalActivityAction);
|
|
93
|
+
this.registerListeners();
|
|
94
|
+
}
|
|
95
|
+
registerListeners() {
|
|
96
|
+
this.extensionService.whenInstalledExtensionsRegistered().then(() => {
|
|
97
|
+
if (!this._store.isDisposed) {
|
|
98
|
+
this._register(this.storageService.onDidChangeValue(0 , AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, this._store)(() => this.toggleAccountsActivity()));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
60
101
|
}
|
|
61
102
|
create(parent) {
|
|
62
103
|
parent.appendChild(this.element);
|
|
@@ -68,12 +109,31 @@ let GlobalCompositeBar = class GlobalCompositeBar extends Disposable {
|
|
|
68
109
|
return this.globalActivityActionBar.viewItems.length;
|
|
69
110
|
}
|
|
70
111
|
getContextMenuActions() {
|
|
71
|
-
return [];
|
|
112
|
+
return [toAction({ id: 'toggleAccountsVisibility', label: ( localizeWithPath('vs/workbench/browser/parts/globalCompositeBar', 'accounts', "Accounts")), checked: this.accountsVisibilityPreference, run: () => this.accountsVisibilityPreference = !this.accountsVisibilityPreference })];
|
|
113
|
+
}
|
|
114
|
+
toggleAccountsActivity() {
|
|
115
|
+
if (this.globalActivityActionBar.length() === 2 && this.accountsVisibilityPreference) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (this.globalActivityActionBar.length() === 2) {
|
|
119
|
+
this.globalActivityActionBar.pull(GlobalCompositeBar_1.ACCOUNTS_ACTION_INDEX);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this.globalActivityActionBar.push(this.accountAction, { index: GlobalCompositeBar_1.ACCOUNTS_ACTION_INDEX });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
get accountsVisibilityPreference() {
|
|
126
|
+
return this.storageService.getBoolean(AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, 0 , true);
|
|
127
|
+
}
|
|
128
|
+
set accountsVisibilityPreference(value) {
|
|
129
|
+
this.storageService.store(AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, value, 0 , 0 );
|
|
72
130
|
}
|
|
73
131
|
};
|
|
74
|
-
GlobalCompositeBar = ( __decorate([
|
|
132
|
+
GlobalCompositeBar = GlobalCompositeBar_1 = ( __decorate([
|
|
75
133
|
( __param(3, IConfigurationService)),
|
|
76
|
-
( __param(4, IInstantiationService))
|
|
134
|
+
( __param(4, IInstantiationService)),
|
|
135
|
+
( __param(5, IStorageService)),
|
|
136
|
+
( __param(6, IExtensionService))
|
|
77
137
|
], GlobalCompositeBar));
|
|
78
138
|
let AbstractGlobalActivityActionViewItem = class AbstractGlobalActivityActionViewItem extends CompositeBarActionViewItem {
|
|
79
139
|
constructor(menuId, action, options, contextMenuActionsProvider, contextMenuAlignmentOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, keybindingService, activityService) {
|
|
@@ -182,6 +242,231 @@ AbstractGlobalActivityActionViewItem = ( __decorate([
|
|
|
182
242
|
( __param(11, IKeybindingService)),
|
|
183
243
|
( __param(12, IActivityService))
|
|
184
244
|
], AbstractGlobalActivityActionViewItem));
|
|
245
|
+
let AccountsActivityActionViewItem = class AccountsActivityActionViewItem extends AbstractGlobalActivityActionViewItem {
|
|
246
|
+
static { this.ACCOUNTS_VISIBILITY_PREFERENCE_KEY = 'workbench.activity.showAccounts'; }
|
|
247
|
+
constructor(contextMenuActionsProvider, options, contextMenuAlignmentOptions, fillContextMenuActions, themeService, lifecycleService, hoverService, contextMenuService, menuService, contextKeyService, authenticationService, environmentService, productService, configurationService, keybindingService, secretStorageService, logService, activityService, instantiationService) {
|
|
248
|
+
const action = instantiationService.createInstance(CompositeBarAction, {
|
|
249
|
+
id: ACCOUNTS_ACTIVITY_ID,
|
|
250
|
+
name: ( localizeWithPath('vs/workbench/browser/parts/globalCompositeBar', 'accounts', "Accounts")),
|
|
251
|
+
classNames: ThemeIcon.asClassNameArray(GlobalCompositeBar.ACCOUNTS_ICON)
|
|
252
|
+
});
|
|
253
|
+
super(MenuId.AccountsContext, action, options, contextMenuActionsProvider, contextMenuAlignmentOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, keybindingService, activityService);
|
|
254
|
+
this.fillContextMenuActions = fillContextMenuActions;
|
|
255
|
+
this.lifecycleService = lifecycleService;
|
|
256
|
+
this.authenticationService = authenticationService;
|
|
257
|
+
this.productService = productService;
|
|
258
|
+
this.secretStorageService = secretStorageService;
|
|
259
|
+
this.logService = logService;
|
|
260
|
+
this.groupedAccounts = ( new Map());
|
|
261
|
+
this.problematicProviders = ( new Set());
|
|
262
|
+
this.initialized = false;
|
|
263
|
+
this.sessionFromEmbedder = ( new Lazy(
|
|
264
|
+
() => getCurrentAuthenticationSessionInfo(this.secretStorageService, this.productService)
|
|
265
|
+
));
|
|
266
|
+
this._register(action);
|
|
267
|
+
this.registerListeners();
|
|
268
|
+
this.initialize();
|
|
269
|
+
}
|
|
270
|
+
registerListeners() {
|
|
271
|
+
this._register(this.authenticationService.onDidRegisterAuthenticationProvider(async (e) => {
|
|
272
|
+
await this.addAccountsFromProvider(e.id);
|
|
273
|
+
}));
|
|
274
|
+
this._register(this.authenticationService.onDidUnregisterAuthenticationProvider((e) => {
|
|
275
|
+
this.groupedAccounts.delete(e.id);
|
|
276
|
+
this.problematicProviders.delete(e.id);
|
|
277
|
+
}));
|
|
278
|
+
this._register(this.authenticationService.onDidChangeSessions(async (e) => {
|
|
279
|
+
for (const changed of [...(e.event.changed ?? []), ...(e.event.added ?? [])]) {
|
|
280
|
+
try {
|
|
281
|
+
await this.addOrUpdateAccount(e.providerId, changed.account);
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
this.logService.error(e);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (e.event.removed) {
|
|
288
|
+
for (const removed of e.event.removed) {
|
|
289
|
+
this.removeAccount(e.providerId, removed.account);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}));
|
|
293
|
+
}
|
|
294
|
+
async initialize() {
|
|
295
|
+
await this.lifecycleService.when(3 );
|
|
296
|
+
if (this._store.isDisposed) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const disposable = this._register(runWhenWindowIdle(getWindow(this.element), async () => {
|
|
300
|
+
await this.doInitialize();
|
|
301
|
+
disposable.dispose();
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
async doInitialize() {
|
|
305
|
+
const providerIds = this.authenticationService.getProviderIds();
|
|
306
|
+
const results = await Promise.allSettled(( providerIds.map(providerId => this.addAccountsFromProvider(providerId))));
|
|
307
|
+
for (const result of results) {
|
|
308
|
+
if (result.status === 'rejected') {
|
|
309
|
+
this.logService.error(result.reason);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
this.initialized = true;
|
|
313
|
+
}
|
|
314
|
+
async resolveMainMenuActions(accountsMenu, disposables) {
|
|
315
|
+
await super.resolveMainMenuActions(accountsMenu, disposables);
|
|
316
|
+
const providers = this.authenticationService.getProviderIds();
|
|
317
|
+
const otherCommands = accountsMenu.getActions();
|
|
318
|
+
let menus = [];
|
|
319
|
+
for (const providerId of providers) {
|
|
320
|
+
if (!this.initialized) {
|
|
321
|
+
const noAccountsAvailableAction = disposables.add(( new Action('noAccountsAvailable', ( localizeWithPath('vs/workbench/browser/parts/globalCompositeBar', 'loading', "Loading...")), undefined, false)));
|
|
322
|
+
menus.push(noAccountsAvailableAction);
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
const providerLabel = this.authenticationService.getLabel(providerId);
|
|
326
|
+
const accounts = this.groupedAccounts.get(providerId);
|
|
327
|
+
if (!accounts) {
|
|
328
|
+
if (( this.problematicProviders.has(providerId))) {
|
|
329
|
+
const providerUnavailableAction = disposables.add(( new Action('providerUnavailable', ( localizeWithPath(
|
|
330
|
+
'vs/workbench/browser/parts/globalCompositeBar',
|
|
331
|
+
'authProviderUnavailable',
|
|
332
|
+
'{0} is currently unavailable',
|
|
333
|
+
providerLabel
|
|
334
|
+
)), undefined, false)));
|
|
335
|
+
menus.push(providerUnavailableAction);
|
|
336
|
+
try {
|
|
337
|
+
await this.addAccountsFromProvider(providerId);
|
|
338
|
+
}
|
|
339
|
+
catch (e) {
|
|
340
|
+
this.logService.error(e);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
for (const account of accounts) {
|
|
346
|
+
const manageExtensionsAction = disposables.add(( new Action(`configureSessions${account.label}`, ( localizeWithPath(
|
|
347
|
+
'vs/workbench/browser/parts/globalCompositeBar',
|
|
348
|
+
'manageTrustedExtensions',
|
|
349
|
+
"Manage Trusted Extensions"
|
|
350
|
+
)), undefined, true, () => {
|
|
351
|
+
return this.authenticationService.manageTrustedExtensionsForAccount(providerId, account.label);
|
|
352
|
+
})));
|
|
353
|
+
const providerSubMenuActions = [manageExtensionsAction];
|
|
354
|
+
if (account.canSignOut) {
|
|
355
|
+
const signOutAction = disposables.add(( new Action('signOut', ( localizeWithPath('vs/workbench/browser/parts/globalCompositeBar', 'signOut', "Sign Out")), undefined, true, async () => {
|
|
356
|
+
const allSessions = await this.authenticationService.getSessions(providerId);
|
|
357
|
+
const sessionsForAccount = allSessions.filter(s => s.account.label === account.label);
|
|
358
|
+
return await this.authenticationService.removeAccountSessions(providerId, account.label, sessionsForAccount);
|
|
359
|
+
})));
|
|
360
|
+
providerSubMenuActions.push(signOutAction);
|
|
361
|
+
}
|
|
362
|
+
const providerSubMenu = ( new SubmenuAction(
|
|
363
|
+
'activitybar.submenu',
|
|
364
|
+
`${account.label} (${providerLabel})`,
|
|
365
|
+
providerSubMenuActions
|
|
366
|
+
));
|
|
367
|
+
menus.push(providerSubMenu);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (providers.length && !menus.length) {
|
|
371
|
+
const noAccountsAvailableAction = disposables.add(( new Action('noAccountsAvailable', ( localizeWithPath(
|
|
372
|
+
'vs/workbench/browser/parts/globalCompositeBar',
|
|
373
|
+
'noAccounts',
|
|
374
|
+
"You are not signed in to any accounts"
|
|
375
|
+
)), undefined, false)));
|
|
376
|
+
menus.push(noAccountsAvailableAction);
|
|
377
|
+
}
|
|
378
|
+
if (menus.length && otherCommands.length) {
|
|
379
|
+
menus.push(( new Separator()));
|
|
380
|
+
}
|
|
381
|
+
otherCommands.forEach((group, i) => {
|
|
382
|
+
const actions = group[1];
|
|
383
|
+
menus = menus.concat(actions);
|
|
384
|
+
if (i !== otherCommands.length - 1) {
|
|
385
|
+
menus.push(( new Separator()));
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
return menus;
|
|
389
|
+
}
|
|
390
|
+
async resolveContextMenuActions(disposables) {
|
|
391
|
+
const actions = await super.resolveContextMenuActions(disposables);
|
|
392
|
+
this.fillContextMenuActions(actions);
|
|
393
|
+
return actions;
|
|
394
|
+
}
|
|
395
|
+
async addOrUpdateAccount(providerId, account) {
|
|
396
|
+
let accounts = this.groupedAccounts.get(providerId);
|
|
397
|
+
if (!accounts) {
|
|
398
|
+
accounts = [];
|
|
399
|
+
this.groupedAccounts.set(providerId, accounts);
|
|
400
|
+
}
|
|
401
|
+
const sessionFromEmbedder = await this.sessionFromEmbedder.value;
|
|
402
|
+
let canSignOut = true;
|
|
403
|
+
if (sessionFromEmbedder
|
|
404
|
+
&& !sessionFromEmbedder.canSignOut
|
|
405
|
+
&& ( (await this.authenticationService.getSessions(providerId))
|
|
406
|
+
.some(s => s.id === sessionFromEmbedder.id
|
|
407
|
+
&& s.account.id === account.id))) {
|
|
408
|
+
canSignOut = false;
|
|
409
|
+
}
|
|
410
|
+
const existingAccount = accounts.find(a => a.label === account.label);
|
|
411
|
+
if (existingAccount) {
|
|
412
|
+
if (!canSignOut) {
|
|
413
|
+
existingAccount.canSignOut = canSignOut;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
accounts.push({ ...account, canSignOut });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
removeAccount(providerId, account) {
|
|
421
|
+
const accounts = this.groupedAccounts.get(providerId);
|
|
422
|
+
if (!accounts) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const index = accounts.findIndex(a => a.id === account.id);
|
|
426
|
+
if (index === -1) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
accounts.splice(index, 1);
|
|
430
|
+
if (accounts.length === 0) {
|
|
431
|
+
this.groupedAccounts.delete(providerId);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
async addAccountsFromProvider(providerId) {
|
|
435
|
+
try {
|
|
436
|
+
const sessions = await this.authenticationService.getSessions(providerId);
|
|
437
|
+
this.problematicProviders.delete(providerId);
|
|
438
|
+
for (const session of sessions) {
|
|
439
|
+
try {
|
|
440
|
+
await this.addOrUpdateAccount(providerId, session.account);
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
this.logService.error(e);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
catch (e) {
|
|
448
|
+
this.logService.error(e);
|
|
449
|
+
this.problematicProviders.add(providerId);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
AccountsActivityActionViewItem = ( __decorate([
|
|
454
|
+
( __param(4, IThemeService)),
|
|
455
|
+
( __param(5, ILifecycleService)),
|
|
456
|
+
( __param(6, IHoverService)),
|
|
457
|
+
( __param(7, IContextMenuService)),
|
|
458
|
+
( __param(8, IMenuService)),
|
|
459
|
+
( __param(9, IContextKeyService)),
|
|
460
|
+
( __param(10, IAuthenticationService)),
|
|
461
|
+
( __param(11, IWorkbenchEnvironmentService)),
|
|
462
|
+
( __param(12, IProductService)),
|
|
463
|
+
( __param(13, IConfigurationService)),
|
|
464
|
+
( __param(14, IKeybindingService)),
|
|
465
|
+
( __param(15, ISecretStorageService)),
|
|
466
|
+
( __param(16, ILogService)),
|
|
467
|
+
( __param(17, IActivityService)),
|
|
468
|
+
( __param(18, IInstantiationService))
|
|
469
|
+
], AccountsActivityActionViewItem));
|
|
185
470
|
let GlobalActivityActionViewItem = class GlobalActivityActionViewItem extends AbstractGlobalActivityActionViewItem {
|
|
186
471
|
constructor(contextMenuActionsProvider, options, contextMenuAlignmentOptions, userDataProfileService, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService, instantiationService, activityService) {
|
|
187
472
|
const action = instantiationService.createInstance(CompositeBarAction, {
|
|
@@ -251,6 +536,36 @@ GlobalActivityActionViewItem = ( __decorate([
|
|
|
251
536
|
( __param(12, IInstantiationService)),
|
|
252
537
|
( __param(13, IActivityService))
|
|
253
538
|
], GlobalActivityActionViewItem));
|
|
539
|
+
let SimpleAccountActivityActionViewItem = class SimpleAccountActivityActionViewItem extends AccountsActivityActionViewItem {
|
|
540
|
+
constructor(hoverOptions, options, themeService, lifecycleService, hoverService, contextMenuService, menuService, contextKeyService, authenticationService, environmentService, productService, configurationService, keybindingService, secretStorageService, logService, activityService, instantiationService) {
|
|
541
|
+
super(() => [], {
|
|
542
|
+
...options,
|
|
543
|
+
colors: theme => ({
|
|
544
|
+
badgeBackground: theme.getColor(ACTIVITY_BAR_BADGE_BACKGROUND),
|
|
545
|
+
badgeForeground: theme.getColor(ACTIVITY_BAR_BADGE_FOREGROUND),
|
|
546
|
+
}),
|
|
547
|
+
hoverOptions,
|
|
548
|
+
compact: true,
|
|
549
|
+
}, () => undefined, actions => actions, themeService, lifecycleService, hoverService, contextMenuService, menuService, contextKeyService, authenticationService, environmentService, productService, configurationService, keybindingService, secretStorageService, logService, activityService, instantiationService);
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
SimpleAccountActivityActionViewItem = ( __decorate([
|
|
553
|
+
( __param(2, IThemeService)),
|
|
554
|
+
( __param(3, ILifecycleService)),
|
|
555
|
+
( __param(4, IHoverService)),
|
|
556
|
+
( __param(5, IContextMenuService)),
|
|
557
|
+
( __param(6, IMenuService)),
|
|
558
|
+
( __param(7, IContextKeyService)),
|
|
559
|
+
( __param(8, IAuthenticationService)),
|
|
560
|
+
( __param(9, IWorkbenchEnvironmentService)),
|
|
561
|
+
( __param(10, IProductService)),
|
|
562
|
+
( __param(11, IConfigurationService)),
|
|
563
|
+
( __param(12, IKeybindingService)),
|
|
564
|
+
( __param(13, ISecretStorageService)),
|
|
565
|
+
( __param(14, ILogService)),
|
|
566
|
+
( __param(15, IActivityService)),
|
|
567
|
+
( __param(16, IInstantiationService))
|
|
568
|
+
], SimpleAccountActivityActionViewItem));
|
|
254
569
|
let SimpleGlobalActivityActionViewItem = class SimpleGlobalActivityActionViewItem extends GlobalActivityActionViewItem {
|
|
255
570
|
constructor(hoverOptions, options, userDataProfileService, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService, instantiationService, activityService) {
|
|
256
571
|
super(() => [], {
|
|
@@ -277,4 +592,4 @@ SimpleGlobalActivityActionViewItem = ( __decorate([
|
|
|
277
592
|
( __param(11, IInstantiationService)),
|
|
278
593
|
( __param(12, IActivityService))
|
|
279
594
|
], SimpleGlobalActivityActionViewItem));
|
|
280
|
-
export { GlobalActivityActionViewItem, GlobalCompositeBar, SimpleGlobalActivityActionViewItem };
|
|
595
|
+
export { AccountsActivityActionViewItem, GlobalActivityActionViewItem, GlobalCompositeBar, SimpleAccountActivityActionViewItem, SimpleGlobalActivityActionViewItem };
|
|
@@ -3,5 +3,48 @@
|
|
|
3
3
|
*/
|
|
4
4
|
interface IWorkbenchContribution {
|
|
5
5
|
}
|
|
6
|
+
declare const enum WorkbenchPhase {
|
|
7
|
+
/**
|
|
8
|
+
* The first phase signals that we are about to startup getting ready.
|
|
9
|
+
*
|
|
10
|
+
* Note: doing work in this phase blocks an editor from showing to
|
|
11
|
+
* the user, so please rather consider to use the other types, preferable
|
|
12
|
+
* `Lazy` to only instantiate the contribution when really needed.
|
|
13
|
+
*/
|
|
14
|
+
BlockStartup = 1,
|
|
15
|
+
/**
|
|
16
|
+
* Services are ready and the window is about to restore its UI state.
|
|
17
|
+
*
|
|
18
|
+
* Note: doing work in this phase blocks an editor from showing to
|
|
19
|
+
* the user, so please rather consider to use the other types, preferable
|
|
20
|
+
* `Lazy` to only instantiate the contribution when really needed.
|
|
21
|
+
*/
|
|
22
|
+
BlockRestore = 2,
|
|
23
|
+
/**
|
|
24
|
+
* Views, panels and editors have restored. Editors are given a bit of
|
|
25
|
+
* time to restore their contents.
|
|
26
|
+
*/
|
|
27
|
+
AfterRestored = 3,
|
|
28
|
+
/**
|
|
29
|
+
* The last phase after views, panels and editors have restored and
|
|
30
|
+
* some time has passed (2-5 seconds).
|
|
31
|
+
*/
|
|
32
|
+
Eventually = 4
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A workbenchch contribution that will only be instantiated
|
|
36
|
+
* when calling `getWorkbenchContribution`.
|
|
37
|
+
*/
|
|
38
|
+
interface ILazyWorkbenchContributionInstantiation {
|
|
39
|
+
readonly lazy: true;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A workbench contribution that will be instantiated when the
|
|
43
|
+
* corresponding editor is being created.
|
|
44
|
+
*/
|
|
45
|
+
interface IOnEditorWorkbenchContributionInstantiation {
|
|
46
|
+
readonly editorTypeId: string;
|
|
47
|
+
}
|
|
48
|
+
type WorkbenchContributionInstantiation = WorkbenchPhase | ILazyWorkbenchContributionInstantiation | IOnEditorWorkbenchContributionInstantiation;
|
|
6
49
|
|
|
7
|
-
export type
|
|
50
|
+
export { type ILazyWorkbenchContributionInstantiation, type IOnEditorWorkbenchContributionInstantiation, type IWorkbenchContribution, type WorkbenchContributionInstantiation, WorkbenchPhase };
|
|
@@ -12,6 +12,13 @@ var Extensions;
|
|
|
12
12
|
( (function(Extensions) {
|
|
13
13
|
Extensions.Workbench = 'workbench.contributions.kind';
|
|
14
14
|
})(Extensions || (Extensions = {})));
|
|
15
|
+
var WorkbenchPhase;
|
|
16
|
+
( (function(WorkbenchPhase) {
|
|
17
|
+
WorkbenchPhase[WorkbenchPhase["BlockStartup"] = 1] = "BlockStartup";
|
|
18
|
+
WorkbenchPhase[WorkbenchPhase["BlockRestore"] = 2] = "BlockRestore";
|
|
19
|
+
WorkbenchPhase[WorkbenchPhase["AfterRestored"] = 3] = "AfterRestored";
|
|
20
|
+
WorkbenchPhase[WorkbenchPhase["Eventually"] = 4] = "Eventually";
|
|
21
|
+
})(WorkbenchPhase || (WorkbenchPhase = {})));
|
|
15
22
|
function isOnEditorWorkbenchContributionInstantiation(obj) {
|
|
16
23
|
const candidate = obj;
|
|
17
24
|
return !!candidate && typeof candidate.editorTypeId === 'string';
|
|
@@ -225,4 +232,4 @@ class WorkbenchContributionsRegistry extends Disposable {
|
|
|
225
232
|
const registerWorkbenchContribution2 = WorkbenchContributionsRegistry.INSTANCE.registerWorkbenchContribution2.bind(WorkbenchContributionsRegistry.INSTANCE);
|
|
226
233
|
const getWorkbenchContribution = WorkbenchContributionsRegistry.INSTANCE.getWorkbenchContribution.bind(WorkbenchContributionsRegistry.INSTANCE);
|
|
227
234
|
Registry.add(Extensions.Workbench, WorkbenchContributionsRegistry.INSTANCE);
|
|
228
|
-
export { Extensions, WorkbenchContributionsRegistry, getWorkbenchContribution, registerWorkbenchContribution2 };
|
|
235
|
+
export { Extensions, WorkbenchContributionsRegistry, WorkbenchPhase, getWorkbenchContribution, registerWorkbenchContribution2 };
|
|
@@ -82,9 +82,7 @@ class ViewContainersRegistryImpl extends Disposable {
|
|
|
82
82
|
return [...( this.viewContainers.keys())].filter(location => this.getViewContainers(location).filter(viewContainer => viewContainer?.id === container.id).length > 0)[0];
|
|
83
83
|
}
|
|
84
84
|
getDefaultViewContainer(location) {
|
|
85
|
-
|
|
86
|
-
locationViewContainers.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
87
|
-
return locationViewContainers[0];
|
|
85
|
+
return this.defaultViewContainers.find(viewContainer => this.getViewContainerLocation(viewContainer) === location);
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
Registry.add(Extensions.ViewContainersRegistry, ( new ViewContainersRegistryImpl()));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var pngAssets = {
|
|
2
|
+
'vs/workbench/contrib/debug/browser/media/continue-tb.png': new URL('../../../../../../../../assets/continue-tb.png', import.meta.url).href,
|
|
3
|
+
'vs/workbench/contrib/debug/browser/media/pause-tb.png': new URL('../../../../../../../../assets/pause-tb.png', import.meta.url).href,
|
|
4
|
+
'vs/workbench/contrib/debug/browser/media/restart-tb.png': new URL('../../../../../../../../assets/restart-tb.png', import.meta.url).href,
|
|
5
|
+
'vs/workbench/contrib/debug/browser/media/run-with-debugging-tb.png': new URL('../../../../../../../../assets/run-with-debugging-tb.png', import.meta.url).href,
|
|
6
|
+
'vs/workbench/contrib/debug/browser/media/stepinto-tb.png': new URL('../../../../../../../../assets/stepinto-tb.png', import.meta.url).href,
|
|
7
|
+
'vs/workbench/contrib/debug/browser/media/stepout-tb.png': new URL('../../../../../../../../assets/stepout-tb.png', import.meta.url).href,
|
|
8
|
+
'vs/workbench/contrib/debug/browser/media/stepover-tb.png': new URL('../../../../../../../../assets/stepover-tb.png', import.meta.url).href,
|
|
9
|
+
'vs/workbench/contrib/debug/browser/media/stop-tb.png': new URL('../../../../../../../../assets/stop-tb.png', import.meta.url).href
|
|
10
|
+
};
|
|
11
|
+
export { pngAssets as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
3
|
+
import { sep } from '../../../../base/common/path.js';
|
|
4
|
+
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
5
|
+
import { registerWorkbenchContribution2, Extensions } from '../../../common/contributions.js';
|
|
6
|
+
import { EditorExtensions } from '../../../common/editor.js';
|
|
7
|
+
import { FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE } from '../common/files.js';
|
|
8
|
+
import { TextFileEditorTracker } from './editors/textFileEditorTracker.js';
|
|
9
|
+
import { TextFileSaveErrorHandler } from './editors/textFileSaveErrorHandler.js';
|
|
10
|
+
import { FileEditorInput } from './editors/fileEditorInput.js';
|
|
11
|
+
import { BinaryFileEditor } from './editors/binaryFileEditor.js';
|
|
12
|
+
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
|
|
13
|
+
import { isWindows } from '../../../../base/common/platform.js';
|
|
14
|
+
import { EditorPaneDescriptor } from '../../../browser/editor.js';
|
|
15
|
+
import { ILabelService } from '../../../../platform/label/common/label.js';
|
|
16
|
+
import { Schemas } from '../../../../base/common/network.js';
|
|
17
|
+
import { WorkspaceWatcher } from './workspaceWatcher.js';
|
|
18
|
+
import { DirtyFilesIndicator } from '../common/dirtyFilesIndicator.js';
|
|
19
|
+
import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from './editors/fileEditorHandler.js';
|
|
20
|
+
import { ModesRegistry } from '../../../../editor/common/languages/modesRegistry.js';
|
|
21
|
+
import { TextFileEditor } from './editors/textFileEditor.js';
|
|
22
|
+
import './files.fileEditorFactory.contribution.js';
|
|
23
|
+
let FileUriLabelContribution = class FileUriLabelContribution {
|
|
24
|
+
static { this.ID = 'workbench.contrib.fileUriLabel'; }
|
|
25
|
+
constructor(labelService) {
|
|
26
|
+
labelService.registerFormatter({
|
|
27
|
+
scheme: Schemas.file,
|
|
28
|
+
formatting: {
|
|
29
|
+
label: '${authority}${path}',
|
|
30
|
+
separator: sep,
|
|
31
|
+
tildify: !isWindows,
|
|
32
|
+
normalizeDriveLetter: isWindows,
|
|
33
|
+
authorityPrefix: sep + sep,
|
|
34
|
+
workspaceSuffix: ''
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
FileUriLabelContribution = ( __decorate([
|
|
40
|
+
( __param(0, ILabelService))
|
|
41
|
+
], FileUriLabelContribution));
|
|
42
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(TextFileEditor, TextFileEditor.ID, ( localizeWithPath(
|
|
43
|
+
'vs/workbench/contrib/files/browser/files.editorPane.contribution',
|
|
44
|
+
'textFileEditor',
|
|
45
|
+
"Text File Editor"
|
|
46
|
+
))), [
|
|
47
|
+
( new SyncDescriptor(FileEditorInput))
|
|
48
|
+
]);
|
|
49
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(BinaryFileEditor, BinaryFileEditor.ID, ( localizeWithPath(
|
|
50
|
+
'vs/workbench/contrib/files/browser/files.editorPane.contribution',
|
|
51
|
+
'binaryFileEditor',
|
|
52
|
+
"Binary File Editor"
|
|
53
|
+
))), [
|
|
54
|
+
( new SyncDescriptor(FileEditorInput))
|
|
55
|
+
]);
|
|
56
|
+
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer);
|
|
57
|
+
registerWorkbenchContribution2(FileEditorWorkingCopyEditorHandler.ID, FileEditorWorkingCopyEditorHandler, 2 );
|
|
58
|
+
registerWorkbenchContribution2(TextFileEditorTracker.ID, TextFileEditorTracker, 1 );
|
|
59
|
+
registerWorkbenchContribution2(TextFileSaveErrorHandler.ID, TextFileSaveErrorHandler, 1 );
|
|
60
|
+
registerWorkbenchContribution2(FileUriLabelContribution.ID, FileUriLabelContribution, 1 );
|
|
61
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceWatcher, 3 );
|
|
62
|
+
registerWorkbenchContribution2(DirtyFilesIndicator.ID, DirtyFilesIndicator, 1 );
|
|
63
|
+
ModesRegistry.registerLanguage({
|
|
64
|
+
id: BINARY_TEXT_FILE_MODE,
|
|
65
|
+
aliases: ['Binary'],
|
|
66
|
+
mimetypes: ['text/x-code-binary']
|
|
67
|
+
});
|