@theia/core 1.42.1 → 1.43.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/README.md +6 -6
- package/i18n/nls.cs.json +29 -0
- package/i18n/nls.de.json +29 -0
- package/i18n/nls.es.json +29 -0
- package/i18n/nls.fr.json +29 -0
- package/i18n/nls.hu.json +29 -0
- package/i18n/nls.it.json +29 -0
- package/i18n/nls.ja.json +29 -0
- package/i18n/nls.json +29 -0
- package/i18n/nls.pl.json +29 -0
- package/i18n/nls.pt-br.json +29 -0
- package/i18n/nls.pt-pt.json +29 -0
- package/i18n/nls.ru.json +29 -0
- package/i18n/nls.zh-cn.json +29 -0
- package/lib/browser/color-application-contribution.d.ts +1 -1
- package/lib/browser/color-application-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +6 -3
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +35 -14
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/connection-status-service.d.ts +1 -1
- package/lib/browser/connection-status-service.d.ts.map +1 -1
- package/lib/browser/connection-status-service.js +2 -2
- package/lib/browser/connection-status-service.js.map +1 -1
- package/lib/browser/core-preferences.js +16 -16
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/credentials-service.d.ts +2 -2
- package/lib/browser/credentials-service.d.ts.map +1 -1
- package/lib/browser/credentials-service.js +2 -2
- package/lib/browser/credentials-service.js.map +1 -1
- package/lib/browser/dialogs.d.ts +1 -1
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/frontend-application-contribution.d.ts +76 -0
- package/lib/browser/frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/frontend-application-contribution.js +51 -0
- package/lib/browser/frontend-application-contribution.js.map +1 -0
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +24 -23
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/frontend-application.d.ts +1 -73
- package/lib/browser/frontend-application.d.ts.map +1 -1
- package/lib/browser/frontend-application.js +3 -26
- package/lib/browser/frontend-application.js.map +1 -1
- package/lib/browser/i18n/language-quick-pick-service.d.ts.map +1 -1
- package/lib/browser/i18n/language-quick-pick-service.js +1 -0
- package/lib/browser/i18n/language-quick-pick-service.js.map +1 -1
- package/lib/browser/icon-registry.d.ts +63 -0
- package/lib/browser/icon-registry.d.ts.map +1 -0
- package/lib/browser/icon-registry.js +25 -0
- package/lib/browser/icon-registry.js.map +1 -0
- package/lib/browser/icon-theme-contribution.d.ts +1 -1
- package/lib/browser/icon-theme-contribution.d.ts.map +1 -1
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/json-schema-store.d.ts +1 -1
- package/lib/browser/json-schema-store.d.ts.map +1 -1
- package/lib/browser/label-provider.d.ts +1 -1
- package/lib/browser/label-provider.d.ts.map +1 -1
- package/lib/browser/logger-frontend-module.js +2 -2
- package/lib/browser/logger-frontend-module.js.map +1 -1
- package/lib/browser/menu/browser-menu-module.js +2 -2
- package/lib/browser/menu/browser-menu-module.js.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.d.ts +2 -1
- package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/messaging/messaging-frontend-module.d.ts.map +1 -1
- package/lib/browser/messaging/messaging-frontend-module.js +1 -0
- package/lib/browser/messaging/messaging-frontend-module.js.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.d.ts +5 -0
- package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.js +18 -3
- package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.js +5 -0
- package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
- package/lib/browser/quick-input/quick-input-frontend-contribution.d.ts +1 -1
- package/lib/browser/quick-input/quick-input-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/saveable.d.ts +3 -3
- package/lib/browser/saveable.d.ts.map +1 -1
- package/lib/browser/saveable.js +13 -8
- package/lib/browser/saveable.js.map +1 -1
- package/lib/browser/shell/application-shell-mouse-tracker.d.ts +1 -1
- package/lib/browser/shell/application-shell-mouse-tracker.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +15 -16
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts.map +1 -1
- package/lib/browser/status-bar/status-bar.d.ts.map +1 -1
- package/lib/browser/status-bar/status-bar.js +4 -2
- package/lib/browser/status-bar/status-bar.js.map +1 -1
- package/lib/browser/styling-service.d.ts +1 -1
- package/lib/browser/styling-service.d.ts.map +1 -1
- package/lib/browser/window/browser-window-module.js +2 -2
- package/lib/browser/window/browser-window-module.js.map +1 -1
- package/lib/browser/window/default-window-service.d.ts +2 -1
- package/lib/browser/window/default-window-service.d.ts.map +1 -1
- package/lib/browser/window/default-window-service.js +3 -3
- package/lib/browser/window/default-window-service.js.map +1 -1
- package/lib/browser/window/default-window-service.spec.js +2 -2
- package/lib/browser/window/default-window-service.spec.js.map +1 -1
- package/lib/browser/window/window-service.d.ts +3 -3
- package/lib/browser/window/window-service.d.ts.map +1 -1
- package/lib/browser/window/window-title-updater.d.ts +2 -1
- package/lib/browser/window/window-title-updater.d.ts.map +1 -1
- package/lib/browser/window/window-title-updater.js.map +1 -1
- package/lib/common/cancellation.d.ts +2 -0
- package/lib/common/cancellation.d.ts.map +1 -1
- package/lib/common/cancellation.js +20 -0
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/collections.d.ts +30 -0
- package/lib/common/collections.d.ts.map +1 -0
- package/lib/common/collections.js +122 -0
- package/lib/common/collections.js.map +1 -0
- package/lib/common/event.d.ts +5 -0
- package/lib/common/event.d.ts.map +1 -1
- package/lib/common/event.js +31 -0
- package/lib/common/event.js.map +1 -1
- package/lib/common/hash.d.ts +8 -0
- package/lib/common/hash.d.ts.map +1 -0
- package/lib/common/hash.js +85 -0
- package/lib/common/hash.js.map +1 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/{keytar-protocol.d.ts → key-store.d.ts} +4 -4
- package/lib/common/key-store.d.ts.map +1 -0
- package/lib/common/{keytar-protocol.js → key-store.js} +4 -4
- package/lib/common/key-store.js.map +1 -0
- package/lib/common/keybinding.d.ts +2 -0
- package/lib/common/keybinding.d.ts.map +1 -1
- package/lib/common/keybinding.js +28 -0
- package/lib/common/keybinding.js.map +1 -1
- package/lib/common/markdown-rendering/markdown-string.d.ts +4 -0
- package/lib/common/markdown-rendering/markdown-string.d.ts.map +1 -1
- package/lib/common/markdown-rendering/markdown-string.js +24 -1
- package/lib/common/markdown-rendering/markdown-string.js.map +1 -1
- package/lib/common/menu/menu-types.d.ts +1 -1
- package/lib/common/menu/menu-types.d.ts.map +1 -1
- package/lib/common/menu/menu-types.js +2 -2
- package/lib/common/menu/menu-types.js.map +1 -1
- package/lib/common/message-rpc/rpc-protocol.d.ts.map +1 -1
- package/lib/common/message-rpc/rpc-protocol.js +6 -11
- package/lib/common/message-rpc/rpc-protocol.js.map +1 -1
- package/lib/common/objects.d.ts +1 -1
- package/lib/common/objects.d.ts.map +1 -1
- package/lib/common/objects.js +12 -10
- package/lib/common/objects.js.map +1 -1
- package/lib/common/quick-pick-service.d.ts +1 -0
- package/lib/common/quick-pick-service.d.ts.map +1 -1
- package/lib/common/quick-pick-service.js +2 -1
- package/lib/common/quick-pick-service.js.map +1 -1
- package/lib/common/strings.d.ts +1 -0
- package/lib/common/strings.d.ts.map +1 -1
- package/lib/common/strings.js +10 -1
- package/lib/common/strings.js.map +1 -1
- package/lib/common/types.d.ts +8 -0
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/types.js +21 -1
- package/lib/common/types.js.map +1 -1
- package/lib/common/uri.d.ts +0 -1
- package/lib/common/uri.d.ts.map +1 -1
- package/lib/common/uri.js +0 -3
- package/lib/common/uri.js.map +1 -1
- package/lib/common/uuid.d.ts +3 -0
- package/lib/common/uuid.d.ts.map +1 -0
- package/lib/common/uuid.js +86 -0
- package/lib/common/uuid.js.map +1 -0
- package/lib/common/version.d.ts +2 -0
- package/lib/common/version.d.ts.map +1 -0
- package/lib/common/version.js +20 -0
- package/lib/common/version.js.map +1 -0
- package/lib/common/window.d.ts +3 -0
- package/lib/common/window.d.ts.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js.map +1 -1
- package/lib/electron-browser/messaging/electron-local-ws-connection-provider.d.ts +7 -0
- package/lib/electron-browser/messaging/electron-local-ws-connection-provider.d.ts.map +1 -0
- package/lib/electron-browser/messaging/electron-local-ws-connection-provider.js +55 -0
- package/lib/electron-browser/messaging/electron-local-ws-connection-provider.js.map +1 -0
- package/lib/electron-browser/messaging/electron-messaging-frontend-module.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-messaging-frontend-module.js +16 -2
- package/lib/electron-browser/messaging/electron-messaging-frontend-module.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/window/electron-window-module.js +2 -2
- package/lib/electron-browser/window/electron-window-module.js.map +1 -1
- package/lib/electron-browser/window/electron-window-service.d.ts +3 -3
- package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
- package/lib/electron-browser/window/electron-window-service.js +10 -4
- package/lib/electron-browser/window/electron-window-service.js.map +1 -1
- package/lib/electron-common/electron-main-window-service.d.ts +2 -2
- package/lib/electron-common/electron-main-window-service.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts +3 -2
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +8 -4
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/electron-main/electron-main-window-service-impl.d.ts +2 -2
- package/lib/electron-main/electron-main-window-service-impl.d.ts.map +1 -1
- package/lib/electron-main/electron-main-window-service-impl.js +2 -2
- package/lib/electron-main/electron-main-window-service-impl.js.map +1 -1
- package/lib/electron-node/hosting/electron-ws-origin-validator.d.ts +2 -0
- package/lib/electron-node/hosting/electron-ws-origin-validator.d.ts.map +1 -1
- package/lib/electron-node/hosting/electron-ws-origin-validator.js +12 -0
- package/lib/electron-node/hosting/electron-ws-origin-validator.js.map +1 -1
- package/lib/electron-node/token/electron-token-validator.d.ts +2 -2
- package/lib/electron-node/token/electron-token-validator.d.ts.map +1 -1
- package/lib/electron-node/token/electron-token-validator.js +12 -1
- package/lib/electron-node/token/electron-token-validator.js.map +1 -1
- package/lib/node/backend-application-module.d.ts.map +1 -1
- package/lib/node/backend-application-module.js +7 -4
- package/lib/node/backend-application-module.js.map +1 -1
- package/lib/node/backend-application.d.ts.map +1 -1
- package/lib/node/backend-application.js +4 -0
- package/lib/node/backend-application.js.map +1 -1
- package/lib/node/backend-remote-service.d.ts +4 -0
- package/lib/node/backend-remote-service.d.ts.map +1 -0
- package/lib/node/backend-remote-service.js +35 -0
- package/lib/node/backend-remote-service.js.map +1 -0
- package/lib/node/i18n/localization-contribution.d.ts +4 -4
- package/lib/node/i18n/localization-contribution.d.ts.map +1 -1
- package/lib/node/i18n/localization-contribution.js +11 -7
- package/lib/node/i18n/localization-contribution.js.map +1 -1
- package/lib/node/i18n/localization-provider.d.ts +16 -4
- package/lib/node/i18n/localization-provider.d.ts.map +1 -1
- package/lib/node/i18n/localization-provider.js +42 -10
- package/lib/node/i18n/localization-provider.js.map +1 -1
- package/lib/node/key-store-server.d.ts +28 -0
- package/lib/node/key-store-server.d.ts.map +1 -0
- package/lib/node/{keytar-server.js → key-store-server.js} +76 -17
- package/lib/node/key-store-server.js.map +1 -0
- package/lib/node/messaging/messaging-contribution.d.ts +1 -1
- package/lib/node/messaging/messaging-contribution.d.ts.map +1 -1
- package/lib/node/messaging/messaging-contribution.js +5 -4
- package/lib/node/messaging/messaging-contribution.js.map +1 -1
- package/package.json +6 -6
- package/src/browser/color-application-contribution.ts +1 -1
- package/src/browser/common-frontend-contribution.ts +41 -16
- package/src/browser/connection-status-service.ts +1 -1
- package/src/browser/core-preferences.ts +16 -16
- package/src/browser/credentials-service.ts +3 -3
- package/src/browser/dialogs.ts +1 -1
- package/src/browser/frontend-application-contribution.ts +110 -0
- package/src/browser/frontend-application-module.ts +8 -7
- package/src/browser/frontend-application.ts +2 -92
- package/src/browser/i18n/language-quick-pick-service.ts +1 -0
- package/src/browser/icon-registry.ts +96 -0
- package/src/browser/icon-theme-contribution.ts +1 -1
- package/src/browser/index.ts +1 -0
- package/src/browser/json-schema-store.ts +1 -1
- package/src/browser/label-provider.ts +1 -1
- package/src/browser/logger-frontend-module.ts +1 -1
- package/src/browser/menu/browser-menu-module.ts +1 -1
- package/src/browser/menu/browser-menu-plugin.ts +2 -1
- package/src/browser/messaging/messaging-frontend-module.ts +2 -1
- package/src/browser/messaging/ws-connection-provider.ts +21 -2
- package/src/browser/quick-input/quick-command-frontend-contribution.ts +5 -0
- package/src/browser/quick-input/quick-input-frontend-contribution.ts +1 -1
- package/src/browser/saveable.ts +11 -7
- package/src/browser/shell/application-shell-mouse-tracker.ts +1 -1
- package/src/browser/shell/application-shell.ts +16 -15
- package/src/browser/shell/tab-bar-decorator.ts +1 -1
- package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.ts +1 -1
- package/src/browser/status-bar/status-bar.tsx +6 -2
- package/src/browser/style/status-bar.css +12 -4
- package/src/browser/styling-service.ts +1 -1
- package/src/browser/window/browser-window-module.ts +1 -1
- package/src/browser/window/default-window-service.spec.ts +1 -1
- package/src/browser/window/default-window-service.ts +2 -1
- package/src/browser/window/window-service.ts +3 -3
- package/src/browser/window/window-title-updater.ts +2 -1
- package/src/common/cancellation.ts +22 -0
- package/src/common/collections.ts +125 -0
- package/src/common/event.ts +32 -0
- package/src/common/hash.ts +85 -0
- package/src/common/i18n/nls.metadata.json +4947 -4690
- package/src/common/index.ts +1 -0
- package/src/common/{keytar-protocol.ts → key-store.ts} +3 -3
- package/src/common/keybinding.ts +26 -0
- package/src/common/markdown-rendering/markdown-string.ts +24 -0
- package/src/common/menu/menu-types.ts +1 -1
- package/src/common/message-rpc/rpc-protocol.ts +6 -10
- package/src/common/objects.ts +14 -10
- package/src/common/quick-pick-service.ts +1 -0
- package/src/common/strings.ts +11 -0
- package/src/common/types.ts +22 -0
- package/src/common/uri.ts +0 -4
- package/src/common/uuid.ts +99 -0
- package/src/common/version.ts +17 -0
- package/src/common/window.ts +4 -0
- package/src/electron-browser/keyboard/electron-keyboard-module.ts +1 -1
- package/src/electron-browser/messaging/electron-local-ws-connection-provider.ts +45 -0
- package/src/electron-browser/messaging/electron-messaging-frontend-module.ts +15 -2
- package/src/electron-browser/messaging/electron-ws-connection-provider.ts +1 -1
- package/src/electron-browser/window/electron-window-module.ts +1 -1
- package/src/electron-browser/window/electron-window-service.ts +10 -5
- package/src/electron-common/electron-main-window-service.ts +2 -2
- package/src/electron-main/electron-main-application.ts +9 -5
- package/src/electron-main/electron-main-window-service-impl.ts +3 -3
- package/src/electron-node/hosting/electron-ws-origin-validator.ts +9 -1
- package/src/electron-node/token/electron-token-validator.ts +13 -3
- package/src/node/backend-application-module.ts +8 -5
- package/src/node/backend-application.ts +4 -0
- package/src/node/backend-remote-service.ts +25 -0
- package/src/node/i18n/localization-contribution.ts +15 -11
- package/src/node/i18n/localization-provider.ts +59 -12
- package/src/node/{keytar-server.ts → key-store-server.ts} +75 -11
- package/src/node/messaging/messaging-contribution.ts +5 -4
- package/lib/common/keytar-protocol.d.ts.map +0 -1
- package/lib/common/keytar-protocol.js.map +0 -1
- package/lib/node/keytar-server.d.ts +0 -14
- package/lib/node/keytar-server.d.ts.map +0 -1
- package/lib/node/keytar-server.js.map +0 -1
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
import debounce = require('lodash.debounce');
|
|
20
20
|
import { injectable, inject, optional } from 'inversify';
|
|
21
|
-
import { MAIN_MENU_BAR,
|
|
21
|
+
import { MAIN_MENU_BAR, MANAGE_MENU, MenuContribution, MenuModelRegistry, ACCOUNTS_MENU } from '../common/menu';
|
|
22
22
|
import { KeybindingContribution, KeybindingRegistry } from './keybinding';
|
|
23
|
-
import { FrontendApplication
|
|
23
|
+
import { FrontendApplication } from './frontend-application';
|
|
24
|
+
import { FrontendApplicationContribution, OnWillStopAction } from './frontend-application-contribution';
|
|
24
25
|
import { CommandContribution, CommandRegistry, Command } from '../common/command';
|
|
25
26
|
import { UriAwareCommandHandler } from '../common/uri-command-handler';
|
|
26
27
|
import { SelectionService } from '../common/selection-service';
|
|
@@ -100,8 +101,10 @@ export namespace CommonMenus {
|
|
|
100
101
|
export const VIEW_LAYOUT = [...VIEW, '3_layout'];
|
|
101
102
|
export const VIEW_TOGGLE = [...VIEW, '4_toggle'];
|
|
102
103
|
|
|
103
|
-
export const
|
|
104
|
-
export const
|
|
104
|
+
export const MANAGE_GENERAL = [...MANAGE_MENU, '1_manage_general'];
|
|
105
|
+
export const MANAGE_SETTINGS = [...MANAGE_MENU, '2_manage_settings'];
|
|
106
|
+
export const MANAGE_SETTINGS_THEMES = [...MANAGE_SETTINGS, '1_manage_settings_themes'];
|
|
107
|
+
|
|
105
108
|
// last menu item
|
|
106
109
|
export const HELP = [...MAIN_MENU_BAR, '9_help'];
|
|
107
110
|
|
|
@@ -113,6 +116,7 @@ export namespace CommonCommands {
|
|
|
113
116
|
export const VIEW_CATEGORY = 'View';
|
|
114
117
|
export const CREATE_CATEGORY = 'Create';
|
|
115
118
|
export const PREFERENCES_CATEGORY = 'Preferences';
|
|
119
|
+
export const MANAGE_CATEGORY = 'Manage';
|
|
116
120
|
export const FILE_CATEGORY_KEY = nls.getDefaultKey(FILE_CATEGORY);
|
|
117
121
|
export const VIEW_CATEGORY_KEY = nls.getDefaultKey(VIEW_CATEGORY);
|
|
118
122
|
export const PREFERENCES_CATEGORY_KEY = nls.getDefaultKey(PREFERENCES_CATEGORY);
|
|
@@ -455,16 +459,16 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
455
459
|
app.shell.leftPanelHandler.addBottomMenu({
|
|
456
460
|
id: 'settings-menu',
|
|
457
461
|
iconClass: 'codicon codicon-settings-gear',
|
|
458
|
-
title: nls.localizeByDefault(CommonCommands.
|
|
459
|
-
menuPath:
|
|
460
|
-
order:
|
|
462
|
+
title: nls.localizeByDefault(CommonCommands.MANAGE_CATEGORY),
|
|
463
|
+
menuPath: MANAGE_MENU,
|
|
464
|
+
order: 1,
|
|
461
465
|
});
|
|
462
466
|
const accountsMenu = {
|
|
463
467
|
id: 'accounts-menu',
|
|
464
468
|
iconClass: 'codicon codicon-person',
|
|
465
469
|
title: nls.localizeByDefault('Accounts'),
|
|
466
470
|
menuPath: ACCOUNTS_MENU,
|
|
467
|
-
order:
|
|
471
|
+
order: 0,
|
|
468
472
|
};
|
|
469
473
|
this.authenticationService.onDidRegisterAuthenticationProvider(() => {
|
|
470
474
|
app.shell.leftPanelHandler.addBottomMenu(accountsMenu);
|
|
@@ -700,11 +704,14 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
700
704
|
commandId: CommonCommands.SELECT_ICON_THEME.id
|
|
701
705
|
});
|
|
702
706
|
|
|
703
|
-
registry.
|
|
704
|
-
|
|
707
|
+
registry.registerSubmenu(CommonMenus.MANAGE_SETTINGS_THEMES, nls.localizeByDefault('Themes'), { order: 'a50' });
|
|
708
|
+
registry.registerMenuAction(CommonMenus.MANAGE_SETTINGS_THEMES, {
|
|
709
|
+
commandId: CommonCommands.SELECT_COLOR_THEME.id,
|
|
710
|
+
order: '0'
|
|
705
711
|
});
|
|
706
|
-
registry.registerMenuAction(CommonMenus.
|
|
707
|
-
commandId: CommonCommands.SELECT_ICON_THEME.id
|
|
712
|
+
registry.registerMenuAction(CommonMenus.MANAGE_SETTINGS_THEMES, {
|
|
713
|
+
commandId: CommonCommands.SELECT_ICON_THEME.id,
|
|
714
|
+
order: '1'
|
|
708
715
|
});
|
|
709
716
|
|
|
710
717
|
registry.registerSubmenu(CommonMenus.VIEW_APPEARANCE_SUBMENU, nls.localizeByDefault('Appearance'));
|
|
@@ -731,7 +738,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
731
738
|
if (supportCut) {
|
|
732
739
|
document.execCommand('cut');
|
|
733
740
|
} else {
|
|
734
|
-
this.messageService.warn("Please use the browser's cut command or shortcut.");
|
|
741
|
+
this.messageService.warn(nls.localize('theia/core/cutWarn', "Please use the browser's cut command or shortcut."));
|
|
735
742
|
}
|
|
736
743
|
}
|
|
737
744
|
});
|
|
@@ -740,7 +747,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
740
747
|
if (supportCopy) {
|
|
741
748
|
document.execCommand('copy');
|
|
742
749
|
} else {
|
|
743
|
-
this.messageService.warn("Please use the browser's copy command or shortcut.");
|
|
750
|
+
this.messageService.warn(nls.localize('theia/core/copyWarn', "Please use the browser's copy command or shortcut."));
|
|
744
751
|
}
|
|
745
752
|
}
|
|
746
753
|
});
|
|
@@ -749,7 +756,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
749
756
|
if (supportPaste) {
|
|
750
757
|
document.execCommand('paste');
|
|
751
758
|
} else {
|
|
752
|
-
this.messageService.warn("Please use the browser's paste command or shortcut.");
|
|
759
|
+
this.messageService.warn(nls.localize('theia/core/pasteWarn', "Please use the browser's paste command or shortcut."));
|
|
753
760
|
}
|
|
754
761
|
}
|
|
755
762
|
});
|
|
@@ -762,7 +769,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
762
769
|
const text = uris.map(resource => resource.path.fsPath()).join(lineDelimiter);
|
|
763
770
|
await this.clipboardService.writeText(text);
|
|
764
771
|
} else {
|
|
765
|
-
await this.messageService.info('Open a file first to copy its path');
|
|
772
|
+
await this.messageService.info(nls.localize('theia/core/copyInfo', 'Open a file first to copy its path'));
|
|
766
773
|
}
|
|
767
774
|
}
|
|
768
775
|
}));
|
|
@@ -2293,6 +2300,24 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
2293
2300
|
hcLight: Color.lighten('statusBar.offlineBackground', 0.6)
|
|
2294
2301
|
}, description: 'Background of active statusbar item in case the theia server is offline.'
|
|
2295
2302
|
},
|
|
2303
|
+
{
|
|
2304
|
+
id: 'statusBarItem.remoteBackground',
|
|
2305
|
+
defaults: {
|
|
2306
|
+
dark: 'activityBarBadge.background',
|
|
2307
|
+
light: 'activityBarBadge.background',
|
|
2308
|
+
hcDark: 'activityBarBadge.background',
|
|
2309
|
+
hcLight: 'activityBarBadge.background'
|
|
2310
|
+
}, description: 'Background color for the remote indicator on the status bar.'
|
|
2311
|
+
},
|
|
2312
|
+
{
|
|
2313
|
+
id: 'statusBarItem.remoteForeground',
|
|
2314
|
+
defaults: {
|
|
2315
|
+
dark: 'activityBarBadge.foreground',
|
|
2316
|
+
light: 'activityBarBadge.foreground',
|
|
2317
|
+
hcDark: 'activityBarBadge.foreground',
|
|
2318
|
+
hcLight: 'activityBarBadge.foreground'
|
|
2319
|
+
}, description: 'Foreground color for the remote indicator on the status bar.'
|
|
2320
|
+
},
|
|
2296
2321
|
// Buttons
|
|
2297
2322
|
{
|
|
2298
2323
|
id: 'secondaryButton.foreground',
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
18
18
|
import { ILogger } from '../common/logger';
|
|
19
19
|
import { Event, Emitter } from '../common/event';
|
|
20
|
-
import { DefaultFrontendApplicationContribution } from './frontend-application';
|
|
20
|
+
import { DefaultFrontendApplicationContribution } from './frontend-application-contribution';
|
|
21
21
|
import { StatusBar, StatusBarAlignment } from './status-bar/status-bar';
|
|
22
22
|
import { WebSocketConnectionProvider } from './messaging/ws-connection-provider';
|
|
23
23
|
import { Disposable, DisposableCollection, nls } from '../common';
|
|
@@ -25,22 +25,22 @@ import { DefaultTheme } from '@theia/application-package/lib/application-props';
|
|
|
25
25
|
|
|
26
26
|
/* eslint-disable max-len */
|
|
27
27
|
const windowTitleDescription = [
|
|
28
|
-
'Controls the window title based on the active editor. Variables are substituted based on the context:',
|
|
29
|
-
'`${activeEditorShort}`: the file name (e.g. myFile.txt).',
|
|
30
|
-
'`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).',
|
|
31
|
-
'`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).',
|
|
32
|
-
'`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder).',
|
|
33
|
-
'`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).',
|
|
34
|
-
'`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).',
|
|
35
|
-
'`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder).',
|
|
36
|
-
'`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).',
|
|
37
|
-
'`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace)).',
|
|
38
|
-
'`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).',
|
|
39
|
-
'`${appName}`: e.g. VS Code.',
|
|
40
|
-
'`${remoteName}`: e.g. SSH',
|
|
41
|
-
'`${dirty}`: an indicator for when the active editor has unsaved changes.',
|
|
42
|
-
'`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.'
|
|
43
|
-
].
|
|
28
|
+
nls.localizeByDefault('Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:'),
|
|
29
|
+
nls.localizeByDefault('`${activeEditorShort}`: the file name (e.g. myFile.txt).'),
|
|
30
|
+
nls.localizeByDefault('`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).'),
|
|
31
|
+
nls.localizeByDefault('`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).'),
|
|
32
|
+
nls.localizeByDefault('`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder).'),
|
|
33
|
+
nls.localizeByDefault('`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).'),
|
|
34
|
+
nls.localizeByDefault('`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).'),
|
|
35
|
+
nls.localizeByDefault('`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder).'),
|
|
36
|
+
nls.localizeByDefault('`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).'),
|
|
37
|
+
nls.localizeByDefault('`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace)).'),
|
|
38
|
+
nls.localizeByDefault('`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).'),
|
|
39
|
+
nls.localizeByDefault('`${appName}`: e.g. VS Code.'),
|
|
40
|
+
nls.localizeByDefault('`${remoteName}`: e.g. SSH'),
|
|
41
|
+
nls.localizeByDefault('`${dirty}`: an indicator for when the active editor has unsaved changes.'),
|
|
42
|
+
nls.localizeByDefault('`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.')
|
|
43
|
+
].join('\n- ');
|
|
44
44
|
|
|
45
45
|
export const corePreferenceSchema: PreferenceSchema = {
|
|
46
46
|
'type': 'object',
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { inject, injectable } from 'inversify';
|
|
24
24
|
import { Emitter, Event } from '../common/event';
|
|
25
|
-
import {
|
|
25
|
+
import { KeyStoreService } from '../common/key-store';
|
|
26
26
|
|
|
27
27
|
export interface CredentialsProvider {
|
|
28
28
|
getPassword(service: string, account: string): Promise<string | undefined>;
|
|
@@ -50,7 +50,7 @@ export class CredentialsServiceImpl implements CredentialsService {
|
|
|
50
50
|
|
|
51
51
|
private credentialsProvider: CredentialsProvider;
|
|
52
52
|
|
|
53
|
-
constructor(@inject(
|
|
53
|
+
constructor(@inject(KeyStoreService) private readonly keytarService: KeyStoreService) {
|
|
54
54
|
this.credentialsProvider = new KeytarCredentialsProvider(this.keytarService);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -82,7 +82,7 @@ export class CredentialsServiceImpl implements CredentialsService {
|
|
|
82
82
|
|
|
83
83
|
class KeytarCredentialsProvider implements CredentialsProvider {
|
|
84
84
|
|
|
85
|
-
constructor(private readonly keytarService:
|
|
85
|
+
constructor(private readonly keytarService: KeyStoreService) { }
|
|
86
86
|
|
|
87
87
|
deletePassword(service: string, account: string): Promise<boolean> {
|
|
88
88
|
return this.keytarService.deletePassword(service, account);
|
package/src/browser/dialogs.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { injectable, inject } from 'inversify';
|
|
|
18
18
|
import { Disposable, MaybePromise, CancellationTokenSource, nls } from '../common';
|
|
19
19
|
import { Key } from './keyboard/keys';
|
|
20
20
|
import { Widget, BaseWidget, Message, addKeyListener, codiconArray } from './widgets';
|
|
21
|
-
import { FrontendApplicationContribution } from './frontend-application';
|
|
21
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
22
22
|
|
|
23
23
|
@injectable()
|
|
24
24
|
export class DialogProps {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import type { FrontendApplication } from './frontend-application';
|
|
18
|
+
import { MaybePromise, isObject } from '../common/types';
|
|
19
|
+
import { StopReason } from '../common/frontend-application-state';
|
|
20
|
+
import { injectable } from 'inversify';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Clients can implement to get a callback for contributing widgets to a shell on start.
|
|
24
|
+
*/
|
|
25
|
+
export const FrontendApplicationContribution = Symbol('FrontendApplicationContribution');
|
|
26
|
+
export interface FrontendApplicationContribution {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Called on application startup before configure is called.
|
|
30
|
+
*/
|
|
31
|
+
initialize?(): void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Called before commands, key bindings and menus are initialized.
|
|
35
|
+
* Should return a promise if it runs asynchronously.
|
|
36
|
+
*/
|
|
37
|
+
configure?(app: FrontendApplication): MaybePromise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Called when the application is started. The application shell is not attached yet when this method runs.
|
|
41
|
+
* Should return a promise if it runs asynchronously.
|
|
42
|
+
*/
|
|
43
|
+
onStart?(app: FrontendApplication): MaybePromise<void>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Called on `beforeunload` event, right before the window closes.
|
|
47
|
+
* Return `true` or an OnWillStopAction in order to prevent exit.
|
|
48
|
+
* Note: No async code allowed, this function has to run on one tick.
|
|
49
|
+
*/
|
|
50
|
+
onWillStop?(app: FrontendApplication): boolean | undefined | OnWillStopAction<unknown>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Called when an application is stopped or unloaded.
|
|
54
|
+
*
|
|
55
|
+
* Note that this is implemented using `window.beforeunload` which doesn't allow any asynchronous code anymore.
|
|
56
|
+
* I.e. this is the last tick.
|
|
57
|
+
*/
|
|
58
|
+
onStop?(app: FrontendApplication): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Called after the application shell has been attached in case there is no previous workbench layout state.
|
|
62
|
+
* Should return a promise if it runs asynchronously.
|
|
63
|
+
*/
|
|
64
|
+
initializeLayout?(app: FrontendApplication): MaybePromise<void>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* An event is emitted when a layout is initialized, but before the shell is attached.
|
|
68
|
+
*/
|
|
69
|
+
onDidInitializeLayout?(app: FrontendApplication): MaybePromise<void>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface OnWillStopAction<T = unknown> {
|
|
73
|
+
/**
|
|
74
|
+
* @resolves to a prepared value to be passed into the `action` function.
|
|
75
|
+
*/
|
|
76
|
+
prepare?: (stopReason?: StopReason) => MaybePromise<T>;
|
|
77
|
+
/**
|
|
78
|
+
* @resolves to `true` if it is safe to close the application; `false` otherwise.
|
|
79
|
+
*/
|
|
80
|
+
action: (prepared: T, stopReason?: StopReason) => MaybePromise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* A descriptive string for the reason preventing close.
|
|
83
|
+
*/
|
|
84
|
+
reason: string;
|
|
85
|
+
/**
|
|
86
|
+
* A number representing priority. Higher priority items are run later.
|
|
87
|
+
* High priority implies that some options of this check will have negative impacts if
|
|
88
|
+
* the user subsequently cancels the shutdown.
|
|
89
|
+
*/
|
|
90
|
+
priority?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export namespace OnWillStopAction {
|
|
94
|
+
export function is(candidate: unknown): candidate is OnWillStopAction {
|
|
95
|
+
return isObject(candidate) && 'action' in candidate && 'reason' in candidate;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Default frontend contribution that can be extended by clients if they do not want to implement any of the
|
|
101
|
+
* methods from the interface but still want to contribute to the frontend application.
|
|
102
|
+
*/
|
|
103
|
+
@injectable()
|
|
104
|
+
export abstract class DefaultFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
105
|
+
|
|
106
|
+
initialize(): void {
|
|
107
|
+
// NOOP
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
@@ -38,7 +38,8 @@ import {
|
|
|
38
38
|
MenuCommandExecutorImpl
|
|
39
39
|
} from '../common';
|
|
40
40
|
import { KeybindingRegistry, KeybindingContext, KeybindingContribution } from './keybinding';
|
|
41
|
-
import { FrontendApplication
|
|
41
|
+
import { FrontendApplication } from './frontend-application';
|
|
42
|
+
import { FrontendApplicationContribution, DefaultFrontendApplicationContribution } from './frontend-application-contribution';
|
|
42
43
|
import { DefaultOpenerService, OpenerService, OpenHandler } from './opener-service';
|
|
43
44
|
import { HttpOpenHandler } from './http-open-handler';
|
|
44
45
|
import { CommonFrontendContribution } from './common-frontend-contribution';
|
|
@@ -96,7 +97,7 @@ import { EncodingRegistry } from './encoding-registry';
|
|
|
96
97
|
import { EncodingService } from '../common/encoding-service';
|
|
97
98
|
import { AuthenticationService, AuthenticationServiceImpl } from '../browser/authentication-service';
|
|
98
99
|
import { DecorationsService, DecorationsServiceImpl } from './decorations-service';
|
|
99
|
-
import {
|
|
100
|
+
import { keyStoreServicePath, KeyStoreService } from '../common/key-store';
|
|
100
101
|
import { CredentialsService, CredentialsServiceImpl } from './credentials-service';
|
|
101
102
|
import { ContributionFilterRegistry, ContributionFilterRegistryImpl } from '../common/contribution-filter';
|
|
102
103
|
import { QuickCommandFrontendContribution } from './quick-input/quick-command-frontend-contribution';
|
|
@@ -247,7 +248,7 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
|
|
|
247
248
|
|
|
248
249
|
bind(SelectionService).toSelf().inSingletonScope();
|
|
249
250
|
bind(CommandRegistry).toSelf().inSingletonScope().onActivation(({ container }, registry) => {
|
|
250
|
-
WebSocketConnectionProvider.
|
|
251
|
+
WebSocketConnectionProvider.createHandler(container, commandServicePath, registry);
|
|
251
252
|
return registry;
|
|
252
253
|
});
|
|
253
254
|
bind(CommandService).toService(CommandRegistry);
|
|
@@ -267,7 +268,7 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
|
|
|
267
268
|
|
|
268
269
|
bindMessageService(bind).onActivation(({ container }, messages) => {
|
|
269
270
|
const client = container.get(MessageClient);
|
|
270
|
-
WebSocketConnectionProvider.
|
|
271
|
+
WebSocketConnectionProvider.createHandler(container, messageServicePath, client);
|
|
271
272
|
return messages;
|
|
272
273
|
});
|
|
273
274
|
|
|
@@ -295,7 +296,7 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
|
|
|
295
296
|
bind(QuickAccessContribution).toService(QuickHelpService);
|
|
296
297
|
|
|
297
298
|
bind(QuickPickService).to(QuickPickServiceImpl).inSingletonScope().onActivation(({ container }, quickPickService: QuickPickService) => {
|
|
298
|
-
WebSocketConnectionProvider.
|
|
299
|
+
WebSocketConnectionProvider.createHandler(container, quickPickServicePath, quickPickService);
|
|
299
300
|
return quickPickService;
|
|
300
301
|
});
|
|
301
302
|
|
|
@@ -398,9 +399,9 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
|
|
|
398
399
|
bind(AuthenticationService).to(AuthenticationServiceImpl).inSingletonScope();
|
|
399
400
|
bind(DecorationsService).to(DecorationsServiceImpl).inSingletonScope();
|
|
400
401
|
|
|
401
|
-
bind(
|
|
402
|
+
bind(KeyStoreService).toDynamicValue(ctx => {
|
|
402
403
|
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
403
|
-
return connection.createProxy<
|
|
404
|
+
return connection.createProxy<KeyStoreService>(keyStoreServicePath);
|
|
404
405
|
}).inSingletonScope();
|
|
405
406
|
|
|
406
407
|
bind(CredentialsService).to(CredentialsServiceImpl);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { inject, injectable, named } from 'inversify';
|
|
18
|
-
import { ContributionProvider, CommandRegistry, MenuModelRegistry, isOSX, BackendStopwatch, LogLevel, Stopwatch
|
|
18
|
+
import { ContributionProvider, CommandRegistry, MenuModelRegistry, isOSX, BackendStopwatch, LogLevel, Stopwatch } from '../common';
|
|
19
19
|
import { MaybePromise } from '../common/types';
|
|
20
20
|
import { KeybindingRegistry } from './keybinding';
|
|
21
21
|
import { Widget } from './widgets';
|
|
@@ -26,100 +26,10 @@ import { preventNavigation, parseCssTime, animationFrame } from './browser';
|
|
|
26
26
|
import { CorePreferences } from './core-preferences';
|
|
27
27
|
import { WindowService } from './window/window-service';
|
|
28
28
|
import { TooltipService } from './tooltip-service';
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Clients can implement to get a callback for contributing widgets to a shell on start.
|
|
33
|
-
*/
|
|
34
|
-
export const FrontendApplicationContribution = Symbol('FrontendApplicationContribution');
|
|
35
|
-
export interface FrontendApplicationContribution {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Called on application startup before configure is called.
|
|
39
|
-
*/
|
|
40
|
-
initialize?(): void;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Called before commands, key bindings and menus are initialized.
|
|
44
|
-
* Should return a promise if it runs asynchronously.
|
|
45
|
-
*/
|
|
46
|
-
configure?(app: FrontendApplication): MaybePromise<void>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Called when the application is started. The application shell is not attached yet when this method runs.
|
|
50
|
-
* Should return a promise if it runs asynchronously.
|
|
51
|
-
*/
|
|
52
|
-
onStart?(app: FrontendApplication): MaybePromise<void>;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Called on `beforeunload` event, right before the window closes.
|
|
56
|
-
* Return `true` or an OnWillStopAction in order to prevent exit.
|
|
57
|
-
* Note: No async code allowed, this function has to run on one tick.
|
|
58
|
-
*/
|
|
59
|
-
onWillStop?(app: FrontendApplication): boolean | undefined | OnWillStopAction<unknown>;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Called when an application is stopped or unloaded.
|
|
63
|
-
*
|
|
64
|
-
* Note that this is implemented using `window.beforeunload` which doesn't allow any asynchronous code anymore.
|
|
65
|
-
* I.e. this is the last tick.
|
|
66
|
-
*/
|
|
67
|
-
onStop?(app: FrontendApplication): void;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Called after the application shell has been attached in case there is no previous workbench layout state.
|
|
71
|
-
* Should return a promise if it runs asynchronously.
|
|
72
|
-
*/
|
|
73
|
-
initializeLayout?(app: FrontendApplication): MaybePromise<void>;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* An event is emitted when a layout is initialized, but before the shell is attached.
|
|
77
|
-
*/
|
|
78
|
-
onDidInitializeLayout?(app: FrontendApplication): MaybePromise<void>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface OnWillStopAction<T = unknown> {
|
|
82
|
-
/**
|
|
83
|
-
* @resolves to a prepared value to be passed into the `action` function.
|
|
84
|
-
*/
|
|
85
|
-
prepare?: (stopReason?: StopReason) => MaybePromise<T>;
|
|
86
|
-
/**
|
|
87
|
-
* @resolves to `true` if it is safe to close the application; `false` otherwise.
|
|
88
|
-
*/
|
|
89
|
-
action: (prepared: T, stopReason?: StopReason) => MaybePromise<boolean>;
|
|
90
|
-
/**
|
|
91
|
-
* A descriptive string for the reason preventing close.
|
|
92
|
-
*/
|
|
93
|
-
reason: string;
|
|
94
|
-
/**
|
|
95
|
-
* A number representing priority. Higher priority items are run later.
|
|
96
|
-
* High priority implies that some options of this check will have negative impacts if
|
|
97
|
-
* the user subsequently cancels the shutdown.
|
|
98
|
-
*/
|
|
99
|
-
priority?: number;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export namespace OnWillStopAction {
|
|
103
|
-
export function is(candidate: unknown): candidate is OnWillStopAction {
|
|
104
|
-
return isObject(candidate) && 'action' in candidate && 'reason' in candidate;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
29
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
107
30
|
|
|
108
31
|
const TIMER_WARNING_THRESHOLD = 100;
|
|
109
32
|
|
|
110
|
-
/**
|
|
111
|
-
* Default frontend contribution that can be extended by clients if they do not want to implement any of the
|
|
112
|
-
* methods from the interface but still want to contribute to the frontend application.
|
|
113
|
-
*/
|
|
114
|
-
@injectable()
|
|
115
|
-
export abstract class DefaultFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
116
|
-
|
|
117
|
-
initialize(): void {
|
|
118
|
-
// NOOP
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
33
|
@injectable()
|
|
124
34
|
export class FrontendApplication {
|
|
125
35
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/*---------------------------------------------------------------------------------------------
|
|
17
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
+
*--------------------------------------------------------------------------------------------*/
|
|
20
|
+
// code copied and modified from https://github.com/Microsoft/vscode/blob/main/src/vs/platform/theme/common/iconRegistry.ts
|
|
21
|
+
|
|
22
|
+
import { URI } from 'vscode-uri';
|
|
23
|
+
|
|
24
|
+
export interface IconDefinition {
|
|
25
|
+
font?: IconFontContribution;
|
|
26
|
+
fontCharacter: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IconContribution {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
description: string | undefined;
|
|
32
|
+
deprecationMessage?: string;
|
|
33
|
+
readonly defaults: ThemeIcon | IconDefinition;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IconFontContribution {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly definition: IconFontDefinition;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IconFontDefinition {
|
|
42
|
+
readonly weight?: string;
|
|
43
|
+
readonly style?: string;
|
|
44
|
+
readonly src: IconFontSource[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IconFontSource {
|
|
48
|
+
readonly location: URI;
|
|
49
|
+
readonly format: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ThemeIcon {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly color?: ThemeColor;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ThemeColor {
|
|
58
|
+
id: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const IconRegistry = Symbol('IconRegistry');
|
|
62
|
+
export interface IconRegistry {
|
|
63
|
+
/**
|
|
64
|
+
* Register a icon to the registry.
|
|
65
|
+
* @param id The icon id
|
|
66
|
+
* @param defaults The default values
|
|
67
|
+
* @param description The description
|
|
68
|
+
*/
|
|
69
|
+
registerIcon(id: string, defaults: ThemeIcon | IconDefinition, description?: string): ThemeIcon;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Deregister a icon from the registry.
|
|
73
|
+
* @param id The icon id
|
|
74
|
+
*/
|
|
75
|
+
deregisterIcon(id: string): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Register a icon font to the registry.
|
|
79
|
+
* @param id The icon font id
|
|
80
|
+
* @param definition The icon font definition
|
|
81
|
+
*/
|
|
82
|
+
registerIconFont(id: string, definition: IconFontDefinition): IconFontDefinition;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Deregister an icon font from the registry.
|
|
86
|
+
* @param id The icon font id
|
|
87
|
+
*/
|
|
88
|
+
deregisterIconFont(id: string): void;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the icon font for the given id
|
|
92
|
+
* @param id The icon font id
|
|
93
|
+
*/
|
|
94
|
+
getIconFont(id: string): IconFontDefinition | undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject, named } from 'inversify';
|
|
18
|
-
import { FrontendApplicationContribution } from './frontend-application';
|
|
18
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
19
19
|
import { ContributionProvider } from '../common/contribution-provider';
|
|
20
20
|
import { IconThemeService, IconTheme } from './icon-theme-service';
|
|
21
21
|
import { MaybePromise } from '../common/types';
|
package/src/browser/index.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { injectable, inject, named } from 'inversify';
|
|
18
18
|
import { ContributionProvider } from '../common/contribution-provider';
|
|
19
|
-
import { FrontendApplicationContribution } from './frontend-application';
|
|
19
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
20
20
|
import { MaybePromise } from '../common';
|
|
21
21
|
import { Endpoint } from './endpoint';
|
|
22
22
|
import { timeout, Deferred } from '../common/promise-util';
|
|
@@ -19,7 +19,7 @@ import * as fileIcons from 'file-icons-js';
|
|
|
19
19
|
import URI from '../common/uri';
|
|
20
20
|
import { ContributionProvider } from '../common/contribution-provider';
|
|
21
21
|
import { Event, Emitter, Disposable, isObject, Path, Prioritizeable } from '../common';
|
|
22
|
-
import { FrontendApplicationContribution } from './frontend-application';
|
|
22
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
23
23
|
import { EnvVariablesServer } from '../common/env-variables/env-variables-protocol';
|
|
24
24
|
import { ResourceLabelFormatter, ResourceLabelFormatting } from '../common/label-protocol';
|
|
25
25
|
import { codicon } from './widgets';
|
|
@@ -19,7 +19,7 @@ import { ILoggerServer, loggerPath, ConsoleLogger } from '../common/logger-proto
|
|
|
19
19
|
import { ILogger, Logger, LoggerFactory, setRootLogger, LoggerName, rootLoggerName } from '../common/logger';
|
|
20
20
|
import { LoggerWatcher } from '../common/logger-watcher';
|
|
21
21
|
import { WebSocketConnectionProvider } from './messaging';
|
|
22
|
-
import { FrontendApplicationContribution } from './frontend-application';
|
|
22
|
+
import { FrontendApplicationContribution } from './frontend-application-contribution';
|
|
23
23
|
import { EncodingError } from '../common/message-rpc/rpc-message-encoder';
|
|
24
24
|
|
|
25
25
|
export const loggerFrontendModule = new ContainerModule(bind => {
|