UNPKG

119 kBJavaScriptView Raw
1"use strict";
2// *****************************************************************************
3// Copyright (C) 2017 TypeFox and others.
4//
5// This program and the accompanying materials are made available under the
6// terms of the Eclipse Public License v. 2.0 which is available at
7// http://www.eclipse.org/legal/epl-2.0.
8//
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License v. 2.0 are satisfied: GNU General Public License, version 2
12// with the GNU Classpath Exception which is available at
13// https://www.gnu.org/software/classpath/license.html.
14//
15// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16// *****************************************************************************
17var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21 return c > 3 && r && Object.defineProperty(target, key, r), r;
22};
23var __metadata = (this && this.__metadata) || function (k, v) {
24 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25};
26var __param = (this && this.__param) || function (paramIndex, decorator) {
27 return function (target, key) { decorator(target, key, paramIndex); }
28};
29Object.defineProperty(exports, "__esModule", { value: true });
30exports.CommonFrontendContribution = exports.RECENT_COMMANDS_STORAGE_KEY = exports.supportPaste = exports.supportCopy = exports.supportCut = exports.CommonCommands = exports.CommonMenus = void 0;
31/* eslint-disable max-len, @typescript-eslint/indent */
32const debounce = require("lodash.debounce");
33const inversify_1 = require("inversify");
34const menu_1 = require("../common/menu");
35const command_1 = require("../common/command");
36const uri_command_handler_1 = require("../common/uri-command-handler");
37const selection_service_1 = require("../common/selection-service");
38const message_service_1 = require("../common/message-service");
39const opener_service_1 = require("../browser/opener-service");
40const application_shell_1 = require("./shell/application-shell");
41const tab_bars_1 = require("./shell/tab-bars");
42const about_dialog_1 = require("./about-dialog");
43const browser = require("./browser");
44const uri_1 = require("../common/uri");
45const context_key_service_1 = require("./context-key-service");
46const os_1 = require("../common/os");
47const resource_context_key_1 = require("./resource-context-key");
48const selection_1 = require("../common/selection");
49const storage_service_1 = require("./storage-service");
50const navigatable_1 = require("./navigatable");
51const quick_view_service_1 = require("./quick-input/quick-view-service");
52const environment_1 = require("@theia/application-package/lib/environment");
53const icon_theme_service_1 = require("./icon-theme-service");
54const color_1 = require("../common/color");
55const core_preferences_1 = require("./core-preferences");
56const theming_1 = require("./theming");
57const preferences_1 = require("./preferences");
58const clipboard_service_1 = require("./clipboard-service");
59const encoding_registry_1 = require("./encoding-registry");
60const encodings_1 = require("../common/encodings");
61const env_variables_1 = require("../common/env-variables");
62const authentication_service_1 = require("./authentication-service");
63const saveable_1 = require("./saveable");
64const quick_input_1 = require("./quick-input");
65const localization_1 = require("../common/i18n/localization");
66const nls_1 = require("../common/nls");
67const current_widget_command_adapter_1 = require("./shell/current-widget-command-adapter");
68const dialogs_1 = require("./dialogs");
69const window_service_1 = require("./window/window-service");
70const frontend_application_config_provider_1 = require("./frontend-application-config-provider");
71const decoration_style_1 = require("./decoration-style");
72const widgets_1 = require("./widgets");
73const save_resource_service_1 = require("./save-resource-service");
74const user_working_directory_provider_1 = require("./user-working-directory-provider");
75const common_1 = require("../common");
76const language_quick_pick_service_1 = require("./i18n/language-quick-pick-service");
77var CommonMenus;
78(function (CommonMenus) {
79 CommonMenus.FILE = [...menu_1.MAIN_MENU_BAR, '1_file'];
80 CommonMenus.FILE_NEW = [...CommonMenus.FILE, '1_new'];
81 CommonMenus.FILE_OPEN = [...CommonMenus.FILE, '2_open'];
82 CommonMenus.FILE_SAVE = [...CommonMenus.FILE, '3_save'];
83 CommonMenus.FILE_AUTOSAVE = [...CommonMenus.FILE, '4_autosave'];
84 CommonMenus.FILE_SETTINGS = [...CommonMenus.FILE, '5_settings'];
85 CommonMenus.FILE_SETTINGS_SUBMENU = [...CommonMenus.FILE_SETTINGS, '1_settings_submenu'];
86 CommonMenus.FILE_SETTINGS_SUBMENU_OPEN = [...CommonMenus.FILE_SETTINGS_SUBMENU, '1_settings_submenu_open'];
87 CommonMenus.FILE_SETTINGS_SUBMENU_THEME = [...CommonMenus.FILE_SETTINGS_SUBMENU, '2_settings_submenu_theme'];
88 CommonMenus.FILE_CLOSE = [...CommonMenus.FILE, '6_close'];
89 CommonMenus.EDIT = [...menu_1.MAIN_MENU_BAR, '2_edit'];
90 CommonMenus.EDIT_UNDO = [...CommonMenus.EDIT, '1_undo'];
91 CommonMenus.EDIT_CLIPBOARD = [...CommonMenus.EDIT, '2_clipboard'];
92 CommonMenus.EDIT_FIND = [...CommonMenus.EDIT, '3_find'];
93 CommonMenus.VIEW = [...menu_1.MAIN_MENU_BAR, '4_view'];
94 CommonMenus.VIEW_PRIMARY = [...CommonMenus.VIEW, '0_primary'];
95 CommonMenus.VIEW_APPEARANCE = [...CommonMenus.VIEW, '1_appearance'];
96 CommonMenus.VIEW_APPEARANCE_SUBMENU = [...CommonMenus.VIEW_APPEARANCE, '1_appearance_submenu'];
97 CommonMenus.VIEW_APPEARANCE_SUBMENU_SCREEN = [...CommonMenus.VIEW_APPEARANCE_SUBMENU, '2_appearance_submenu_screen'];
98 CommonMenus.VIEW_APPEARANCE_SUBMENU_BAR = [...CommonMenus.VIEW_APPEARANCE_SUBMENU, '3_appearance_submenu_bar'];
99 CommonMenus.VIEW_EDITOR_SUBMENU = [...CommonMenus.VIEW_APPEARANCE, '2_editor_submenu'];
100 CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT = [...CommonMenus.VIEW_EDITOR_SUBMENU, '1_editor_submenu_split'];
101 CommonMenus.VIEW_EDITOR_SUBMENU_ORTHO = [...CommonMenus.VIEW_EDITOR_SUBMENU, '2_editor_submenu_ortho'];
102 CommonMenus.VIEW_VIEWS = [...CommonMenus.VIEW, '2_views'];
103 CommonMenus.VIEW_LAYOUT = [...CommonMenus.VIEW, '3_layout'];
104 CommonMenus.VIEW_TOGGLE = [...CommonMenus.VIEW, '4_toggle'];
105 CommonMenus.SETTINGS_OPEN = [...menu_1.SETTINGS_MENU, '1_settings_open'];
106 CommonMenus.SETTINGS__THEME = [...menu_1.SETTINGS_MENU, '2_settings_theme'];
107 // last menu item
108 CommonMenus.HELP = [...menu_1.MAIN_MENU_BAR, '9_help'];
109})(CommonMenus = exports.CommonMenus || (exports.CommonMenus = {}));
110var CommonCommands;
111(function (CommonCommands) {
112 CommonCommands.FILE_CATEGORY = 'File';
113 CommonCommands.VIEW_CATEGORY = 'View';
114 CommonCommands.PREFERENCES_CATEGORY = 'Preferences';
115 CommonCommands.FILE_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.FILE_CATEGORY);
116 CommonCommands.VIEW_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.VIEW_CATEGORY);
117 CommonCommands.PREFERENCES_CATEGORY_KEY = nls_1.nls.getDefaultKey(CommonCommands.PREFERENCES_CATEGORY);
118 CommonCommands.OPEN = {
119 id: 'core.open',
120 };
121 CommonCommands.CUT = command_1.Command.toDefaultLocalizedCommand({
122 id: 'core.cut',
123 label: 'Cut'
124 });
125 CommonCommands.COPY = command_1.Command.toDefaultLocalizedCommand({
126 id: 'core.copy',
127 label: 'Copy'
128 });
129 CommonCommands.PASTE = command_1.Command.toDefaultLocalizedCommand({
130 id: 'core.paste',
131 label: 'Paste'
132 });
133 CommonCommands.COPY_PATH = command_1.Command.toDefaultLocalizedCommand({
134 id: 'core.copy.path',
135 label: 'Copy Path'
136 });
137 CommonCommands.UNDO = command_1.Command.toDefaultLocalizedCommand({
138 id: 'core.undo',
139 label: 'Undo'
140 });
141 CommonCommands.REDO = command_1.Command.toDefaultLocalizedCommand({
142 id: 'core.redo',
143 label: 'Redo'
144 });
145 CommonCommands.SELECT_ALL = command_1.Command.toDefaultLocalizedCommand({
146 id: 'core.selectAll',
147 label: 'Select All'
148 });
149 CommonCommands.FIND = command_1.Command.toDefaultLocalizedCommand({
150 id: 'core.find',
151 label: 'Find'
152 });
153 CommonCommands.REPLACE = command_1.Command.toDefaultLocalizedCommand({
154 id: 'core.replace',
155 label: 'Replace'
156 });
157 CommonCommands.NEXT_TAB = command_1.Command.toDefaultLocalizedCommand({
158 id: 'core.nextTab',
159 category: CommonCommands.VIEW_CATEGORY,
160 label: 'Show Next Tab'
161 });
162 CommonCommands.PREVIOUS_TAB = command_1.Command.toDefaultLocalizedCommand({
163 id: 'core.previousTab',
164 category: CommonCommands.VIEW_CATEGORY,
165 label: 'Show Previous Tab'
166 });
167 CommonCommands.NEXT_TAB_IN_GROUP = command_1.Command.toLocalizedCommand({
168 id: 'core.nextTabInGroup',
169 category: CommonCommands.VIEW_CATEGORY,
170 label: 'Switch to Next Tab in Group'
171 }, 'theia/core/common/showNextTabInGroup', CommonCommands.VIEW_CATEGORY_KEY);
172 CommonCommands.PREVIOUS_TAB_IN_GROUP = command_1.Command.toLocalizedCommand({
173 id: 'core.previousTabInGroup',
174 category: CommonCommands.VIEW_CATEGORY,
175 label: 'Switch to Previous Tab in Group'
176 }, 'theia/core/common/showPreviousTabInGroup', CommonCommands.VIEW_CATEGORY_KEY);
177 CommonCommands.NEXT_TAB_GROUP = command_1.Command.toLocalizedCommand({
178 id: 'core.nextTabGroup',
179 category: CommonCommands.VIEW_CATEGORY,
180 label: 'Switch to Next Tab Group'
181 }, 'theia/core/common/showNextTabGroup', CommonCommands.VIEW_CATEGORY_KEY);
182 CommonCommands.PREVIOUS_TAB_GROUP = command_1.Command.toLocalizedCommand({
183 id: 'core.previousTabBar',
184 category: CommonCommands.VIEW_CATEGORY,
185 label: 'Switch to Previous Tab Group'
186 }, 'theia/core/common/showPreviousTabGroup', CommonCommands.VIEW_CATEGORY_KEY);
187 CommonCommands.CLOSE_TAB = command_1.Command.toLocalizedCommand({
188 id: 'core.close.tab',
189 category: CommonCommands.VIEW_CATEGORY,
190 label: 'Close Tab'
191 }, 'theia/core/common/closeTab', CommonCommands.VIEW_CATEGORY_KEY);
192 CommonCommands.CLOSE_OTHER_TABS = command_1.Command.toLocalizedCommand({
193 id: 'core.close.other.tabs',
194 category: CommonCommands.VIEW_CATEGORY,
195 label: 'Close Other Tabs'
196 }, 'theia/core/common/closeOthers', CommonCommands.VIEW_CATEGORY_KEY);
197 CommonCommands.CLOSE_SAVED_TABS = command_1.Command.toDefaultLocalizedCommand({
198 id: 'workbench.action.closeUnmodifiedEditors',
199 category: CommonCommands.VIEW_CATEGORY,
200 label: 'Close Saved Editors in Group',
201 });
202 CommonCommands.CLOSE_RIGHT_TABS = command_1.Command.toLocalizedCommand({
203 id: 'core.close.right.tabs',
204 category: CommonCommands.VIEW_CATEGORY,
205 label: 'Close Tabs to the Right'
206 }, 'theia/core/common/closeRight', CommonCommands.VIEW_CATEGORY_KEY);
207 CommonCommands.CLOSE_ALL_TABS = command_1.Command.toLocalizedCommand({
208 id: 'core.close.all.tabs',
209 category: CommonCommands.VIEW_CATEGORY,
210 label: 'Close All Tabs'
211 }, 'theia/core/common/closeAll', CommonCommands.VIEW_CATEGORY_KEY);
212 CommonCommands.CLOSE_MAIN_TAB = command_1.Command.toLocalizedCommand({
213 id: 'core.close.main.tab',
214 category: CommonCommands.VIEW_CATEGORY,
215 label: 'Close Tab in Main Area'
216 }, 'theia/core/common/closeTabMain', CommonCommands.VIEW_CATEGORY_KEY);
217 CommonCommands.CLOSE_OTHER_MAIN_TABS = command_1.Command.toLocalizedCommand({
218 id: 'core.close.other.main.tabs',
219 category: CommonCommands.VIEW_CATEGORY,
220 label: 'Close Other Tabs in Main Area'
221 }, 'theia/core/common/closeOtherTabMain', CommonCommands.VIEW_CATEGORY_KEY);
222 CommonCommands.CLOSE_ALL_MAIN_TABS = command_1.Command.toLocalizedCommand({
223 id: 'core.close.all.main.tabs',
224 category: CommonCommands.VIEW_CATEGORY,
225 label: 'Close All Tabs in Main Area'
226 }, 'theia/core/common/closeAllTabMain', CommonCommands.VIEW_CATEGORY_KEY);
227 CommonCommands.COLLAPSE_PANEL = command_1.Command.toLocalizedCommand({
228 id: 'core.collapse.tab',
229 category: CommonCommands.VIEW_CATEGORY,
230 label: 'Collapse Side Panel'
231 }, 'theia/core/common/collapseTab', CommonCommands.VIEW_CATEGORY_KEY);
232 CommonCommands.COLLAPSE_ALL_PANELS = command_1.Command.toLocalizedCommand({
233 id: 'core.collapse.all.tabs',
234 category: CommonCommands.VIEW_CATEGORY,
235 label: 'Collapse All Side Panels'
236 }, 'theia/core/common/collapseAllTabs', CommonCommands.VIEW_CATEGORY_KEY);
237 CommonCommands.TOGGLE_BOTTOM_PANEL = command_1.Command.toLocalizedCommand({
238 id: 'core.toggle.bottom.panel',
239 category: CommonCommands.VIEW_CATEGORY,
240 label: 'Toggle Bottom Panel'
241 }, 'theia/core/common/collapseBottomPanel', CommonCommands.VIEW_CATEGORY_KEY);
242 CommonCommands.TOGGLE_STATUS_BAR = command_1.Command.toDefaultLocalizedCommand({
243 id: 'workbench.action.toggleStatusbarVisibility',
244 category: CommonCommands.VIEW_CATEGORY,
245 label: 'Toggle Status Bar Visibility'
246 });
247 CommonCommands.PIN_TAB = command_1.Command.toDefaultLocalizedCommand({
248 id: 'workbench.action.pinEditor',
249 category: CommonCommands.VIEW_CATEGORY,
250 label: 'Pin Editor'
251 });
252 CommonCommands.UNPIN_TAB = command_1.Command.toDefaultLocalizedCommand({
253 id: 'workbench.action.unpinEditor',
254 category: CommonCommands.VIEW_CATEGORY,
255 label: 'Unpin Editor'
256 });
257 CommonCommands.TOGGLE_MAXIMIZED = command_1.Command.toLocalizedCommand({
258 id: 'core.toggleMaximized',
259 category: CommonCommands.VIEW_CATEGORY,
260 label: 'Toggle Maximized'
261 }, 'theia/core/common/toggleMaximized', CommonCommands.VIEW_CATEGORY_KEY);
262 CommonCommands.OPEN_VIEW = command_1.Command.toDefaultLocalizedCommand({
263 id: 'core.openView',
264 category: CommonCommands.VIEW_CATEGORY,
265 label: 'Open View...'
266 });
267 CommonCommands.SHOW_MENU_BAR = command_1.Command.toDefaultLocalizedCommand({
268 id: 'window.menuBarVisibility',
269 category: CommonCommands.VIEW_CATEGORY,
270 label: 'Show Menu Bar'
271 });
272 CommonCommands.NEW_UNTITLED_FILE = command_1.Command.toDefaultLocalizedCommand({
273 id: 'workbench.action.files.newUntitledFile',
274 category: CommonCommands.FILE_CATEGORY,
275 label: 'New Untitled File'
276 });
277 CommonCommands.SAVE = command_1.Command.toDefaultLocalizedCommand({
278 id: 'core.save',
279 category: CommonCommands.FILE_CATEGORY,
280 label: 'Save',
281 });
282 CommonCommands.SAVE_AS = command_1.Command.toDefaultLocalizedCommand({
283 id: 'file.saveAs',
284 category: CommonCommands.FILE_CATEGORY,
285 label: 'Save As...',
286 });
287 CommonCommands.SAVE_WITHOUT_FORMATTING = command_1.Command.toDefaultLocalizedCommand({
288 id: 'core.saveWithoutFormatting',
289 category: CommonCommands.FILE_CATEGORY,
290 label: 'Save without Formatting',
291 });
292 CommonCommands.SAVE_ALL = command_1.Command.toDefaultLocalizedCommand({
293 id: 'core.saveAll',
294 category: CommonCommands.FILE_CATEGORY,
295 label: 'Save All',
296 });
297 CommonCommands.AUTO_SAVE = command_1.Command.toDefaultLocalizedCommand({
298 id: 'textEditor.commands.autosave',
299 category: CommonCommands.FILE_CATEGORY,
300 label: 'Auto Save',
301 });
302 CommonCommands.ABOUT_COMMAND = command_1.Command.toDefaultLocalizedCommand({
303 id: 'core.about',
304 label: 'About'
305 });
306 CommonCommands.OPEN_PREFERENCES = command_1.Command.toDefaultLocalizedCommand({
307 id: 'preferences:open',
308 category: CommonCommands.PREFERENCES_CATEGORY,
309 label: 'Open Settings (UI)',
310 });
311 CommonCommands.SELECT_COLOR_THEME = command_1.Command.toDefaultLocalizedCommand({
312 id: 'workbench.action.selectTheme',
313 label: 'Color Theme',
314 category: CommonCommands.PREFERENCES_CATEGORY
315 });
316 CommonCommands.SELECT_ICON_THEME = command_1.Command.toDefaultLocalizedCommand({
317 id: 'workbench.action.selectIconTheme',
318 label: 'File Icon Theme',
319 category: CommonCommands.PREFERENCES_CATEGORY
320 });
321 CommonCommands.CONFIGURE_DISPLAY_LANGUAGE = command_1.Command.toDefaultLocalizedCommand({
322 id: 'workbench.action.configureLanguage',
323 label: 'Configure Display Language'
324 });
325 CommonCommands.TOGGLE_BREADCRUMBS = command_1.Command.toDefaultLocalizedCommand({
326 id: 'breadcrumbs.toggle',
327 label: 'Toggle Breadcrumbs',
328 category: CommonCommands.VIEW_CATEGORY
329 });
330})(CommonCommands = exports.CommonCommands || (exports.CommonCommands = {}));
331exports.supportCut = browser.isNative || document.queryCommandSupported('cut');
332exports.supportCopy = browser.isNative || document.queryCommandSupported('copy');
333// Chrome incorrectly returns true for document.queryCommandSupported('paste')
334// when the paste feature is available but the calling script has insufficient
335// privileges to actually perform the action
336exports.supportPaste = browser.isNative || (!browser.isChrome && document.queryCommandSupported('paste'));
337exports.RECENT_COMMANDS_STORAGE_KEY = 'commands';
338let CommonFrontendContribution = class CommonFrontendContribution {
339 constructor(shell, selectionService, messageService, openerService, aboutDialog, localizationProvider, saveResourceService) {
340 this.shell = shell;
341 this.selectionService = selectionService;
342 this.messageService = messageService;
343 this.openerService = openerService;
344 this.aboutDialog = aboutDialog;
345 this.localizationProvider = localizationProvider;
346 this.saveResourceService = saveResourceService;
347 this.commonDecorationsStyleSheet = decoration_style_1.DecorationStyle.createStyleSheet('coreCommonDecorationsStyle');
348 this.shouldPreventClose = false;
349 }
350 async configure(app) {
351 const configDirUri = await this.environments.getConfigDirUri();
352 // Global settings
353 this.encodingRegistry.registerOverride({
354 encoding: encodings_1.UTF8,
355 parent: new uri_1.default(configDirUri)
356 });
357 this.contextKeyService.createKey('isLinux', os_1.OS.type() === os_1.OS.Type.Linux);
358 this.contextKeyService.createKey('isMac', os_1.OS.type() === os_1.OS.Type.OSX);
359 this.contextKeyService.createKey('isWindows', os_1.OS.type() === os_1.OS.Type.Windows);
360 this.contextKeyService.createKey('isWeb', !this.isElectron());
361 this.pinnedKey = this.contextKeyService.createKey('activeEditorIsPinned', false);
362 this.updatePinnedKey();
363 this.shell.onDidChangeActiveWidget(() => this.updatePinnedKey());
364 this.initResourceContextKeys();
365 this.registerCtrlWHandling();
366 this.updateStyles();
367 this.preferences.ready.then(() => this.setSashProperties());
368 this.preferences.onPreferenceChanged(e => this.handlePreferenceChange(e, app));
369 app.shell.leftPanelHandler.addBottomMenu({
370 id: 'settings-menu',
371 iconClass: 'codicon codicon-settings-gear',
372 title: nls_1.nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY),
373 menuPath: menu_1.SETTINGS_MENU,
374 order: 0,
375 });
376 const accountsMenu = {
377 id: 'accounts-menu',
378 iconClass: 'codicon codicon-person',
379 title: nls_1.nls.localizeByDefault('Accounts'),
380 menuPath: menu_1.ACCOUNTS_MENU,
381 order: 1,
382 };
383 this.authenticationService.onDidRegisterAuthenticationProvider(() => {
384 app.shell.leftPanelHandler.addBottomMenu(accountsMenu);
385 });
386 this.authenticationService.onDidUnregisterAuthenticationProvider(() => {
387 if (this.authenticationService.getProviderIds().length === 0) {
388 app.shell.leftPanelHandler.removeBottomMenu(accountsMenu.id);
389 }
390 });
391 }
392 updateStyles() {
393 document.body.classList.remove('theia-editor-highlightModifiedTabs');
394 if (this.preferences['workbench.editor.highlightModifiedTabs']) {
395 document.body.classList.add('theia-editor-highlightModifiedTabs');
396 }
397 }
398 updatePinnedKey() {
399 const activeTab = this.shell.findTabBar();
400 const pinningTarget = activeTab && this.shell.findTitle(activeTab);
401 const value = pinningTarget && (0, widgets_1.isPinned)(pinningTarget);
402 this.pinnedKey.set(value);
403 }
404 handlePreferenceChange(e, app) {
405 switch (e.preferenceName) {
406 case 'workbench.editor.highlightModifiedTabs': {
407 this.updateStyles();
408 break;
409 }
410 case 'window.menuBarVisibility': {
411 const { newValue } = e;
412 const mainMenuId = 'main-menu';
413 if (newValue === 'compact') {
414 this.shell.leftPanelHandler.addTopMenu({
415 id: mainMenuId,
416 iconClass: 'codicon codicon-menu',
417 title: nls_1.nls.localizeByDefault('Application Menu'),
418 menuPath: menu_1.MAIN_MENU_BAR,
419 order: 0,
420 });
421 }
422 else {
423 app.shell.leftPanelHandler.removeTopMenu(mainMenuId);
424 }
425 break;
426 }
427 case 'workbench.sash.hoverDelay':
428 case 'workbench.sash.size': {
429 this.setSashProperties();
430 break;
431 }
432 }
433 }
434 setSashProperties() {
435 const sashRule = `:root {
436 --theia-sash-hoverDelay: ${this.preferences['workbench.sash.hoverDelay']}ms;
437 --theia-sash-width: ${this.preferences['workbench.sash.size']}px;
438 }`;
439 decoration_style_1.DecorationStyle.deleteStyleRule(':root', this.commonDecorationsStyleSheet);
440 this.commonDecorationsStyleSheet.insertRule(sashRule);
441 }
442 onStart() {
443 this.storageService.getData(exports.RECENT_COMMANDS_STORAGE_KEY, { recent: [] })
444 .then(tasks => this.commandRegistry.recent = tasks.recent);
445 }
446 onStop() {
447 const recent = this.commandRegistry.recent;
448 this.storageService.setData(exports.RECENT_COMMANDS_STORAGE_KEY, { recent });
449 window.localStorage.setItem(icon_theme_service_1.IconThemeService.STORAGE_KEY, this.iconThemes.current);
450 window.localStorage.setItem(theming_1.ThemeService.STORAGE_KEY, this.themeService.getCurrentTheme().id);
451 }
452 initResourceContextKeys() {
453 const updateContextKeys = () => {
454 const selection = this.selectionService.selection;
455 const resourceUri = navigatable_1.Navigatable.is(selection) && selection.getResourceUri() || selection_1.UriSelection.getUri(selection);
456 this.resourceContextKey.set(resourceUri);
457 };
458 updateContextKeys();
459 this.selectionService.onSelectionChanged(updateContextKeys);
460 }
461 registerMenus(registry) {
462 registry.registerSubmenu(CommonMenus.FILE, nls_1.nls.localizeByDefault('File'));
463 registry.registerSubmenu(CommonMenus.EDIT, nls_1.nls.localizeByDefault('Edit'));
464 registry.registerSubmenu(CommonMenus.VIEW, nls_1.nls.localizeByDefault('View'));
465 registry.registerSubmenu(CommonMenus.HELP, nls_1.nls.localizeByDefault('Help'));
466 registry.registerMenuAction(CommonMenus.FILE_SAVE, {
467 commandId: CommonCommands.SAVE.id
468 });
469 registry.registerMenuAction(CommonMenus.FILE_SAVE, {
470 commandId: CommonCommands.SAVE_ALL.id
471 });
472 registry.registerMenuAction(CommonMenus.FILE_AUTOSAVE, {
473 commandId: CommonCommands.AUTO_SAVE.id
474 });
475 registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls_1.nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY));
476 registry.registerMenuAction(CommonMenus.EDIT_UNDO, {
477 commandId: CommonCommands.UNDO.id,
478 order: '0'
479 });
480 registry.registerMenuAction(CommonMenus.EDIT_UNDO, {
481 commandId: CommonCommands.REDO.id,
482 order: '1'
483 });
484 registry.registerMenuAction(CommonMenus.EDIT_FIND, {
485 commandId: CommonCommands.FIND.id,
486 order: '0'
487 });
488 registry.registerMenuAction(CommonMenus.EDIT_FIND, {
489 commandId: CommonCommands.REPLACE.id,
490 order: '1'
491 });
492 registry.registerMenuAction(CommonMenus.EDIT_CLIPBOARD, {
493 commandId: CommonCommands.CUT.id,
494 order: '0'
495 });
496 registry.registerMenuAction(CommonMenus.EDIT_CLIPBOARD, {
497 commandId: CommonCommands.COPY.id,
498 order: '1'
499 });
500 registry.registerMenuAction(CommonMenus.EDIT_CLIPBOARD, {
501 commandId: CommonCommands.PASTE.id,
502 order: '2'
503 });
504 registry.registerMenuAction(CommonMenus.EDIT_CLIPBOARD, {
505 commandId: CommonCommands.COPY_PATH.id,
506 order: '3'
507 });
508 registry.registerMenuAction(CommonMenus.VIEW_APPEARANCE_SUBMENU_BAR, {
509 commandId: CommonCommands.TOGGLE_BOTTOM_PANEL.id,
510 order: '1'
511 });
512 registry.registerMenuAction(CommonMenus.VIEW_APPEARANCE_SUBMENU_BAR, {
513 commandId: CommonCommands.TOGGLE_STATUS_BAR.id,
514 order: '2',
515 label: nls_1.nls.localizeByDefault('Toggle Status Bar Visibility')
516 });
517 registry.registerMenuAction(CommonMenus.VIEW_APPEARANCE_SUBMENU_BAR, {
518 commandId: CommonCommands.COLLAPSE_ALL_PANELS.id,
519 order: '3'
520 });
521 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
522 commandId: CommonCommands.CLOSE_TAB.id,
523 label: nls_1.nls.localizeByDefault('Close'),
524 order: '0'
525 });
526 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
527 commandId: CommonCommands.CLOSE_OTHER_TABS.id,
528 label: nls_1.nls.localizeByDefault('Close Others'),
529 order: '1'
530 });
531 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
532 commandId: CommonCommands.CLOSE_RIGHT_TABS.id,
533 label: nls_1.nls.localizeByDefault('Close to the Right'),
534 order: '2'
535 });
536 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
537 commandId: CommonCommands.CLOSE_SAVED_TABS.id,
538 label: nls_1.nls.localizeByDefault('Close Saved'),
539 order: '3',
540 });
541 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
542 commandId: CommonCommands.CLOSE_ALL_TABS.id,
543 label: nls_1.nls.localizeByDefault('Close All'),
544 order: '4'
545 });
546 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
547 commandId: CommonCommands.COLLAPSE_PANEL.id,
548 label: CommonCommands.COLLAPSE_PANEL.label,
549 order: '5'
550 });
551 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
552 commandId: CommonCommands.TOGGLE_MAXIMIZED.id,
553 label: CommonCommands.TOGGLE_MAXIMIZED.label,
554 order: '6'
555 });
556 registry.registerMenuAction(CommonMenus.VIEW_APPEARANCE_SUBMENU_SCREEN, {
557 commandId: CommonCommands.TOGGLE_MAXIMIZED.id,
558 label: CommonCommands.TOGGLE_MAXIMIZED.label,
559 order: '6'
560 });
561 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_COPY, {
562 commandId: CommonCommands.COPY_PATH.id,
563 label: CommonCommands.COPY_PATH.label,
564 order: '1',
565 });
566 registry.registerMenuAction(CommonMenus.VIEW_APPEARANCE_SUBMENU_BAR, {
567 commandId: CommonCommands.SHOW_MENU_BAR.id,
568 label: nls_1.nls.localizeByDefault('Toggle Menu Bar'),
569 order: '0'
570 });
571 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_PIN, {
572 commandId: CommonCommands.PIN_TAB.id,
573 label: nls_1.nls.localizeByDefault('Pin'),
574 order: '7'
575 });
576 registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_PIN, {
577 commandId: CommonCommands.UNPIN_TAB.id,
578 label: nls_1.nls.localizeByDefault('Unpin'),
579 order: '8'
580 });
581 registry.registerMenuAction(CommonMenus.HELP, {
582 commandId: CommonCommands.ABOUT_COMMAND.id,
583 label: CommonCommands.ABOUT_COMMAND.label,
584 order: '9'
585 });
586 registry.registerMenuAction(CommonMenus.VIEW_PRIMARY, {
587 commandId: CommonCommands.OPEN_VIEW.id
588 });
589 registry.registerMenuAction(CommonMenus.FILE_SETTINGS_SUBMENU_THEME, {
590 commandId: CommonCommands.SELECT_COLOR_THEME.id
591 });
592 registry.registerMenuAction(CommonMenus.FILE_SETTINGS_SUBMENU_THEME, {
593 commandId: CommonCommands.SELECT_ICON_THEME.id
594 });
595 registry.registerMenuAction(CommonMenus.SETTINGS__THEME, {
596 commandId: CommonCommands.SELECT_COLOR_THEME.id
597 });
598 registry.registerMenuAction(CommonMenus.SETTINGS__THEME, {
599 commandId: CommonCommands.SELECT_ICON_THEME.id
600 });
601 registry.registerSubmenu(CommonMenus.VIEW_APPEARANCE_SUBMENU, nls_1.nls.localizeByDefault('Appearance'));
602 registry.registerMenuAction(CommonMenus.FILE_NEW, {
603 commandId: CommonCommands.NEW_UNTITLED_FILE.id,
604 label: nls_1.nls.localizeByDefault('New File'),
605 order: 'a'
606 });
607 }
608 registerCommands(commandRegistry) {
609 commandRegistry.registerCommand(CommonCommands.OPEN, uri_command_handler_1.UriAwareCommandHandler.MultiSelect(this.selectionService, {
610 execute: uris => uris.map(uri => (0, opener_service_1.open)(this.openerService, uri)),
611 }));
612 commandRegistry.registerCommand(CommonCommands.CUT, {
613 execute: () => {
614 if (exports.supportCut) {
615 document.execCommand('cut');
616 }
617 else {
618 this.messageService.warn("Please use the browser's cut command or shortcut.");
619 }
620 }
621 });
622 commandRegistry.registerCommand(CommonCommands.COPY, {
623 execute: () => {
624 if (exports.supportCopy) {
625 document.execCommand('copy');
626 }
627 else {
628 this.messageService.warn("Please use the browser's copy command or shortcut.");
629 }
630 }
631 });
632 commandRegistry.registerCommand(CommonCommands.PASTE, {
633 execute: () => {
634 if (exports.supportPaste) {
635 document.execCommand('paste');
636 }
637 else {
638 this.messageService.warn("Please use the browser's paste command or shortcut.");
639 }
640 }
641 });
642 commandRegistry.registerCommand(CommonCommands.COPY_PATH, uri_command_handler_1.UriAwareCommandHandler.MultiSelect(this.selectionService, {
643 isVisible: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
644 isEnabled: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
645 execute: async (uris) => {
646 if (uris.length) {
647 const lineDelimiter = os_1.isWindows ? '\r\n' : '\n';
648 const text = uris.map(resource => resource.path.fsPath()).join(lineDelimiter);
649 await this.clipboardService.writeText(text);
650 }
651 else {
652 await this.messageService.info('Open a file first to copy its path');
653 }
654 }
655 }));
656 commandRegistry.registerCommand(CommonCommands.UNDO, {
657 execute: () => document.execCommand('undo')
658 });
659 commandRegistry.registerCommand(CommonCommands.REDO, {
660 execute: () => document.execCommand('redo')
661 });
662 commandRegistry.registerCommand(CommonCommands.SELECT_ALL, {
663 execute: () => document.execCommand('selectAll')
664 });
665 commandRegistry.registerCommand(CommonCommands.FIND, {
666 execute: () => { }
667 });
668 commandRegistry.registerCommand(CommonCommands.REPLACE, {
669 execute: () => { }
670 });
671 commandRegistry.registerCommand(CommonCommands.NEXT_TAB, {
672 isEnabled: () => this.shell.currentTabBar !== undefined,
673 execute: () => this.shell.activateNextTab()
674 });
675 commandRegistry.registerCommand(CommonCommands.PREVIOUS_TAB, {
676 isEnabled: () => this.shell.currentTabBar !== undefined,
677 execute: () => this.shell.activatePreviousTab()
678 });
679 commandRegistry.registerCommand(CommonCommands.NEXT_TAB_IN_GROUP, {
680 isEnabled: () => this.shell.nextTabIndexInTabBar() !== -1,
681 execute: () => this.shell.activateNextTabInTabBar()
682 });
683 commandRegistry.registerCommand(CommonCommands.PREVIOUS_TAB_IN_GROUP, {
684 isEnabled: () => this.shell.previousTabIndexInTabBar() !== -1,
685 execute: () => this.shell.activatePreviousTabInTabBar()
686 });
687 commandRegistry.registerCommand(CommonCommands.NEXT_TAB_GROUP, {
688 isEnabled: () => this.shell.nextTabBar() !== undefined,
689 execute: () => this.shell.activateNextTabBar()
690 });
691 commandRegistry.registerCommand(CommonCommands.PREVIOUS_TAB_GROUP, {
692 isEnabled: () => this.shell.previousTabBar() !== undefined,
693 execute: () => this.shell.activatePreviousTabBar()
694 });
695 commandRegistry.registerCommand(CommonCommands.CLOSE_TAB, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
696 isEnabled: title => Boolean(title === null || title === void 0 ? void 0 : title.closable),
697 execute: (title, tabBar) => tabBar && this.shell.closeTabs(tabBar, candidate => candidate === title),
698 }));
699 commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
700 isEnabled: (title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate !== title && candidate.closable)),
701 execute: (title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate !== title && candidate.closable),
702 }));
703 commandRegistry.registerCommand(CommonCommands.CLOSE_SAVED_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
704 isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner))),
705 execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner)),
706 }));
707 commandRegistry.registerCommand(CommonCommands.CLOSE_RIGHT_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
708 isEnabled: (title, tabbar) => {
709 let targetSeen = false;
710 return Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => {
711 if (targetSeen && candidate.closable) {
712 return true;
713 }
714 ;
715 if (candidate === title) {
716 targetSeen = true;
717 }
718 ;
719 }));
720 },
721 isVisible: (_title, tabbar) => {
722 var _a;
723 const area = (_a = (tabbar && this.shell.getAreaFor(tabbar))) !== null && _a !== void 0 ? _a : this.shell.currentTabArea;
724 return area !== undefined && area !== 'left' && area !== 'right';
725 },
726 execute: (title, tabbar) => {
727 if (tabbar) {
728 let targetSeen = false;
729 this.shell.closeTabs(tabbar, candidate => {
730 if (targetSeen && candidate.closable) {
731 return true;
732 }
733 ;
734 if (candidate === title) {
735 targetSeen = true;
736 }
737 ;
738 return false;
739 });
740 }
741 }
742 }));
743 commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
744 isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(title => title.closable)),
745 execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable),
746 }));
747 commandRegistry.registerCommand(CommonCommands.CLOSE_MAIN_TAB, {
748 isEnabled: () => {
749 const currentWidget = this.shell.getCurrentWidget('main');
750 return currentWidget !== undefined && currentWidget.title.closable;
751 },
752 execute: () => this.shell.getCurrentWidget('main').close()
753 });
754 commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_MAIN_TABS, {
755 isEnabled: () => {
756 const currentWidget = this.shell.getCurrentWidget('main');
757 return currentWidget !== undefined &&
758 this.shell.mainAreaTabBars.some(tb => tb.titles.some(title => title.owner !== currentWidget && title.closable));
759 },
760 execute: () => {
761 const currentWidget = this.shell.getCurrentWidget('main');
762 this.shell.closeTabs('main', title => title.owner !== currentWidget && title.closable);
763 }
764 });
765 commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_MAIN_TABS, {
766 isEnabled: () => this.shell.mainAreaTabBars.some(tb => tb.titles.some(title => title.closable)),
767 execute: () => this.shell.closeTabs('main', title => title.closable)
768 });
769 commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
770 isEnabled: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
771 isVisible: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
772 execute: (_title, tabbar) => tabbar && this.shell.collapsePanel(this.shell.getAreaFor(tabbar))
773 }));
774 commandRegistry.registerCommand(CommonCommands.COLLAPSE_ALL_PANELS, {
775 execute: () => {
776 this.shell.collapsePanel('left');
777 this.shell.collapsePanel('right');
778 this.shell.collapsePanel('bottom');
779 }
780 });
781 commandRegistry.registerCommand(CommonCommands.TOGGLE_BOTTOM_PANEL, {
782 isEnabled: () => this.shell.getWidgets('bottom').length > 0,
783 execute: () => {
784 if (this.shell.isExpanded('bottom')) {
785 this.shell.collapsePanel('bottom');
786 }
787 else {
788 this.shell.expandPanel('bottom');
789 }
790 }
791 });
792 commandRegistry.registerCommand(CommonCommands.TOGGLE_STATUS_BAR, {
793 execute: () => this.preferenceService.updateValue('workbench.statusBar.visible', !this.preferences['workbench.statusBar.visible'])
794 });
795 commandRegistry.registerCommand(CommonCommands.TOGGLE_MAXIMIZED, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
796 isEnabled: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
797 isVisible: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
798 execute: title => (title === null || title === void 0 ? void 0 : title.owner) && this.shell.toggleMaximized(title === null || title === void 0 ? void 0 : title.owner),
799 }));
800 commandRegistry.registerCommand(CommonCommands.SHOW_MENU_BAR, {
801 isEnabled: () => !os_1.isOSX,
802 isVisible: () => !os_1.isOSX,
803 execute: () => {
804 const menuBarVisibility = 'window.menuBarVisibility';
805 const visibility = this.preferences[menuBarVisibility];
806 if (visibility !== 'compact') {
807 this.preferenceService.updateValue(menuBarVisibility, 'compact');
808 }
809 else {
810 this.preferenceService.updateValue(menuBarVisibility, 'classic');
811 }
812 }
813 });
814 commandRegistry.registerCommand(CommonCommands.SAVE, {
815 execute: () => this.save({ formatType: 1 /* ON */ })
816 });
817 commandRegistry.registerCommand(CommonCommands.SAVE_AS, {
818 isEnabled: () => this.saveResourceService.canSaveAs(this.shell.currentWidget),
819 execute: () => {
820 const { currentWidget } = this.shell;
821 // No clue what could have happened between `isEnabled` and `execute`
822 // when fetching currentWidget, so better to double-check:
823 if (this.saveResourceService.canSaveAs(currentWidget)) {
824 this.saveResourceService.saveAs(currentWidget);
825 }
826 else {
827 this.messageService.error(nls_1.nls.localize('theia/workspace/failSaveAs', 'Cannot run "{0}" for the current widget.', CommonCommands.SAVE_AS.label));
828 }
829 },
830 });
831 commandRegistry.registerCommand(CommonCommands.SAVE_WITHOUT_FORMATTING, {
832 execute: () => this.save({ formatType: 2 /* OFF */ })
833 });
834 commandRegistry.registerCommand(CommonCommands.SAVE_ALL, {
835 execute: () => this.shell.saveAll({ formatType: 3 /* DIRTY */ })
836 });
837 commandRegistry.registerCommand(CommonCommands.ABOUT_COMMAND, {
838 execute: () => this.openAbout()
839 });
840 commandRegistry.registerCommand(CommonCommands.OPEN_VIEW, {
841 execute: () => { var _a; return (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.open(quick_view_service_1.QuickViewService.PREFIX); }
842 });
843 commandRegistry.registerCommand(CommonCommands.SELECT_COLOR_THEME, {
844 execute: () => this.selectColorTheme()
845 });
846 commandRegistry.registerCommand(CommonCommands.SELECT_ICON_THEME, {
847 execute: () => this.selectIconTheme()
848 });
849 commandRegistry.registerCommand(CommonCommands.PIN_TAB, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
850 isEnabled: title => Boolean(title && !(0, widgets_1.isPinned)(title)),
851 execute: title => this.togglePinned(title),
852 }));
853 commandRegistry.registerCommand(CommonCommands.UNPIN_TAB, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
854 isEnabled: title => Boolean(title && (0, widgets_1.isPinned)(title)),
855 execute: title => this.togglePinned(title),
856 }));
857 commandRegistry.registerCommand(CommonCommands.CONFIGURE_DISPLAY_LANGUAGE, {
858 execute: () => this.configureDisplayLanguage()
859 });
860 commandRegistry.registerCommand(CommonCommands.TOGGLE_BREADCRUMBS, {
861 execute: () => this.toggleBreadcrumbs(),
862 isToggled: () => this.isBreadcrumbsEnabled(),
863 });
864 commandRegistry.registerCommand(CommonCommands.NEW_UNTITLED_FILE, {
865 execute: async () => {
866 const untitledUri = this.untitledResourceResolver.createUntitledURI('', await this.workingDirProvider.getUserWorkingDir());
867 this.untitledResourceResolver.resolve(untitledUri);
868 return (0, opener_service_1.open)(this.openerService, untitledUri);
869 }
870 });
871 for (const [index, ordinal] of this.getOrdinalNumbers().entries()) {
872 commandRegistry.registerCommand({ id: `workbench.action.focus${ordinal}EditorGroup`, label: index === 0 ? nls_1.nls.localizeByDefault('Focus First Editor Group') : '', category: nls_1.nls.localize(CommonCommands.VIEW_CATEGORY_KEY, CommonCommands.VIEW_CATEGORY) }, {
873 isEnabled: () => this.shell.mainAreaTabBars.length > index,
874 execute: () => {
875 var _a, _b;
876 const widget = (_b = (_a = this.shell.mainAreaTabBars[index]) === null || _a === void 0 ? void 0 : _a.currentTitle) === null || _b === void 0 ? void 0 : _b.owner;
877 if (widget) {
878 this.shell.activateWidget(widget.id);
879 }
880 }
881 });
882 }
883 }
884 getOrdinalNumbers() {
885 return ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth', 'Seventh', 'Eighth', 'Ninth'];
886 }
887 isElectron() {
888 return environment_1.environment.electron.is();
889 }
890 togglePinned(title) {
891 if (title) {
892 (0, widgets_1.togglePinned)(title);
893 this.updatePinnedKey();
894 }
895 }
896 registerKeybindings(registry) {
897 if (exports.supportCut) {
898 registry.registerKeybinding({
899 command: CommonCommands.CUT.id,
900 keybinding: 'ctrlcmd+x'
901 });
902 }
903 if (exports.supportCopy) {
904 registry.registerKeybinding({
905 command: CommonCommands.COPY.id,
906 keybinding: 'ctrlcmd+c'
907 });
908 }
909 if (exports.supportPaste) {
910 registry.registerKeybinding({
911 command: CommonCommands.PASTE.id,
912 keybinding: 'ctrlcmd+v'
913 });
914 }
915 registry.registerKeybinding({
916 command: CommonCommands.COPY_PATH.id,
917 keybinding: os_1.isWindows ? 'shift+alt+c' : 'ctrlcmd+alt+c',
918 when: '!editorFocus'
919 });
920 registry.registerKeybindings(
921 // Edition
922 {
923 command: CommonCommands.UNDO.id,
924 keybinding: 'ctrlcmd+z'
925 }, {
926 command: CommonCommands.REDO.id,
927 keybinding: 'ctrlcmd+shift+z'
928 }, {
929 command: CommonCommands.SELECT_ALL.id,
930 keybinding: 'ctrlcmd+a'
931 }, {
932 command: CommonCommands.FIND.id,
933 keybinding: 'ctrlcmd+f'
934 }, {
935 command: CommonCommands.REPLACE.id,
936 keybinding: 'ctrlcmd+alt+f'
937 },
938 // Tabs
939 {
940 command: CommonCommands.NEXT_TAB.id,
941 keybinding: 'ctrlcmd+tab'
942 }, {
943 command: CommonCommands.NEXT_TAB.id,
944 keybinding: 'ctrlcmd+alt+d'
945 }, {
946 command: CommonCommands.PREVIOUS_TAB.id,
947 keybinding: 'ctrlcmd+shift+tab'
948 }, {
949 command: CommonCommands.PREVIOUS_TAB.id,
950 keybinding: 'ctrlcmd+alt+a'
951 }, {
952 command: CommonCommands.CLOSE_MAIN_TAB.id,
953 keybinding: this.isElectron() ? (os_1.isWindows ? 'ctrl+f4' : 'ctrlcmd+w') : 'alt+w'
954 }, {
955 command: CommonCommands.CLOSE_OTHER_MAIN_TABS.id,
956 keybinding: 'ctrlcmd+alt+t'
957 }, {
958 command: CommonCommands.CLOSE_ALL_MAIN_TABS.id,
959 keybinding: this.isElectron() ? 'ctrlCmd+k ctrlCmd+w' : 'alt+shift+w'
960 },
961 // Panels
962 {
963 command: CommonCommands.COLLAPSE_PANEL.id,
964 keybinding: 'alt+c'
965 }, {
966 command: CommonCommands.TOGGLE_BOTTOM_PANEL.id,
967 keybinding: 'ctrlcmd+j',
968 }, {
969 command: CommonCommands.COLLAPSE_ALL_PANELS.id,
970 keybinding: 'alt+shift+c',
971 }, {
972 command: CommonCommands.TOGGLE_MAXIMIZED.id,
973 keybinding: 'alt+m',
974 },
975 // Saving
976 {
977 command: CommonCommands.SAVE.id,
978 keybinding: 'ctrlcmd+s'
979 }, {
980 command: CommonCommands.SAVE_WITHOUT_FORMATTING.id,
981 keybinding: 'ctrlcmd+k s'
982 }, {
983 command: CommonCommands.SAVE_ALL.id,
984 keybinding: 'ctrlcmd+alt+s'
985 },
986 // Theming
987 {
988 command: CommonCommands.SELECT_COLOR_THEME.id,
989 keybinding: 'ctrlcmd+k ctrlcmd+t'
990 }, {
991 command: CommonCommands.PIN_TAB.id,
992 keybinding: 'ctrlcmd+k shift+enter',
993 when: '!activeEditorIsPinned'
994 }, {
995 command: CommonCommands.UNPIN_TAB.id,
996 keybinding: 'ctrlcmd+k shift+enter',
997 when: 'activeEditorIsPinned'
998 }, {
999 command: CommonCommands.NEW_UNTITLED_FILE.id,
1000 keybinding: this.isElectron() ? 'ctrlcmd+n' : 'alt+n',
1001 });
1002 for (const [index, ordinal] of this.getOrdinalNumbers().entries()) {
1003 registry.registerKeybinding({
1004 command: `workbench.action.focus${ordinal}EditorGroup`,
1005 keybinding: `ctrlcmd+${(index + 1) % 10}`,
1006 });
1007 }
1008 }
1009 async save(options) {
1010 const widget = this.shell.currentWidget;
1011 this.saveResourceService.save(widget, options);
1012 }
1013 async openAbout() {
1014 this.aboutDialog.open();
1015 }
1016 /**
1017 * registers event listener which make sure that
1018 * window doesn't get closed if CMD/CTRL W is pressed.
1019 * Too many users have that in their muscle memory.
1020 * Chrome doesn't let us rebind or prevent default the keybinding, so this
1021 * at least doesn't close the window immediately.
1022 */
1023 registerCtrlWHandling() {
1024 function isCtrlCmd(event) {
1025 return (os_1.isOSX && event.metaKey) || (!os_1.isOSX && event.ctrlKey);
1026 }
1027 window.document.addEventListener('keydown', event => {
1028 this.shouldPreventClose = isCtrlCmd(event) && event.code === 'KeyW';
1029 });
1030 window.document.addEventListener('keyup', () => {
1031 this.shouldPreventClose = false;
1032 });
1033 }
1034 onWillStop() {
1035 try {
1036 if (this.shouldPreventClose || this.shell.canSaveAll()) {
1037 return { reason: 'Dirty editors present', action: () => (0, dialogs_1.confirmExit)() };
1038 }
1039 }
1040 finally {
1041 this.shouldPreventClose = false;
1042 }
1043 }
1044 async configureDisplayLanguage() {
1045 const languageId = await this.languageQuickPickService.pickDisplayLanguage();
1046 if (languageId && !nls_1.nls.isSelectedLocale(languageId) && await this.confirmRestart()) {
1047 nls_1.nls.setLocale(languageId);
1048 this.windowService.setSafeToShutDown();
1049 this.windowService.reload();
1050 }
1051 }
1052 toggleBreadcrumbs() {
1053 const value = this.preferenceService.get('breadcrumbs.enabled');
1054 this.preferenceService.set('breadcrumbs.enabled', !value, preferences_1.PreferenceScope.User);
1055 }
1056 isBreadcrumbsEnabled() {
1057 return !!this.preferenceService.get('breadcrumbs.enabled');
1058 }
1059 async confirmRestart() {
1060 const shouldRestart = await new dialogs_1.ConfirmDialog({
1061 title: nls_1.nls.localizeByDefault('A restart is required for the change in display language to take effect.'),
1062 msg: nls_1.nls.localizeByDefault('Press the restart button to restart {0} and change the display language.', frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName),
1063 ok: nls_1.nls.localizeByDefault('Restart'),
1064 cancel: dialogs_1.Dialog.CANCEL,
1065 }).open();
1066 return shouldRestart === true;
1067 }
1068 selectIconTheme() {
1069 var _a;
1070 let resetTo = this.iconThemes.getCurrent();
1071 const setTheme = (id, persist) => {
1072 const theme = this.iconThemes.getDefinition(id);
1073 if (theme) {
1074 this.iconThemes.setCurrent(theme, persist);
1075 }
1076 };
1077 const previewTheme = debounce(setTheme, 200);
1078 let items = [];
1079 for (const iconTheme of this.iconThemes.definitions) {
1080 items.push({
1081 id: iconTheme.id,
1082 label: iconTheme.label,
1083 description: iconTheme.description,
1084 });
1085 }
1086 items = items.sort((a, b) => {
1087 if (a.id === 'none') {
1088 return -1;
1089 }
1090 return a.label.localeCompare(b.label);
1091 });
1092 (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
1093 placeholder: nls_1.nls.localizeByDefault('Select File Icon Theme'),
1094 activeItem: items.find(item => item.id === (resetTo === null || resetTo === void 0 ? void 0 : resetTo.id)),
1095 onDidChangeSelection: (_, selectedItems) => {
1096 resetTo = undefined;
1097 setTheme(selectedItems[0].id, true);
1098 },
1099 onDidChangeActive: (_, activeItems) => {
1100 previewTheme(activeItems[0].id, false);
1101 },
1102 onDidHide: () => {
1103 if (resetTo) {
1104 this.iconThemes.setCurrent(resetTo, false);
1105 }
1106 }
1107 });
1108 }
1109 selectColorTheme() {
1110 var _a;
1111 let resetTo = this.themeService.getCurrentTheme().id;
1112 const setTheme = (id, persist) => this.themeService.setCurrentTheme(id, persist);
1113 const previewTheme = debounce(setTheme, 200);
1114 const itemsByTheme = { light: [], dark: [], hc: [], hcLight: [] };
1115 const lightThemesSeparator = nls_1.nls.localizeByDefault('light themes');
1116 const darkThemesSeparator = nls_1.nls.localizeByDefault('dark themes');
1117 const highContrastThemesSeparator = nls_1.nls.localizeByDefault('high contrast themes');
1118 for (const theme of this.themeService.getThemes().sort((a, b) => a.label.localeCompare(b.label))) {
1119 const themeItems = itemsByTheme[theme.type];
1120 // Add a separator for the first item in the respective group.
1121 // High Contrast Themes despite dark or light should be grouped together.
1122 if (themeItems.length === 0 && theme.type !== 'hcLight') {
1123 let label = '';
1124 if (theme.type === 'light') {
1125 label = lightThemesSeparator;
1126 }
1127 else if (theme.type === 'dark') {
1128 label = darkThemesSeparator;
1129 }
1130 else {
1131 label = highContrastThemesSeparator;
1132 }
1133 themeItems.push({
1134 type: 'separator',
1135 label
1136 });
1137 }
1138 themeItems.push({
1139 id: theme.id,
1140 label: theme.label,
1141 description: theme.description,
1142 });
1143 }
1144 const items = [...itemsByTheme.light, ...itemsByTheme.dark, ...itemsByTheme.hc, ...itemsByTheme.hcLight];
1145 (_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
1146 placeholder: nls_1.nls.localizeByDefault('Select Color Theme (Up/Down Keys to Preview)'),
1147 activeItem: items.find(item => item.id === resetTo),
1148 onDidChangeSelection: (_, selectedItems) => {
1149 resetTo = undefined;
1150 setTheme(selectedItems[0].id, true);
1151 },
1152 onDidChangeActive: (_, activeItems) => {
1153 previewTheme(activeItems[0].id, false);
1154 },
1155 onDidHide: () => {
1156 if (resetTo) {
1157 setTheme(resetTo, false);
1158 }
1159 }
1160 });
1161 }
1162 registerColors(colors) {
1163 colors.register(
1164 // Base Colors should be aligned with https://code.visualstudio.com/api/references/theme-color#base-colors
1165 // if not yet contributed by Monaco, check runtime css variables to learn
1166 { id: 'selection.background', defaults: { dark: '#217daf', light: '#c0dbf1' }, description: 'Overall border color for focused elements. This color is only used if not overridden by a component.' }, { id: 'icon.foreground', defaults: { dark: '#C5C5C5', light: '#424242', hcDark: '#FFFFFF', hcLight: '#292929' }, description: 'The default color for icons in the workbench.' }, { id: 'sash.hoverBorder', defaults: { dark: color_1.Color.transparent('focusBorder', 0.99), light: color_1.Color.transparent('focusBorder', 0.99), hcDark: 'focusBorder', hcLight: 'focusBorder' }, description: 'The hover border color for draggable sashes.' }, { id: 'sash.activeBorder', defaults: { dark: 'focusBorder', light: 'focusBorder', hcDark: 'focusBorder' }, description: 'The active border color for draggable sashes.' },
1167 // Window border colors should be aligned with https://code.visualstudio.com/api/references/theme-color#window-border
1168 {
1169 id: 'window.activeBorder', defaults: {
1170 hcDark: 'contrastBorder',
1171 hcLight: 'contrastBorder'
1172 }, description: 'The color used for the border of the window when it is active.'
1173 }, {
1174 id: 'window.inactiveBorder', defaults: {
1175 hcDark: 'contrastBorder',
1176 hcLight: 'contrastBorder'
1177 },
1178 description: 'The color used for the border of the window when it is inactive.'
1179 },
1180 // Buttons should be aligned with https://code.visualstudio.com/api/references/theme-color#button-control
1181 // if not yet contributed by Monaco, check runtime css variables to learn
1182 { id: 'button.foreground', defaults: { dark: color_1.Color.white, light: color_1.Color.white, hcDark: color_1.Color.white, hcLight: color_1.Color.white }, description: 'Button foreground color.' }, { id: 'button.background', defaults: { dark: '#0E639C', light: '#007ACC', hcDark: undefined, hcLight: '#0F4A85' }, description: 'Button background color.' }, { id: 'button.hoverBackground', defaults: { dark: color_1.Color.lighten('button.background', 0.2), light: color_1.Color.darken('button.background', 0.2) }, description: 'Button background color when hovering.' },
1183 // Activity Bar colors should be aligned with https://code.visualstudio.com/api/references/theme-color#activity-bar
1184 {
1185 id: 'activityBar.background', defaults: {
1186 dark: '#333333',
1187 light: '#2C2C2C',
1188 hcDark: '#000000',
1189 hcLight: '#FFFFFF'
1190 }, description: 'Activity bar background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1191 }, {
1192 id: 'activityBar.foreground', defaults: {
1193 dark: color_1.Color.white,
1194 light: color_1.Color.white,
1195 hcDark: color_1.Color.white,
1196 hcLight: 'editor.foreground'
1197 }, description: 'Activity bar item foreground color when it is active. The activity bar is showing on the far left or right and allows to switch between views of the side bar.',
1198 }, {
1199 id: 'activityBar.inactiveForeground', defaults: {
1200 dark: color_1.Color.transparent('activityBar.foreground', 0.4),
1201 light: color_1.Color.transparent('activityBar.foreground', 0.4),
1202 hcDark: color_1.Color.white,
1203 hcLight: 'editor.foreground'
1204 }, description: 'Activity bar item foreground color when it is inactive. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1205 }, {
1206 id: 'activityBar.border', defaults: {
1207 hcDark: 'contrastBorder',
1208 hcLight: 'contrastBorder'
1209 }, description: 'Activity bar border color separating to the side bar. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1210 }, {
1211 id: 'activityBar.activeBorder', defaults: {
1212 dark: 'activityBar.foreground',
1213 light: 'activityBar.foreground',
1214 hcLight: 'contrastBorder'
1215 }, description: 'Activity bar border color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1216 }, {
1217 id: 'activityBar.activeFocusBorder', defaults: {
1218 hcLight: '#B5200D'
1219 }, description: 'Activity bar focus border color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1220 }, { id: 'activityBar.activeBackground', description: 'Activity bar background color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.' }, {
1221 id: 'activityBar.dropBackground', defaults: {
1222 dark: color_1.Color.transparent('#ffffff', 0.12),
1223 light: color_1.Color.transparent('#ffffff', 0.12),
1224 hcDark: color_1.Color.transparent('#ffffff', 0.12),
1225 }, description: 'Drag and drop feedback color for the activity bar items. The color should have transparency so that the activity bar entries can still shine through. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1226 }, {
1227 id: 'activityBarBadge.background', defaults: {
1228 dark: '#007ACC',
1229 light: '#007ACC',
1230 hcDark: '#000000',
1231 hcLight: '#0F4A85'
1232 }, description: 'Activity notification badge background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1233 }, {
1234 id: 'activityBarBadge.foreground', defaults: {
1235 dark: color_1.Color.white,
1236 light: color_1.Color.white,
1237 hcDark: color_1.Color.white,
1238 hcLight: color_1.Color.white
1239 }, description: 'Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.'
1240 },
1241 // Side Bar should be aligned with https://code.visualstudio.com/api/references/theme-color#side-bar
1242 // if not yet contributed by Monaco, check runtime css variables to learn
1243 { id: 'sideBar.background', defaults: { dark: '#252526', light: '#F3F3F3', hcDark: '#000000', hcLight: '#FFFFFF' }, description: 'Side bar background color. The side bar is the container for views like explorer and search.' }, { id: 'sideBar.foreground', description: 'Side bar foreground color. The side bar is the container for views like explorer and search.' }, { id: 'sideBarSectionHeader.background', defaults: { dark: '#80808033', light: '#80808033' }, description: 'Side bar section header background color. The side bar is the container for views like explorer and search.' }, { id: 'sideBarSectionHeader.foreground', description: 'Side bar foreground color. The side bar is the container for views like explorer and search.' }, { id: 'sideBarSectionHeader.border', defaults: { dark: 'contrastBorder', light: 'contrastBorder', hcDark: 'contrastBorder', hcLight: 'contrastBorder' }, description: 'Side bar section header border color. The side bar is the container for views like explorer and search.' },
1244 // Lists and Trees colors should be aligned with https://code.visualstudio.com/api/references/theme-color#lists-and-trees
1245 // if not yet contributed by Monaco, check runtime css variables to learn.
1246 // TODO: Following are not yet supported/no respective elements in theia:
1247 // list.focusBackground, list.focusForeground, list.inactiveFocusBackground, list.filterMatchBorder,
1248 // list.dropBackground, listFilterWidget.outline, listFilterWidget.noMatchesOutline
1249 // list.invalidItemForeground => tree node needs an respective class
1250 { id: 'list.activeSelectionBackground', defaults: { dark: '#094771', light: '#0074E8', hcLight: color_1.Color.transparent('#0F4A85', 0.1) }, description: 'List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.' }, { id: 'list.activeSelectionForeground', defaults: { dark: '#FFF', light: '#FFF' }, description: 'List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.' }, { id: 'list.inactiveSelectionBackground', defaults: { dark: '#37373D', light: '#E4E6F1', hcLight: color_1.Color.transparent('#0F4A85', 0.1) }, description: 'List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.' }, { id: 'list.inactiveSelectionForeground', description: 'List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.' }, { id: 'list.hoverBackground', defaults: { dark: '#2A2D2E', light: '#F0F0F0', hcLight: color_1.Color.transparent('#0F4A85', 0.1) }, description: 'List/Tree background when hovering over items using the mouse.' }, { id: 'list.hoverForeground', description: 'List/Tree foreground when hovering over items using the mouse.' }, { id: 'list.errorForeground', defaults: { dark: '#F88070', light: '#B01011' }, description: 'Foreground color of list items containing errors.' }, { id: 'list.warningForeground', defaults: { dark: '#CCA700', light: '#855F00' }, description: 'Foreground color of list items containing warnings.' }, { id: 'list.filterMatchBackground', defaults: { dark: 'editor.findMatchHighlightBackground', light: 'editor.findMatchHighlightBackground' }, description: 'Background color of the filtered match.' }, { id: 'list.highlightForeground', defaults: { dark: '#18A3FF', light: '#0066BF', hcDark: 'focusBorder', hcLight: 'focusBorder' }, description: 'List/Tree foreground color of the match highlights when searching inside the list/tree.' }, { id: 'list.focusHighlightForeground', defaults: { dark: 'list.highlightForeground', light: 'list.activeSelectionForeground', hcDark: 'list.highlightForeground', hcLight: 'list.highlightForeground' }, description: 'List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.' }, { id: 'tree.inactiveIndentGuidesStroke', defaults: { dark: color_1.Color.transparent('tree.indentGuidesStroke', 0.4), light: color_1.Color.transparent('tree.indentGuidesStroke', 0.4), hcDark: color_1.Color.transparent('tree.indentGuidesStroke', 0.4) }, description: 'Tree stroke color for the inactive indentation guides.' },
1251 // Editor Group & Tabs colors should be aligned with https://code.visualstudio.com/api/references/theme-color#editor-groups-tabs
1252 {
1253 id: 'editorGroup.border',
1254 defaults: {
1255 dark: '#444444',
1256 light: '#E7E7E7',
1257 hcDark: 'contrastBorder',
1258 hcLight: 'contrastBorder'
1259 },
1260 description: 'Color to separate multiple editor groups from each other. Editor groups are the containers of editors.'
1261 }, {
1262 id: 'editorGroup.dropBackground',
1263 defaults: {
1264 dark: color_1.Color.transparent('#53595D', 0.5),
1265 light: color_1.Color.transparent('#2677CB', 0.18),
1266 hcLight: color_1.Color.transparent('#0F4A85', 0.50)
1267 },
1268 description: 'Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through.'
1269 }, {
1270 id: 'editorGroupHeader.tabsBackground',
1271 defaults: {
1272 dark: '#252526',
1273 light: '#F3F3F3',
1274 },
1275 description: 'Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.'
1276 }, {
1277 id: 'editorGroupHeader.tabsBorder',
1278 defaults: {
1279 hcDark: 'contrastBorder'
1280 },
1281 description: 'Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.'
1282 }, {
1283 id: 'tab.activeBackground',
1284 defaults: {
1285 dark: 'editor.background',
1286 light: 'editor.background',
1287 hcDark: 'editor.background',
1288 hcLight: 'editor.background'
1289 },
1290 description: 'Active tab background color. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1291 }, {
1292 id: 'tab.unfocusedActiveBackground',
1293 defaults: {
1294 dark: 'tab.activeBackground',
1295 light: 'tab.activeBackground',
1296 hcDark: 'tab.activeBackground',
1297 hcLight: 'tab.activeBackground'
1298 },
1299 description: 'Active tab background color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1300 }, {
1301 id: 'tab.inactiveBackground',
1302 defaults: {
1303 dark: '#2D2D2D',
1304 light: '#ECECEC'
1305 },
1306 description: 'Inactive tab background color. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1307 }, {
1308 id: 'tab.activeForeground',
1309 defaults: {
1310 dark: color_1.Color.white,
1311 light: '#333333',
1312 hcDark: color_1.Color.white,
1313 hcLight: '#292929'
1314 }, description: 'Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1315 }, {
1316 id: 'tab.inactiveForeground', defaults: {
1317 dark: color_1.Color.transparent('tab.activeForeground', 0.5),
1318 light: color_1.Color.transparent('tab.activeForeground', 0.7),
1319 hcDark: color_1.Color.white,
1320 hcLight: '#292929'
1321 }, description: 'Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1322 }, {
1323 id: 'tab.unfocusedActiveForeground', defaults: {
1324 dark: color_1.Color.transparent('tab.activeForeground', 0.5),
1325 light: color_1.Color.transparent('tab.activeForeground', 0.7),
1326 hcDark: color_1.Color.white,
1327 hcLight: '#292929'
1328 }, description: 'Active tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1329 }, {
1330 id: 'tab.unfocusedInactiveForeground', defaults: {
1331 dark: color_1.Color.transparent('tab.inactiveForeground', 0.5),
1332 light: color_1.Color.transparent('tab.inactiveForeground', 0.5),
1333 hcDark: color_1.Color.white,
1334 hcLight: '#292929'
1335 }, description: 'Inactive tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1336 }, {
1337 id: 'tab.border', defaults: {
1338 dark: '#252526',
1339 light: '#F3F3F3',
1340 hcDark: 'contrastBorder',
1341 hcLight: 'contrastBorder'
1342 }, description: 'Border to separate tabs from each other. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1343 }, {
1344 id: 'tab.activeBorder',
1345 description: 'Border on the bottom of an active tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1346 }, {
1347 id: 'tab.unfocusedActiveBorder',
1348 defaults: {
1349 dark: color_1.Color.transparent('tab.activeBorder', 0.5),
1350 light: color_1.Color.transparent('tab.activeBorder', 0.7)
1351 },
1352 description: 'Border on the bottom of an active tab in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1353 }, {
1354 id: 'tab.activeBorderTop',
1355 defaults: {
1356 hcLight: '#B5200D'
1357 },
1358 description: 'Border to the top of an active tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1359 }, {
1360 id: 'tab.unfocusedActiveBorderTop', defaults: {
1361 dark: color_1.Color.transparent('tab.activeBorderTop', 0.5),
1362 light: color_1.Color.transparent('tab.activeBorderTop', 0.7),
1363 hcLight: '#B5200D'
1364 }, description: 'Border to the top of an active tab in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1365 }, {
1366 id: 'tab.hoverBackground',
1367 description: 'Tab background color when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1368 }, {
1369 id: 'tab.unfocusedHoverBackground', defaults: {
1370 dark: color_1.Color.transparent('tab.hoverBackground', 0.5),
1371 light: color_1.Color.transparent('tab.hoverBackground', 0.7)
1372 }, description: 'Tab background color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1373 }, {
1374 id: 'tab.hoverBorder',
1375 description: 'Border to highlight tabs when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1376 }, {
1377 id: 'tab.unfocusedHoverBorder', defaults: {
1378 dark: color_1.Color.transparent('tab.hoverBorder', 0.5),
1379 light: color_1.Color.transparent('tab.hoverBorder', 0.7),
1380 hcLight: 'contrastBorder'
1381 }, description: 'Border to highlight tabs in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1382 }, {
1383 id: 'tab.activeModifiedBorder', defaults: {
1384 dark: '#3399CC',
1385 light: '#33AAEE',
1386 hcLight: 'contrastBorder'
1387 }, description: 'Border on the top of modified (dirty) active tabs in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1388 }, {
1389 id: 'tab.inactiveModifiedBorder', defaults: {
1390 dark: color_1.Color.transparent('tab.activeModifiedBorder', 0.5),
1391 light: color_1.Color.transparent('tab.activeModifiedBorder', 0.5),
1392 hcDark: color_1.Color.white,
1393 hcLight: 'contrastBorder'
1394 }, description: 'Border on the top of modified (dirty) inactive tabs in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1395 }, {
1396 id: 'tab.unfocusedActiveModifiedBorder', defaults: {
1397 dark: color_1.Color.transparent('tab.activeModifiedBorder', 0.5),
1398 light: color_1.Color.transparent('tab.activeModifiedBorder', 0.7),
1399 hcDark: color_1.Color.white,
1400 hcLight: 'contrastBorder'
1401 }, description: 'Border on the top of modified (dirty) active tabs in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1402 }, {
1403 id: 'tab.unfocusedInactiveModifiedBorder', defaults: {
1404 dark: color_1.Color.transparent('tab.inactiveModifiedBorder', 0.5),
1405 light: color_1.Color.transparent('tab.inactiveModifiedBorder', 0.5),
1406 hcDark: color_1.Color.white,
1407 hcLight: 'contrastBorder'
1408 }, description: 'Border on the top of modified (dirty) inactive tabs in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.'
1409 },
1410 // Status bar colors should be aligned with https://code.visualstudio.com/api/references/theme-color#status-bar-colors
1411 // Not yet supported:
1412 // statusBarItem.prominentForeground, statusBarItem.prominentBackground, statusBarItem.prominentHoverBackground
1413 {
1414 id: 'statusBar.foreground', defaults: {
1415 dark: '#FFFFFF',
1416 light: '#FFFFFF',
1417 hcDark: '#FFFFFF',
1418 hcLight: 'editor.foreground'
1419 }, description: 'Status bar foreground color when a workspace is opened. The status bar is shown in the bottom of the window.'
1420 }, {
1421 id: 'statusBar.background', defaults: {
1422 dark: '#007ACC',
1423 light: '#007ACC'
1424 }, description: 'Status bar background color when a workspace is opened. The status bar is shown in the bottom of the window.'
1425 }, {
1426 id: 'statusBar.noFolderForeground', defaults: {
1427 dark: 'statusBar.foreground',
1428 light: 'statusBar.foreground',
1429 hcDark: 'statusBar.foreground',
1430 hcLight: 'statusBar.foreground'
1431 }, description: 'Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window.'
1432 }, {
1433 id: 'statusBar.noFolderBackground', defaults: {
1434 dark: '#68217A',
1435 light: '#68217A'
1436 }, description: 'Status bar background color when no folder is opened. The status bar is shown in the bottom of the window.'
1437 }, {
1438 id: 'statusBar.border', defaults: {
1439 hcDark: 'contrastBorder',
1440 hcLight: 'contrastBorder'
1441 }, description: 'Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window.'
1442 }, {
1443 id: 'statusBar.noFolderBorder', defaults: {
1444 dark: 'statusBar.border',
1445 light: 'statusBar.border',
1446 hcDark: 'statusBar.border',
1447 hcLight: 'statusBar.border'
1448 }, description: 'Status bar border color separating to the sidebar and editor when no folder is opened. The status bar is shown in the bottom of the window.'
1449 }, {
1450 id: 'statusBarItem.activeBackground', defaults: {
1451 dark: color_1.Color.rgba(255, 255, 255, 0.18),
1452 light: color_1.Color.rgba(255, 255, 255, 0.18),
1453 hcDark: color_1.Color.rgba(255, 255, 255, 0.18),
1454 hcLight: color_1.Color.rgba(0, 0, 0, 0.18)
1455 }, description: 'Status bar item background color when clicking. The status bar is shown in the bottom of the window.'
1456 }, {
1457 id: 'statusBarItem.hoverBackground', defaults: {
1458 dark: color_1.Color.rgba(255, 255, 255, 0.12),
1459 light: color_1.Color.rgba(255, 255, 255, 0.12),
1460 hcDark: color_1.Color.rgba(255, 255, 255, 0.12),
1461 hcLight: color_1.Color.rgba(0, 0, 0, 0.12)
1462 }, description: 'Status bar item background color when hovering. The status bar is shown in the bottom of the window.'
1463 }, {
1464 id: 'statusBarItem.errorBackground', defaults: {
1465 dark: color_1.Color.darken('errorBackground', 0.4),
1466 light: color_1.Color.darken('errorBackground', 0.4),
1467 hcDark: undefined,
1468 hcLight: '#B5200D'
1469 }, description: 'Status bar error items background color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window.'
1470 }, {
1471 id: 'statusBarItem.errorForeground', defaults: {
1472 dark: color_1.Color.white,
1473 light: color_1.Color.white,
1474 hcDark: color_1.Color.white,
1475 hcLight: color_1.Color.white
1476 }, description: 'Status bar error items foreground color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window.'
1477 }, {
1478 id: 'statusBarItem.warningBackground', defaults: {
1479 dark: color_1.Color.darken('warningBackground', 0.4),
1480 light: color_1.Color.darken('warningBackground', 0.4),
1481 hcDark: undefined,
1482 hcLight: '#895503'
1483 }, description: 'Status bar warning items background color. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window.'
1484 }, {
1485 id: 'statusBarItem.warningForeground', defaults: {
1486 dark: color_1.Color.white,
1487 light: color_1.Color.white,
1488 hcDark: color_1.Color.white,
1489 hcLight: color_1.Color.white
1490 }, description: 'Status bar warning items foreground color. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window.'
1491 },
1492 // Quickinput colors should be aligned with https://code.visualstudio.com/api/references/theme-color#quick-picker
1493 // if not yet contributed by Monaco, check runtime css variables to learn.
1494 {
1495 id: 'quickInput.background', defaults: {
1496 dark: 'editorWidget.background',
1497 light: 'editorWidget.background',
1498 hcDark: 'editorWidget.background',
1499 hcLight: 'editorWidget.background'
1500 }, description: 'Quick Input background color. The Quick Input widget is the container for views like the color theme picker.'
1501 }, {
1502 id: 'quickInput.foreground', defaults: {
1503 dark: 'editorWidget.foreground',
1504 light: 'editorWidget.foreground',
1505 hcDark: 'editorWidget.foreground',
1506 hcLight: 'editorWidget.foreground'
1507 }, description: 'Quick Input foreground color. The Quick Input widget is the container for views like the color theme picker.'
1508 }, {
1509 id: 'quickInput.list.focusBackground', defaults: {
1510 dark: undefined,
1511 light: undefined,
1512 hcDark: undefined,
1513 hcLight: undefined
1514 }, description: 'quickInput.list.focusBackground deprecation. Please use quickInputList.focusBackground instead'
1515 }, {
1516 id: 'quickInputList.focusForeground', defaults: {
1517 dark: 'list.activeSelectionForeground',
1518 light: 'list.activeSelectionForeground',
1519 hcDark: 'list.activeSelectionForeground',
1520 hcLight: 'list.activeSelectionForeground'
1521 }, description: 'Quick picker foreground color for the focused item'
1522 }, {
1523 id: 'quickInputList.focusBackground', defaults: {
1524 dark: 'list.activeSelectionBackground',
1525 light: 'list.activeSelectionBackground',
1526 hcDark: undefined
1527 }, description: 'Quick picker background color for the focused item.'
1528 },
1529 // Panel colors should be aligned with https://code.visualstudio.com/api/references/theme-color#panel-colors
1530 {
1531 id: 'panel.background', defaults: {
1532 dark: 'editor.background', light: 'editor.background', hcDark: 'editor.background', hcLight: 'editor.background'
1533 }, description: 'Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal.'
1534 }, {
1535 id: 'panel.border', defaults: {
1536 dark: color_1.Color.transparent('#808080', 0.35), light: color_1.Color.transparent('#808080', 0.35), hcDark: 'contrastBorder', hcLight: 'contrastBorder'
1537 }, description: 'Panel border color to separate the panel from the editor. Panels are shown below the editor area and contain views like output and integrated terminal.'
1538 }, {
1539 id: 'panel.dropBackground', defaults: {
1540 dark: color_1.Color.rgba(255, 255, 255, 0.12), light: color_1.Color.transparent('#2677CB', 0.18), hcDark: color_1.Color.rgba(255, 255, 255, 0.12)
1541 }, description: 'Drag and drop feedback color for the panel title items. The color should have transparency so that the panel entries can still shine through. Panels are shown below the editor area and contain views like output and integrated terminal.'
1542 }, {
1543 id: 'panelTitle.activeForeground', defaults: {
1544 dark: '#E7E7E7', light: '#424242', hcDark: color_1.Color.white, hcLight: 'editor.foreground'
1545 }, description: 'Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal.'
1546 }, {
1547 id: 'panelTitle.inactiveForeground', defaults: {
1548 dark: color_1.Color.transparent('panelTitle.activeForeground', 0.6), light: color_1.Color.transparent('panelTitle.activeForeground', 0.75), hcDark: color_1.Color.white, hcLight: 'editor.foreground'
1549 }, description: 'Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal.'
1550 }, {
1551 id: 'panelTitle.activeBorder', defaults: {
1552 dark: 'panelTitle.activeForeground', light: 'panelTitle.activeForeground', hcDark: 'contrastBorder', hcLight: '#B5200D'
1553 }, description: 'Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal.'
1554 }, {
1555 id: 'panelInput.border', defaults: { light: '#ddd' },
1556 description: 'Input box border for inputs in the panel.'
1557 }, {
1558 id: 'imagePreview.border', defaults: {
1559 dark: color_1.Color.transparent('#808080', 0.35), light: color_1.Color.transparent('#808080', 0.35), hcDark: 'contrastBorder', hcLight: 'contrastBorder'
1560 }, description: 'Border color for image in image preview.'
1561 },
1562 // Title Bar colors should be aligned with https://code.visualstudio.com/api/references/theme-color#title-bar-colors
1563 {
1564 id: 'titleBar.activeForeground', defaults: {
1565 dark: '#CCCCCC',
1566 light: '#333333',
1567 hcDark: '#FFFFFF',
1568 hcLight: '#292929'
1569 }, description: 'Title bar foreground when the window is active. Note that this color is currently only supported on macOS.'
1570 }, {
1571 id: 'titleBar.inactiveForeground', defaults: {
1572 dark: color_1.Color.transparent('titleBar.activeForeground', 0.6),
1573 light: color_1.Color.transparent('titleBar.activeForeground', 0.6),
1574 hcLight: '#292929'
1575 }, description: 'Title bar foreground when the window is inactive. Note that this color is currently only supported on macOS.'
1576 }, {
1577 id: 'titleBar.activeBackground', defaults: {
1578 dark: '#3C3C3C',
1579 light: '#DDDDDD',
1580 hcDark: '#000000',
1581 hcLight: '#FFFFFF'
1582 }, description: 'Title bar background when the window is active. Note that this color is currently only supported on macOS.'
1583 }, {
1584 id: 'titleBar.inactiveBackground', defaults: {
1585 dark: color_1.Color.transparent('titleBar.activeBackground', 0.6),
1586 light: color_1.Color.transparent('titleBar.activeBackground', 0.6)
1587 }, description: 'Title bar background when the window is inactive. Note that this color is currently only supported on macOS.'
1588 }, {
1589 id: 'titleBar.border', defaults: {
1590 hcDark: 'contrastBorder',
1591 hcLight: 'contrastBorder'
1592 }, description: 'Title bar border color. Note that this color is currently only supported on macOS.'
1593 },
1594 // Menu Bar colors should be aligned with https://code.visualstudio.com/api/references/theme-color#menu-bar-colors
1595 {
1596 id: 'menubar.selectionForeground', defaults: {
1597 dark: 'titleBar.activeForeground',
1598 light: 'titleBar.activeForeground',
1599 hcDark: 'titleBar.activeForeground',
1600 hcLight: 'titleBar.activeForeground'
1601 }, description: 'Foreground color of the selected menu item in the menubar.'
1602 }, {
1603 id: 'menubar.selectionBackground', defaults: {
1604 dark: color_1.Color.transparent('#ffffff', 0.1),
1605 light: color_1.Color.transparent('#000000', 0.1)
1606 }, description: 'Background color of the selected menu item in the menubar.'
1607 }, {
1608 id: 'menubar.selectionBorder', defaults: {
1609 hcDark: 'activeContrastBorder', hcLight: 'activeContrastBorder'
1610 }, description: 'Border color of the selected menu item in the menubar.'
1611 }, {
1612 id: 'menu.border', defaults: {
1613 hcDark: 'contrastBorder', hcLight: 'contrastBorder'
1614 }, description: 'Border color of menus.'
1615 }, {
1616 id: 'menu.foreground', defaults: {
1617 dark: 'dropdown.foreground', light: 'foreground', hcDark: 'dropdown.foreground', hcLight: 'dropdown.foreground'
1618 },
1619 description: 'Foreground color of menu items.'
1620 }, {
1621 id: 'menu.background', defaults: {
1622 dark: 'dropdown.background', light: 'dropdown.background', hcDark: 'dropdown.background', hcLight: 'dropdown.background'
1623 }, description: 'Background color of menu items.'
1624 }, {
1625 id: 'menu.selectionForeground', defaults: {
1626 dark: 'list.activeSelectionForeground', light: 'list.activeSelectionForeground', hcDark: 'list.activeSelectionForeground', hcLight: 'list.activeSelectionForeground'
1627 }, description: 'Foreground color of the selected menu item in menus.'
1628 }, {
1629 id: 'menu.selectionBackground', defaults: {
1630 dark: 'list.activeSelectionBackground', light: 'list.activeSelectionBackground', hcDark: 'list.activeSelectionBackground', hcLight: 'list.activeSelectionBackground'
1631 },
1632 description: 'Background color of the selected menu item in menus.'
1633 }, {
1634 id: 'menu.selectionBorder', defaults: {
1635 hcDark: 'activeContrastBorder', hcLight: 'activeContrastBorder'
1636 }, description: 'Border color of the selected menu item in menus.'
1637 }, {
1638 id: 'menu.separatorBackground', defaults: {
1639 dark: '#BBBBBB', light: '#888888', hcDark: 'contrastBorder', hcLight: 'contrastBorder'
1640 },
1641 description: 'Color of a separator menu item in menus.'
1642 },
1643 // Welcome Page colors should be aligned with https://code.visualstudio.com/api/references/theme-color#welcome-page
1644 { id: 'welcomePage.background', description: 'Background color for the Welcome page.' }, { id: 'welcomePage.buttonBackground', defaults: { dark: color_1.Color.rgba(0, 0, 0, .2), light: color_1.Color.rgba(0, 0, 0, .04), hcDark: color_1.Color.black, hcLight: color_1.Color.white }, description: 'Background color for the buttons on the Welcome page.' }, { id: 'welcomePage.buttonHoverBackground', defaults: { dark: color_1.Color.rgba(200, 235, 255, .072), light: color_1.Color.rgba(0, 0, 0, .10) }, description: 'Hover background color for the buttons on the Welcome page.' }, { id: 'walkThrough.embeddedEditorBackground', defaults: { dark: color_1.Color.rgba(0, 0, 0, .4), light: '#f4f4f4' }, description: 'Background color for the embedded editors on the Interactive Playground.' },
1645 // Dropdown colors should be aligned with https://code.visualstudio.com/api/references/theme-color#dropdown-control
1646 {
1647 id: 'dropdown.background', defaults: {
1648 light: color_1.Color.white,
1649 dark: '#3C3C3C',
1650 hcDark: color_1.Color.black,
1651 hcLight: color_1.Color.white
1652 }, description: 'Dropdown background.'
1653 }, {
1654 id: 'dropdown.listBackground', defaults: {
1655 hcDark: color_1.Color.black,
1656 hcLight: color_1.Color.white
1657 }, description: 'Dropdown list background.'
1658 }, {
1659 id: 'dropdown.foreground', defaults: {
1660 dark: '#F0F0F0',
1661 hcDark: color_1.Color.white,
1662 hcLight: 'foreground'
1663 }, description: 'Dropdown foreground.'
1664 }, {
1665 id: 'dropdown.border', defaults: {
1666 light: '#CECECE',
1667 dark: 'dropdown.background',
1668 hcDark: 'contrastBorder',
1669 hcLight: 'contrastBorder'
1670 }, description: 'Dropdown border.'
1671 },
1672 // Settings Editor colors should be aligned with https://code.visualstudio.com/api/references/theme-color#settings-editor-colors
1673 {
1674 id: 'settings.headerForeground', defaults: {
1675 light: '#444444', dark: '#e7e7e7', hcDark: '#ffffff', hcLight: '#292929'
1676 }, description: 'The foreground color for a section header or active title.'
1677 }, {
1678 id: 'settings.modifiedItemIndicator', defaults: {
1679 light: color_1.Color.rgba(102, 175, 224),
1680 dark: color_1.Color.rgba(12, 125, 157),
1681 hcDark: color_1.Color.rgba(0, 73, 122),
1682 hcLight: color_1.Color.rgba(102, 175, 224)
1683 }, description: 'The color of the modified setting indicator.'
1684 }, {
1685 id: 'settings.dropdownBackground', defaults: {
1686 dark: 'dropdown.background', light: 'dropdown.background', hcDark: 'dropdown.background', hcLight: 'dropdown.background'
1687 },
1688 description: 'Settings editor dropdown background.'
1689 }, {
1690 id: 'settings.dropdownForeground', defaults: {
1691 dark: 'dropdown.foreground', light: 'dropdown.foreground', hcDark: 'dropdown.foreground', hcLight: 'dropdown.foreground'
1692 }, description: 'Settings editor dropdown foreground.'
1693 }, {
1694 id: 'settings.dropdownBorder', defaults: {
1695 dark: 'dropdown.border', light: 'dropdown.border', hcDark: 'dropdown.border', hcLight: 'dropdown.border'
1696 }, description: 'Settings editor dropdown border.'
1697 }, {
1698 id: 'settings.dropdownListBorder', defaults: {
1699 dark: 'editorWidget.border', light: 'editorWidget.border', hcDark: 'editorWidget.border', hcLight: 'editorWidget.border'
1700 }, description: 'Settings editor dropdown list border. This surrounds the options and separates the options from the description.'
1701 }, {
1702 id: 'settings.checkboxBackground', defaults: {
1703 dark: 'checkbox.background', light: 'checkbox.background', hcDark: 'checkbox.background', hcLight: 'checkbox.background'
1704 }, description: 'Settings editor checkbox background.'
1705 }, {
1706 id: 'settings.checkboxForeground', defaults: {
1707 dark: 'checkbox.foreground', light: 'checkbox.foreground', hcDark: 'checkbox.foreground', hcLight: 'checkbox.foreground'
1708 }, description: 'Settings editor checkbox foreground.'
1709 }, {
1710 id: 'settings.checkboxBorder', defaults: {
1711 dark: 'checkbox.border', light: 'checkbox.border', hcDark: 'checkbox.border', hcLight: 'checkbox.border'
1712 }, description: 'Settings editor checkbox border.'
1713 }, {
1714 id: 'settings.textInputBackground', defaults: {
1715 dark: 'input.background', light: 'input.background', hcDark: 'input.background', hcLight: 'input.background'
1716 }, description: 'Settings editor text input box background.'
1717 }, {
1718 id: 'settings.textInputForeground', defaults: {
1719 dark: 'input.foreground', light: 'input.foreground', hcDark: 'input.foreground', hcLight: 'input.foreground'
1720 }, description: 'Settings editor text input box foreground.'
1721 }, {
1722 id: 'settings.textInputBorder', defaults: {
1723 dark: 'input.border', light: 'input.border', hcDark: 'input.border', hcLight: 'input.background'
1724 }, description: 'Settings editor text input box border.'
1725 }, {
1726 id: 'settings.numberInputBackground', defaults: {
1727 dark: 'input.background', light: 'input.background', hcDark: 'input.background', hcLight: 'input.background'
1728 }, description: 'Settings editor number input box background.'
1729 }, {
1730 id: 'settings.numberInputForeground', defaults: {
1731 dark: 'input.foreground', light: 'input.foreground', hcDark: 'input.foreground', hcLight: 'input.foreground'
1732 }, description: 'Settings editor number input box foreground.'
1733 }, {
1734 id: 'settings.numberInputBorder', defaults: {
1735 dark: 'input.border', light: 'input.border', hcDark: 'input.border', hcLight: 'input.border'
1736 }, description: 'Settings editor number input box border.'
1737 }, {
1738 id: 'settings.focusedRowBackground', defaults: {
1739 dark: color_1.Color.transparent('#808080', 0.14),
1740 light: color_1.Color.transparent('#808080', 0.03),
1741 hcDark: undefined,
1742 hcLight: undefined
1743 }, description: 'The background color of a settings row when focused.'
1744 }, {
1745 id: 'settings.rowHoverBackground', defaults: {
1746 dark: color_1.Color.transparent('#808080', 0.07),
1747 light: color_1.Color.transparent('#808080', 0.05),
1748 hcDark: undefined,
1749 hcLight: undefined
1750 }, description: 'The background color of a settings row when hovered.'
1751 }, {
1752 id: 'settings.focusedRowBorder', defaults: {
1753 dark: color_1.Color.rgba(255, 255, 255, 0.12),
1754 light: color_1.Color.rgba(0, 0, 0, 0.12),
1755 hcDark: 'focusBorder',
1756 hcLight: 'focusBorder'
1757 }, description: "The color of the row's top and bottom border when the row is focused."
1758 },
1759 // Toolbar Action colors should be aligned with https://code.visualstudio.com/api/references/theme-color#action-colors
1760 {
1761 id: 'toolbar.hoverBackground', defaults: {
1762 dark: '#5a5d5e50', light: '#b8b8b850', hcDark: undefined, hcLight: undefined
1763 }, description: 'Toolbar background when hovering over actions using the mouse.'
1764 },
1765 // Theia Variable colors
1766 {
1767 id: 'variable.name.color', defaults: {
1768 dark: '#C586C0',
1769 light: '#9B46B0',
1770 hcDark: '#C586C0'
1771 },
1772 description: 'Color of a variable name.'
1773 }, {
1774 id: 'variable.value.color', defaults: {
1775 dark: color_1.Color.rgba(204, 204, 204, 0.6),
1776 light: color_1.Color.rgba(108, 108, 108, 0.8),
1777 hcDark: color_1.Color.rgba(204, 204, 204, 0.6)
1778 },
1779 description: 'Color of a variable value.'
1780 }, {
1781 id: 'variable.number.variable.color', defaults: {
1782 dark: '#B5CEA8',
1783 light: '#09885A',
1784 hcDark: '#B5CEA8'
1785 },
1786 description: 'Value color of a number variable'
1787 }, {
1788 id: 'variable.boolean.variable.color', defaults: {
1789 dark: '#4E94CE',
1790 light: '#0000FF',
1791 hcDark: '#4E94CE'
1792 },
1793 description: 'Value color of a boolean variable'
1794 }, {
1795 id: 'variable.string.variable.color', defaults: {
1796 dark: '#CE9178',
1797 light: '#A31515',
1798 hcDark: '#CE9178'
1799 },
1800 description: 'Value color of a string variable'
1801 },
1802 // Theia ANSI colors
1803 {
1804 id: 'ansi.black.color', defaults: {
1805 dark: '#A0A0A0',
1806 light: color_1.Color.rgba(128, 128, 128),
1807 hcDark: '#A0A0A0'
1808 },
1809 description: 'ANSI black color'
1810 }, {
1811 id: 'ansi.red.color', defaults: {
1812 dark: '#A74747',
1813 light: '#BE1717',
1814 hcDark: '#A74747'
1815 },
1816 description: 'ANSI red color'
1817 }, {
1818 id: 'ansi.green.color', defaults: {
1819 dark: '#348F34',
1820 light: '#338A2F',
1821 hcDark: '#348F34'
1822 },
1823 description: 'ANSI green color'
1824 }, {
1825 id: 'ansi.yellow.color', defaults: {
1826 dark: '#5F4C29',
1827 light: '#BEB817',
1828 hcDark: '#5F4C29'
1829 },
1830 description: 'ANSI yellow color'
1831 }, {
1832 id: 'ansi.blue.color', defaults: {
1833 dark: '#6286BB',
1834 light: color_1.Color.rgba(0, 0, 139),
1835 hcDark: '#6286BB'
1836 },
1837 description: 'ANSI blue color'
1838 }, {
1839 id: 'ansi.magenta.color', defaults: {
1840 dark: '#914191',
1841 light: color_1.Color.rgba(139, 0, 139),
1842 hcDark: '#914191'
1843 },
1844 description: 'ANSI magenta color'
1845 }, {
1846 id: 'ansi.cyan.color', defaults: {
1847 dark: '#218D8D',
1848 light: color_1.Color.rgba(0, 139, 139),
1849 hcDark: '#218D8D'
1850 },
1851 description: 'ANSI cyan color'
1852 }, {
1853 id: 'ansi.white.color', defaults: {
1854 dark: '#707070',
1855 light: '#BDBDBD',
1856 hcDark: '#707070'
1857 },
1858 description: 'ANSI white color'
1859 },
1860 // Theia defaults
1861 // Base
1862 {
1863 id: 'errorBackground',
1864 defaults: {
1865 dark: 'inputValidation.errorBackground',
1866 light: 'inputValidation.errorBackground',
1867 hcDark: 'inputValidation.errorBackground'
1868 }, description: 'Background color of error widgets (like alerts or notifications).'
1869 }, {
1870 id: 'successBackground',
1871 defaults: {
1872 dark: 'editorGutter.addedBackground',
1873 light: 'editorGutter.addedBackground',
1874 hcDark: 'editorGutter.addedBackground'
1875 }, description: 'Background color of success widgets (like alerts or notifications).'
1876 }, {
1877 id: 'warningBackground',
1878 defaults: {
1879 dark: 'editorWarning.foreground',
1880 light: 'editorWarning.foreground',
1881 hcDark: 'editorWarning.border'
1882 }, description: 'Background color of warning widgets (like alerts or notifications).'
1883 }, {
1884 id: 'warningForeground',
1885 defaults: {
1886 dark: 'inputValidation.warningBackground',
1887 light: 'inputValidation.warningBackground',
1888 hcDark: 'inputValidation.warningBackground'
1889 }, description: 'Foreground color of warning widgets (like alerts or notifications).'
1890 },
1891 // Statusbar
1892 {
1893 id: 'statusBar.offlineBackground',
1894 defaults: {
1895 dark: 'editorWarning.foreground',
1896 light: 'editorWarning.foreground',
1897 hcDark: 'editorWarning.foreground',
1898 hcLight: 'editorWarning.foreground'
1899 }, description: 'Background of hovered statusbar item in case the theia server is offline.'
1900 }, {
1901 id: 'statusBar.offlineForeground',
1902 defaults: {
1903 dark: 'editor.background',
1904 light: 'editor.background',
1905 hcDark: 'editor.background',
1906 hcLight: 'editor.background'
1907 }, description: 'Background of hovered statusbar item in case the theia server is offline.'
1908 }, {
1909 id: 'statusBarItem.offlineHoverBackground',
1910 defaults: {
1911 dark: color_1.Color.lighten('statusBar.offlineBackground', 0.4),
1912 light: color_1.Color.lighten('statusBar.offlineBackground', 0.4),
1913 hcDark: color_1.Color.lighten('statusBar.offlineBackground', 0.4),
1914 hcLight: color_1.Color.lighten('statusBar.offlineBackground', 0.4)
1915 }, description: 'Background of hovered statusbar item in case the theia server is offline.'
1916 }, {
1917 id: 'statusBarItem.offlineActiveBackground',
1918 defaults: {
1919 dark: color_1.Color.lighten('statusBar.offlineBackground', 0.6),
1920 light: color_1.Color.lighten('statusBar.offlineBackground', 0.6),
1921 hcDark: color_1.Color.lighten('statusBar.offlineBackground', 0.6),
1922 hcLight: color_1.Color.lighten('statusBar.offlineBackground', 0.6)
1923 }, description: 'Background of active statusbar item in case the theia server is offline.'
1924 },
1925 // Buttons
1926 {
1927 id: 'secondaryButton.foreground',
1928 defaults: {
1929 dark: 'dropdown.foreground',
1930 light: 'dropdown.foreground',
1931 hcDark: 'dropdown.foreground',
1932 hcLight: 'dropdown.foreground'
1933 }, description: 'Foreground color of secondary buttons.'
1934 }, {
1935 id: 'secondaryButton.disabledForeground',
1936 defaults: {
1937 dark: color_1.Color.transparent('secondaryButton.foreground', 0.5),
1938 light: color_1.Color.transparent('secondaryButton.foreground', 0.5),
1939 hcDark: color_1.Color.transparent('secondaryButton.foreground', 0.5),
1940 hcLight: color_1.Color.transparent('secondaryButton.foreground', 0.5),
1941 }, description: 'Foreground color of secondary buttons.'
1942 }, {
1943 id: 'secondaryButton.background',
1944 defaults: {
1945 dark: color_1.Color.lighten('dropdown.background', 0.5),
1946 light: color_1.Color.lighten('dropdown.background', 0.5)
1947 }, description: 'Background color of secondary buttons.'
1948 }, {
1949 id: 'secondaryButton.hoverBackground',
1950 defaults: {
1951 dark: color_1.Color.lighten('secondaryButton.background', 0.2),
1952 light: color_1.Color.lighten('secondaryButton.background', 0.2)
1953 }, description: 'Background color when hovering secondary buttons.'
1954 }, {
1955 id: 'secondaryButton.disabledBackground',
1956 defaults: {
1957 dark: color_1.Color.transparent('secondaryButton.background', 0.6),
1958 light: color_1.Color.transparent('secondaryButton.background', 0.6)
1959 }, description: 'Background color when hovering secondary buttons.'
1960 }, {
1961 id: 'button.disabledForeground',
1962 defaults: {
1963 dark: color_1.Color.transparent('button.foreground', 0.5),
1964 light: color_1.Color.transparent('button.foreground', 0.5),
1965 hcDark: color_1.Color.transparent('button.foreground', 0.5)
1966 }, description: 'Foreground color of secondary buttons.'
1967 }, {
1968 id: 'button.disabledBackground',
1969 defaults: {
1970 dark: color_1.Color.transparent('button.background', 0.5),
1971 light: color_1.Color.transparent('button.background', 0.5)
1972 }, description: 'Background color of secondary buttons.'
1973 }, {
1974 id: 'editorGutter.commentRangeForeground',
1975 defaults: {
1976 dark: '#c5c5c5',
1977 light: '#c5c5c5',
1978 hcDark: color_1.Color.white,
1979 hcLight: color_1.Color.white
1980 }, description: 'Editor gutter decoration color for commenting ranges.'
1981 }, {
1982 id: 'breadcrumb.foreground',
1983 defaults: {
1984 dark: color_1.Color.transparent('foreground', 0.8),
1985 light: color_1.Color.transparent('foreground', 0.8),
1986 hcDark: color_1.Color.transparent('foreground', 0.8),
1987 hcLight: color_1.Color.transparent('foreground', 0.8)
1988 },
1989 description: 'Color of breadcrumb item text'
1990 }, {
1991 id: 'breadcrumb.background',
1992 defaults: {
1993 dark: 'editor.background',
1994 light: 'editor.background',
1995 hcDark: 'editor.background',
1996 hcLight: 'editor.background'
1997 },
1998 description: 'Color of breadcrumb item background'
1999 }, {
2000 id: 'breadcrumb.focusForeground',
2001 defaults: {
2002 dark: color_1.Color.lighten('foreground', 0.1),
2003 light: color_1.Color.darken('foreground', 0.2),
2004 hcDark: color_1.Color.lighten('foreground', 0.1),
2005 hcLight: color_1.Color.lighten('foreground', 0.1)
2006 },
2007 description: 'Color of breadcrumb item text when focused'
2008 }, {
2009 id: 'breadcrumb.activeSelectionForeground',
2010 defaults: {
2011 dark: color_1.Color.lighten('foreground', 0.1),
2012 light: color_1.Color.darken('foreground', 0.2),
2013 hcDark: color_1.Color.lighten('foreground', 0.1),
2014 hcLight: color_1.Color.lighten('foreground', 0.1)
2015 },
2016 description: 'Color of selected breadcrumb item'
2017 }, {
2018 id: 'breadcrumbPicker.background',
2019 defaults: {
2020 dark: 'editorWidget.background',
2021 light: 'editorWidget.background',
2022 hcDark: 'editorWidget.background',
2023 hcLight: 'editorWidget.background'
2024 },
2025 description: 'Background color of breadcrumb item picker'
2026 }, {
2027 id: 'mainToolbar.background',
2028 defaults: {
2029 dark: color_1.Color.lighten('activityBar.background', 0.1),
2030 light: color_1.Color.darken('activityBar.background', 0.1),
2031 hcDark: color_1.Color.lighten('activityBar.background', 0.1),
2032 hcLight: color_1.Color.lighten('activityBar.background', 0.1)
2033 },
2034 description: 'Background color of shell\'s global toolbar'
2035 }, {
2036 id: 'mainToolbar.foreground', defaults: {
2037 dark: color_1.Color.darken('activityBar.foreground', 0.1),
2038 light: color_1.Color.lighten('activityBar.foreground', 0.1),
2039 hcDark: color_1.Color.lighten('activityBar.foreground', 0.1),
2040 hcLight: color_1.Color.lighten('activityBar.foreground', 0.1),
2041 }, description: 'Foreground color of active toolbar item',
2042 }, {
2043 id: 'editorHoverWidgetInternalBorder',
2044 defaults: {
2045 dark: color_1.Color.transparent('editorHoverWidget.border', 0.5),
2046 light: color_1.Color.transparent('editorHoverWidget.border', 0.5),
2047 hcDark: color_1.Color.transparent('editorHoverWidget.border', 0.5),
2048 hcLight: color_1.Color.transparent('editorHoverWidget.border', 0.5)
2049 },
2050 description: 'The border between subelements of a hover widget'
2051 });
2052 }
2053};
2054__decorate([
2055 (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
2056 __metadata("design:type", Object)
2057], CommonFrontendContribution.prototype, "contextKeyService", void 0);
2058__decorate([
2059 (0, inversify_1.inject)(resource_context_key_1.ResourceContextKey),
2060 __metadata("design:type", resource_context_key_1.ResourceContextKey)
2061], CommonFrontendContribution.prototype, "resourceContextKey", void 0);
2062__decorate([
2063 (0, inversify_1.inject)(command_1.CommandRegistry),
2064 __metadata("design:type", command_1.CommandRegistry)
2065], CommonFrontendContribution.prototype, "commandRegistry", void 0);
2066__decorate([
2067 (0, inversify_1.inject)(storage_service_1.StorageService),
2068 __metadata("design:type", Object)
2069], CommonFrontendContribution.prototype, "storageService", void 0);
2070__decorate([
2071 (0, inversify_1.inject)(quick_input_1.QuickInputService),
2072 (0, inversify_1.optional)(),
2073 __metadata("design:type", Object)
2074], CommonFrontendContribution.prototype, "quickInputService", void 0);
2075__decorate([
2076 (0, inversify_1.inject)(icon_theme_service_1.IconThemeService),
2077 __metadata("design:type", icon_theme_service_1.IconThemeService)
2078], CommonFrontendContribution.prototype, "iconThemes", void 0);
2079__decorate([
2080 (0, inversify_1.inject)(theming_1.ThemeService),
2081 __metadata("design:type", theming_1.ThemeService)
2082], CommonFrontendContribution.prototype, "themeService", void 0);
2083__decorate([
2084 (0, inversify_1.inject)(core_preferences_1.CorePreferences),
2085 __metadata("design:type", Object)
2086], CommonFrontendContribution.prototype, "preferences", void 0);
2087__decorate([
2088 (0, inversify_1.inject)(preferences_1.PreferenceService),
2089 __metadata("design:type", Object)
2090], CommonFrontendContribution.prototype, "preferenceService", void 0);
2091__decorate([
2092 (0, inversify_1.inject)(clipboard_service_1.ClipboardService),
2093 __metadata("design:type", Object)
2094], CommonFrontendContribution.prototype, "clipboardService", void 0);
2095__decorate([
2096 (0, inversify_1.inject)(encoding_registry_1.EncodingRegistry),
2097 __metadata("design:type", encoding_registry_1.EncodingRegistry)
2098], CommonFrontendContribution.prototype, "encodingRegistry", void 0);
2099__decorate([
2100 (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
2101 __metadata("design:type", Object)
2102], CommonFrontendContribution.prototype, "environments", void 0);
2103__decorate([
2104 (0, inversify_1.inject)(authentication_service_1.AuthenticationService),
2105 __metadata("design:type", Object)
2106], CommonFrontendContribution.prototype, "authenticationService", void 0);
2107__decorate([
2108 (0, inversify_1.inject)(window_service_1.WindowService),
2109 __metadata("design:type", Object)
2110], CommonFrontendContribution.prototype, "windowService", void 0);
2111__decorate([
2112 (0, inversify_1.inject)(user_working_directory_provider_1.UserWorkingDirectoryProvider),
2113 __metadata("design:type", user_working_directory_provider_1.UserWorkingDirectoryProvider)
2114], CommonFrontendContribution.prototype, "workingDirProvider", void 0);
2115__decorate([
2116 (0, inversify_1.inject)(language_quick_pick_service_1.LanguageQuickPickService),
2117 __metadata("design:type", language_quick_pick_service_1.LanguageQuickPickService)
2118], CommonFrontendContribution.prototype, "languageQuickPickService", void 0);
2119__decorate([
2120 (0, inversify_1.inject)(common_1.UntitledResourceResolver),
2121 __metadata("design:type", common_1.UntitledResourceResolver)
2122], CommonFrontendContribution.prototype, "untitledResourceResolver", void 0);
2123CommonFrontendContribution = __decorate([
2124 (0, inversify_1.injectable)(),
2125 __param(0, (0, inversify_1.inject)(application_shell_1.ApplicationShell)),
2126 __param(1, (0, inversify_1.inject)(selection_service_1.SelectionService)),
2127 __param(2, (0, inversify_1.inject)(message_service_1.MessageService)),
2128 __param(3, (0, inversify_1.inject)(opener_service_1.OpenerService)),
2129 __param(4, (0, inversify_1.inject)(about_dialog_1.AboutDialog)),
2130 __param(5, (0, inversify_1.inject)(localization_1.AsyncLocalizationProvider)),
2131 __param(6, (0, inversify_1.inject)(save_resource_service_1.SaveResourceService)),
2132 __metadata("design:paramtypes", [application_shell_1.ApplicationShell,
2133 selection_service_1.SelectionService,
2134 message_service_1.MessageService, Object, about_dialog_1.AboutDialog, Object, save_resource_service_1.SaveResourceService])
2135], CommonFrontendContribution);
2136exports.CommonFrontendContribution = CommonFrontendContribution;
2137//# sourceMappingURL=common-frontend-contribution.js.map
\No newline at end of file