chore(vscode): update to 1.54.2

This commit is contained in:
Joe Previte
2021-03-11 10:27:10 -07:00
1459 changed files with 53404 additions and 51004 deletions

View File

@@ -59,7 +59,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
// menu item
// TODO@Rob slightly weird if-check required because of
// https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts#L266
// https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts#L266
if (descriptor.label) {
let idx = alias.indexOf(': ');

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IAction, IActionViewItem } from 'vs/base/common/actions';
import { IAction } from 'vs/base/common/actions';
import { Event } from 'vs/base/common/event';
export interface IComposite {
@@ -48,11 +48,6 @@ export interface IComposite {
*/
getContextMenuActions(): ReadonlyArray<IAction>;
/**
* Returns the action item for a specific action.
*/
getActionViewItem(action: IAction): IActionViewItem | undefined;
/**
* Returns the underlying control of this composite.
*/

View File

@@ -9,7 +9,7 @@ import { withNullAsUndefined, assertIsDefined } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { IEditor, IEditorViewState, ScrollType, IDiffEditor } from 'vs/editor/common/editorCommon';
import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceEditorInput, IResourceEditorInput, EditorActivation, EditorOpenContext, ITextEditorSelection, TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';
import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceEditorInput, IResourceEditorInput, EditorActivation, EditorOpenContext, ITextEditorSelection, TextEditorSelectionRevealType, EditorOverride } from 'vs/platform/editor/common/editor';
import { IInstantiationService, IConstructorSignature0, ServicesAccessor, BrandedService } from 'vs/platform/instantiation/common/instantiation';
import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { Registry } from 'vs/platform/registry/common/platform';
@@ -25,31 +25,31 @@ import { IRange } from 'vs/editor/common/core/range';
import { IExtUri } from 'vs/base/common/resources';
// Editor State Context Keys
export const ActiveEditorDirtyContext = new RawContextKey<boolean>('activeEditorIsDirty', false);
export const ActiveEditorPinnedContext = new RawContextKey<boolean>('activeEditorIsNotPreview', false);
export const ActiveEditorStickyContext = new RawContextKey<boolean>('activeEditorIsPinned', false);
export const ActiveEditorReadonlyContext = new RawContextKey<boolean>('activeEditorIsReadonly', false);
export const ActiveEditorDirtyContext = new RawContextKey<boolean>('activeEditorIsDirty', false, localize('activeEditorIsDirty', "Whether the active editor is dirty"));
export const ActiveEditorPinnedContext = new RawContextKey<boolean>('activeEditorIsNotPreview', false, localize('activeEditorIsNotPreview', "Whether the active editor is not in preview mode"));
export const ActiveEditorStickyContext = new RawContextKey<boolean>('activeEditorIsPinned', false, localize('activeEditorIsPinned', "Whether the active editor is pinned"));
export const ActiveEditorReadonlyContext = new RawContextKey<boolean>('activeEditorIsReadonly', false, localize('activeEditorIsReadonly', "Whether the active editor is readonly"));
// Editor Kind Context Keys
export const ActiveEditorContext = new RawContextKey<string | null>('activeEditor', null);
export const ActiveEditorAvailableEditorIdsContext = new RawContextKey<string>('activeEditorAvailableEditorIds', '');
export const TextCompareEditorVisibleContext = new RawContextKey<boolean>('textCompareEditorVisible', false);
export const TextCompareEditorActiveContext = new RawContextKey<boolean>('textCompareEditorActive', false);
export const ActiveEditorContext = new RawContextKey<string | null>('activeEditor', null, { type: 'string', description: localize('activeEditor', "The identifier of the active editor") });
export const ActiveEditorAvailableEditorIdsContext = new RawContextKey<string>('activeEditorAvailableEditorIds', '', localize('activeEditorAvailableEditorIds', "The available editor identifiers that are usable for the active editor"));
export const TextCompareEditorVisibleContext = new RawContextKey<boolean>('textCompareEditorVisible', false, localize('textCompareEditorVisible', "Whether a text compare editor is visible"));
export const TextCompareEditorActiveContext = new RawContextKey<boolean>('textCompareEditorActive', false, localize('textCompareEditorActive', "Whether a text compare editor is active"));
// Editor Group Context Keys
export const EditorGroupEditorsCountContext = new RawContextKey<number>('groupEditorsCount', 0);
export const ActiveEditorGroupEmptyContext = new RawContextKey<boolean>('activeEditorGroupEmpty', false);
export const ActiveEditorGroupIndexContext = new RawContextKey<number>('activeEditorGroupIndex', 0);
export const ActiveEditorGroupLastContext = new RawContextKey<boolean>('activeEditorGroupLast', false);
export const MultipleEditorGroupsContext = new RawContextKey<boolean>('multipleEditorGroups', false);
export const EditorGroupEditorsCountContext = new RawContextKey<number>('groupEditorsCount', 0, localize('groupEditorsCount', "The number of opened editor groups"));
export const ActiveEditorGroupEmptyContext = new RawContextKey<boolean>('activeEditorGroupEmpty', false, localize('activeEditorGroupEmpty', "Whether the active editor group is empty"));
export const ActiveEditorGroupIndexContext = new RawContextKey<number>('activeEditorGroupIndex', 0, localize('activeEditorGroupIndex', "The index of the active editor group"));
export const ActiveEditorGroupLastContext = new RawContextKey<boolean>('activeEditorGroupLast', false, localize('activeEditorGroupLast', "Whether the active editor group is the last group"));
export const MultipleEditorGroupsContext = new RawContextKey<boolean>('multipleEditorGroups', false, localize('multipleEditorGroups', "Whether there are multiple editor groups opened"));
export const SingleEditorGroupsContext = MultipleEditorGroupsContext.toNegated();
// Editor Layout Context Keys
export const EditorsVisibleContext = new RawContextKey<boolean>('editorIsOpen', false);
export const InEditorZenModeContext = new RawContextKey<boolean>('inZenMode', false);
export const IsCenteredLayoutContext = new RawContextKey<boolean>('isCenteredLayout', false);
export const SplitEditorsVertically = new RawContextKey<boolean>('splitEditorsVertically', false);
export const EditorAreaVisibleContext = new RawContextKey<boolean>('editorAreaVisible', true);
export const EditorsVisibleContext = new RawContextKey<boolean>('editorIsOpen', false, localize('editorIsOpen', "Whether an editor is open"));
export const InEditorZenModeContext = new RawContextKey<boolean>('inZenMode', false, localize('inZenMode', "Whether Zen mode is enabled"));
export const IsCenteredLayoutContext = new RawContextKey<boolean>('isCenteredLayout', false, localize('isCenteredLayout', "Whether centered layout is enabled"));
export const SplitEditorsVertically = new RawContextKey<boolean>('splitEditorsVertically', false, localize('splitEditorsVertically', "Whether editors split vertically"));
export const EditorAreaVisibleContext = new RawContextKey<boolean>('editorAreaVisible', true, localize('editorAreaVisible', "Whether the editor area is visible"));
/**
* Text diff editor id.
@@ -104,7 +104,7 @@ export interface IEditorPane extends IComposite {
/**
* An event to notify whenever minimum/maximum width/height changes.
*/
readonly onDidSizeConstraintsChange: Event<{ width: number; height: number; } | undefined>;
readonly onDidChangeSizeConstraints: Event<{ width: number; height: number; } | undefined>;
/**
* The context key service for this editor. Should be overridden by
@@ -186,7 +186,7 @@ export interface IFileEditorInputFactory {
isFileEditorInput(obj: unknown): obj is IFileEditorInput;
}
interface ICustomEditorInputFactory {
export interface ICustomEditorInputFactory {
createCustomEditorInput(resource: URI, instantiationService: IInstantiationService): Promise<IEditorInput>;
canResolveBackup(editorInput: IEditorInput, backupResource: URI): boolean;
}
@@ -1006,10 +1006,10 @@ export class EditorOptions implements IEditorOptions {
/**
* Allows to override the editor that should be used to display the input:
* - `undefined`: let the editor decide for itself
* - `false`: disable overrides
* - `string`: specific override by id
* - `EditorOverride`: specific override handling
*/
override?: false | string;
override: string | EditorOverride | undefined;
/**
* A optional hint to signal in which context the editor opens.
@@ -1067,7 +1067,7 @@ export class EditorOptions implements IEditorOptions {
this.index = options.index;
}
if (typeof options.override === 'string' || options.override === false) {
if (options.override !== undefined) {
this.override = options.override;
}
@@ -1464,11 +1464,12 @@ export interface IEditorMemento<T> {
class EditorInputFactoryRegistry implements IEditorInputFactoryRegistry {
private instantiationService: IInstantiationService | undefined;
private fileEditorInputFactory: IFileEditorInputFactory | undefined;
private customEditorInputFactoryInstances: Map<string, ICustomEditorInputFactory> = new Map();
private readonly editorInputFactoryConstructors: Map<string, IConstructorSignature0<IEditorInputFactory>> = new Map();
private readonly editorInputFactoryInstances: Map<string, IEditorInputFactory> = new Map();
private readonly customEditorInputFactoryInstances: Map<string, ICustomEditorInputFactory> = new Map();
start(accessor: ServicesAccessor): void {
const instantiationService = this.instantiationService = accessor.get(IInstantiationService);
@@ -1505,7 +1506,6 @@ class EditorInputFactoryRegistry implements IEditorInputFactoryRegistry {
this.editorInputFactoryConstructors.set(editorInputId, ctor);
} else {
this.createEditorInputFactory(editorInputId, ctor, this.instantiationService);
}
return toDisposable(() => {
@@ -1547,11 +1547,11 @@ export async function pathsToEditors(paths: IPathData[] | undefined, fileService
startColumn: path.columnNumber || 1
},
pinned: true,
override: path.overrideId
override: path.editorOverrideId
} : {
pinned: true,
override: path.overrideId
};
pinned: true,
override: path.editorOverrideId
};
let input: IResourceEditorInput | IUntitledTextResourceEditorInput;
if (!exists) {
@@ -1585,7 +1585,7 @@ export function computeEditorAriaLabel(input: IEditorInput, index: number | unde
ariaLabel = localize('preview', "{0}, preview", ariaLabel);
}
if (group && group.isSticky(index ?? input)) {
if (group?.isSticky(index ?? input)) {
ariaLabel = localize('pinned', "{0}, pinned", ariaLabel);
}

View File

@@ -7,9 +7,8 @@ import { INotification, INotificationHandle, INotificationActions, INotification
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { Event, Emitter } from 'vs/base/common/event';
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { isErrorWithActions, isPromiseCanceledError } from 'vs/base/common/errors';
import { Action } from 'vs/base/common/actions';
import { isErrorWithActions } from 'vs/base/common/errorsWithActions';
import { equals } from 'vs/base/common/arrays';
import { parseLinkedText, LinkedText } from 'vs/base/common/linkedText';

View File

@@ -8,6 +8,6 @@ import { IComposite } from 'vs/workbench/common/composite';
export interface IPaneComposite extends IComposite {
openView<T extends IView>(id: string, focus?: boolean): T | undefined;
getViewPaneContainer(): IViewPaneContainer;
getViewPaneContainer(): IViewPaneContainer | undefined;
saveState(): void;
}

View File

@@ -3,13 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { IComposite } from 'vs/workbench/common/composite';
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
export const ActivePanelContext = new RawContextKey<string>('activePanel', '');
export const PanelFocusContext = new RawContextKey<boolean>('panelFocus', false);
export const PanelPositionContext = new RawContextKey<string>('panelPosition', 'bottom');
export const PanelVisibleContext = new RawContextKey<boolean>('panelVisible', false);
export const PanelMaximizedContext = new RawContextKey<boolean>('panelMaximized', false);
export const ActivePanelContext = new RawContextKey<string>('activePanel', '', localize('activePanel', "The identifier of the active panel"));
export const PanelFocusContext = new RawContextKey<boolean>('panelFocus', false, localize('panelFocus', "Whether the panel has keyboard focus"));
export const PanelPositionContext = new RawContextKey<string>('panelPosition', 'bottom', localize('panelPosition', "The position of the panel, either 'left', 'right' or 'bottom'"));
export const PanelVisibleContext = new RawContextKey<boolean>('panelVisible', false, localize('panelVisible', "Whether the panel is visible"));
export const PanelMaximizedContext = new RawContextKey<boolean>('panelMaximized', false, localize('panelMaximized', "Whether the panel is maximized"));
export interface IPanel extends IComposite { }

View File

@@ -3,8 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { URI } from 'vs/base/common/uri';
import * as objects from 'vs/base/common/objects';
import { deepClone, equals } from 'vs/base/common/objects';
import { Emitter } from 'vs/base/common/event';
import { basename, dirname, extname, relativePath } from 'vs/base/common/resources';
import { RawContextKey, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
@@ -23,15 +24,15 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
// UNDEFINED! IT IS IMPORTANT THAT DEFAULTS ARE INHERITED
// FROM THE PARENT CONTEXT AND ONLY UNDEFINED DOES THIS
static readonly Scheme = new RawContextKey<string>('resourceScheme', undefined);
static readonly Filename = new RawContextKey<string>('resourceFilename', undefined);
static readonly Dirname = new RawContextKey<string>('resourceDirname', undefined);
static readonly Path = new RawContextKey<string>('resourcePath', undefined);
static readonly LangId = new RawContextKey<string>('resourceLangId', undefined);
static readonly Resource = new RawContextKey<URI>('resource', undefined);
static readonly Extension = new RawContextKey<string>('resourceExtname', undefined);
static readonly HasResource = new RawContextKey<boolean>('resourceSet', undefined);
static readonly IsFileSystemResource = new RawContextKey<boolean>('isFileSystemResource', undefined);
static readonly Scheme = new RawContextKey<string>('resourceScheme', undefined, { type: 'string', description: localize('resourceScheme', "The scheme of the rsource") });
static readonly Filename = new RawContextKey<string>('resourceFilename', undefined, { type: 'string', description: localize('resourceFilename', "The file name of the resource") });
static readonly Dirname = new RawContextKey<string>('resourceDirname', undefined, { type: 'string', description: localize('resourceDirname', "The folder name the resource is contained in") });
static readonly Path = new RawContextKey<string>('resourcePath', undefined, { type: 'string', description: localize('resourcePath', "The full path of the resource") });
static readonly LangId = new RawContextKey<string>('resourceLangId', undefined, { type: 'string', description: localize('resourceLangId', "The language identifier of the resource") });
static readonly Resource = new RawContextKey<URI>('resource', undefined, { type: 'URI', description: localize('resource', "The full value of the resource including scheme and path") });
static readonly Extension = new RawContextKey<string>('resourceExtname', undefined, { type: 'string', description: localize('resourceExtname', "The extension name of the resource") });
static readonly HasResource = new RawContextKey<boolean>('resourceSet', undefined, { type: 'boolean', description: localize('resourceSet', "Whether a resource is present or not") });
static readonly IsFileSystemResource = new RawContextKey<boolean>('isFileSystemResource', undefined, { type: 'boolean', description: localize('isFileSystemResource', "Whether the resource is backed by a file system provider") });
private readonly _resourceKey: IContextKey<URI | null>;
private readonly _schemeKey: IContextKey<string | null>;
@@ -161,11 +162,11 @@ export class ResourceGlobMatcher extends Disposable {
// Add excludes per workspaces that got added
this.contextService.getWorkspace().folders.forEach(folder => {
const rootExcludes = this.globFn(folder.uri);
if (!this.mapRootToExpressionConfig.has(folder.uri.toString()) || !objects.equals(this.mapRootToExpressionConfig.get(folder.uri.toString()), rootExcludes)) {
if (!this.mapRootToExpressionConfig.has(folder.uri.toString()) || !equals(this.mapRootToExpressionConfig.get(folder.uri.toString()), rootExcludes)) {
changed = true;
this.mapRootToParsedExpression.set(folder.uri.toString(), parse(rootExcludes));
this.mapRootToExpressionConfig.set(folder.uri.toString(), objects.deepClone(rootExcludes));
this.mapRootToExpressionConfig.set(folder.uri.toString(), deepClone(rootExcludes));
}
});
@@ -185,11 +186,11 @@ export class ResourceGlobMatcher extends Disposable {
// Always set for resources outside root as well
const globalExcludes = this.globFn();
if (!this.mapRootToExpressionConfig.has(ResourceGlobMatcher.NO_ROOT) || !objects.equals(this.mapRootToExpressionConfig.get(ResourceGlobMatcher.NO_ROOT), globalExcludes)) {
if (!this.mapRootToExpressionConfig.has(ResourceGlobMatcher.NO_ROOT) || !equals(this.mapRootToExpressionConfig.get(ResourceGlobMatcher.NO_ROOT), globalExcludes)) {
changed = true;
this.mapRootToParsedExpression.set(ResourceGlobMatcher.NO_ROOT, parse(globalExcludes));
this.mapRootToExpressionConfig.set(ResourceGlobMatcher.NO_ROOT, objects.deepClone(globalExcludes));
this.mapRootToExpressionConfig.set(ResourceGlobMatcher.NO_ROOT, deepClone(globalExcludes));
}
if (fromEvent && changed) {

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground } from 'vs/platform/theme/common/colorRegistry';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
import { Color } from 'vs/base/common/color';
@@ -29,25 +29,25 @@ export const TAB_ACTIVE_BACKGROUND = registerColor('tab.activeBackground', {
dark: editorBackground,
light: editorBackground,
hc: editorBackground
}, nls.localize('tabActiveBackground', "Active tab background 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."));
}, localize('tabActiveBackground', "Active tab background 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."));
export const TAB_UNFOCUSED_ACTIVE_BACKGROUND = registerColor('tab.unfocusedActiveBackground', {
dark: TAB_ACTIVE_BACKGROUND,
light: TAB_ACTIVE_BACKGROUND,
hc: TAB_ACTIVE_BACKGROUND
}, nls.localize('tabUnfocusedActiveBackground', "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."));
}, localize('tabUnfocusedActiveBackground', "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."));
export const TAB_INACTIVE_BACKGROUND = registerColor('tab.inactiveBackground', {
dark: '#2D2D2D',
light: '#ECECEC',
hc: null
}, nls.localize('tabInactiveBackground', "Inactive tab background 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."));
}, localize('tabInactiveBackground', "Inactive tab background 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."));
export const TAB_UNFOCUSED_INACTIVE_BACKGROUND = registerColor('tab.unfocusedInactiveBackground', {
dark: TAB_INACTIVE_BACKGROUND,
light: TAB_INACTIVE_BACKGROUND,
hc: TAB_INACTIVE_BACKGROUND
}, nls.localize('tabUnfocusedInactiveBackground', "Inactive 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."));
}, localize('tabUnfocusedInactiveBackground', "Inactive 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."));
//#endregion
@@ -57,25 +57,25 @@ export const TAB_ACTIVE_FOREGROUND = registerColor('tab.activeForeground', {
dark: Color.white,
light: '#333333',
hc: Color.white
}, nls.localize('tabActiveForeground', "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."));
}, localize('tabActiveForeground', "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."));
export const TAB_INACTIVE_FOREGROUND = registerColor('tab.inactiveForeground', {
dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
light: transparent(TAB_ACTIVE_FOREGROUND, 0.7),
hc: Color.white
}, nls.localize('tabInactiveForeground', "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."));
}, localize('tabInactiveForeground', "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."));
export const TAB_UNFOCUSED_ACTIVE_FOREGROUND = registerColor('tab.unfocusedActiveForeground', {
dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
light: transparent(TAB_ACTIVE_FOREGROUND, 0.7),
hc: Color.white
}, nls.localize('tabUnfocusedActiveForeground', "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."));
}, localize('tabUnfocusedActiveForeground', "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."));
export const TAB_UNFOCUSED_INACTIVE_FOREGROUND = registerColor('tab.unfocusedInactiveForeground', {
dark: transparent(TAB_INACTIVE_FOREGROUND, 0.5),
light: transparent(TAB_INACTIVE_FOREGROUND, 0.5),
hc: Color.white
}, nls.localize('tabUnfocusedInactiveForeground', "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."));
}, localize('tabUnfocusedInactiveForeground', "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."));
//#endregion
@@ -85,25 +85,25 @@ export const TAB_HOVER_BACKGROUND = registerColor('tab.hoverBackground', {
dark: null,
light: null,
hc: null
}, nls.localize('tabHoverBackground', "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."));
}, localize('tabHoverBackground', "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."));
export const TAB_UNFOCUSED_HOVER_BACKGROUND = registerColor('tab.unfocusedHoverBackground', {
dark: transparent(TAB_HOVER_BACKGROUND, 0.5),
light: transparent(TAB_HOVER_BACKGROUND, 0.7),
hc: null
}, nls.localize('tabUnfocusedHoverBackground', "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."));
}, localize('tabUnfocusedHoverBackground', "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."));
export const TAB_HOVER_FOREGROUND = registerColor('tab.hoverForeground', {
dark: null,
light: null,
hc: null
}, nls.localize('tabHoverForeground', "Tab foreground 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."));
}, localize('tabHoverForeground', "Tab foreground 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."));
export const TAB_UNFOCUSED_HOVER_FOREGROUND = registerColor('tab.unfocusedHoverForeground', {
dark: transparent(TAB_HOVER_FOREGROUND, 0.5),
light: transparent(TAB_HOVER_FOREGROUND, 0.5),
hc: null
}, nls.localize('tabUnfocusedHoverForeground', "Tab foreground 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."));
}, localize('tabUnfocusedHoverForeground', "Tab foreground 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."));
//#endregion
@@ -113,49 +113,49 @@ export const TAB_BORDER = registerColor('tab.border', {
dark: '#252526',
light: '#F3F3F3',
hc: contrastBorder
}, nls.localize('tabBorder', "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."));
}, localize('tabBorder', "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."));
export const TAB_LAST_PINNED_BORDER = registerColor('tab.lastPinnedBorder', {
dark: treeIndentGuidesStroke,
light: treeIndentGuidesStroke,
hc: contrastBorder
}, nls.localize('lastPinnedTabBorder', "Border to separate pinned tabs from other tabs. 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."));
}, localize('lastPinnedTabBorder', "Border to separate pinned tabs from other tabs. 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."));
export const TAB_ACTIVE_BORDER = registerColor('tab.activeBorder', {
dark: null,
light: null,
hc: null
}, nls.localize('tabActiveBorder', "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."));
}, localize('tabActiveBorder', "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."));
export const TAB_UNFOCUSED_ACTIVE_BORDER = registerColor('tab.unfocusedActiveBorder', {
dark: transparent(TAB_ACTIVE_BORDER, 0.5),
light: transparent(TAB_ACTIVE_BORDER, 0.7),
hc: null
}, nls.localize('tabActiveUnfocusedBorder', "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."));
}, localize('tabActiveUnfocusedBorder', "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."));
export const TAB_ACTIVE_BORDER_TOP = registerColor('tab.activeBorderTop', {
dark: null,
light: null,
hc: null
}, nls.localize('tabActiveBorderTop', "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."));
}, localize('tabActiveBorderTop', "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."));
export const TAB_UNFOCUSED_ACTIVE_BORDER_TOP = registerColor('tab.unfocusedActiveBorderTop', {
dark: transparent(TAB_ACTIVE_BORDER_TOP, 0.5),
light: transparent(TAB_ACTIVE_BORDER_TOP, 0.7),
hc: null
}, nls.localize('tabActiveUnfocusedBorderTop', "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."));
}, localize('tabActiveUnfocusedBorderTop', "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."));
export const TAB_HOVER_BORDER = registerColor('tab.hoverBorder', {
dark: null,
light: null,
hc: null
}, nls.localize('tabHoverBorder', "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."));
}, localize('tabHoverBorder', "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."));
export const TAB_UNFOCUSED_HOVER_BORDER = registerColor('tab.unfocusedHoverBorder', {
dark: transparent(TAB_HOVER_BORDER, 0.5),
light: transparent(TAB_HOVER_BORDER, 0.7),
hc: null
}, nls.localize('tabUnfocusedHoverBorder', "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."));
}, localize('tabUnfocusedHoverBorder', "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."));
//#endregion
@@ -165,25 +165,25 @@ export const TAB_ACTIVE_MODIFIED_BORDER = registerColor('tab.activeModifiedBorde
dark: '#3399CC',
light: '#33AAEE',
hc: null
}, nls.localize('tabActiveModifiedBorder', "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."));
}, localize('tabActiveModifiedBorder', "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."));
export const TAB_INACTIVE_MODIFIED_BORDER = registerColor('tab.inactiveModifiedBorder', {
dark: transparent(TAB_ACTIVE_MODIFIED_BORDER, 0.5),
light: transparent(TAB_ACTIVE_MODIFIED_BORDER, 0.5),
hc: Color.white
}, nls.localize('tabInactiveModifiedBorder', "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."));
}, localize('tabInactiveModifiedBorder', "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."));
export const TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER = registerColor('tab.unfocusedActiveModifiedBorder', {
dark: transparent(TAB_ACTIVE_MODIFIED_BORDER, 0.5),
light: transparent(TAB_ACTIVE_MODIFIED_BORDER, 0.7),
hc: Color.white
}, nls.localize('unfocusedActiveModifiedBorder', "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."));
}, localize('unfocusedActiveModifiedBorder', "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."));
export const TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER = registerColor('tab.unfocusedInactiveModifiedBorder', {
dark: transparent(TAB_INACTIVE_MODIFIED_BORDER, 0.5),
light: transparent(TAB_INACTIVE_MODIFIED_BORDER, 0.5),
hc: Color.white
}, nls.localize('unfocusedINactiveModifiedBorder', "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."));
}, localize('unfocusedINactiveModifiedBorder', "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."));
//#endregion
@@ -193,61 +193,61 @@ export const EDITOR_PANE_BACKGROUND = registerColor('editorPane.background', {
dark: editorBackground,
light: editorBackground,
hc: editorBackground
}, nls.localize('editorPaneBackground', "Background color of the editor pane visible on the left and right side of the centered editor layout."));
}, localize('editorPaneBackground', "Background color of the editor pane visible on the left and right side of the centered editor layout."));
registerColor('editorGroup.background', {
dark: null,
light: null,
hc: null
}, nls.localize('editorGroupBackground', "Deprecated background color of an editor group."), false, nls.localize('deprecatedEditorGroupBackground', "Deprecated: Background color of an editor group is no longer being supported with the introduction of the grid editor layout. You can use editorGroup.emptyBackground to set the background color of empty editor groups."));
}, localize('editorGroupBackground', "Deprecated background color of an editor group."), false, localize('deprecatedEditorGroupBackground', "Deprecated: Background color of an editor group is no longer being supported with the introduction of the grid editor layout. You can use editorGroup.emptyBackground to set the background color of empty editor groups."));
export const EDITOR_GROUP_EMPTY_BACKGROUND = registerColor('editorGroup.emptyBackground', {
dark: null,
light: null,
hc: null
}, nls.localize('editorGroupEmptyBackground', "Background color of an empty editor group. Editor groups are the containers of editors."));
}, localize('editorGroupEmptyBackground', "Background color of an empty editor group. Editor groups are the containers of editors."));
export const EDITOR_GROUP_FOCUSED_EMPTY_BORDER = registerColor('editorGroup.focusedEmptyBorder', {
dark: null,
light: null,
hc: focusBorder
}, nls.localize('editorGroupFocusedEmptyBorder', "Border color of an empty editor group that is focused. Editor groups are the containers of editors."));
}, localize('editorGroupFocusedEmptyBorder', "Border color of an empty editor group that is focused. Editor groups are the containers of editors."));
export const EDITOR_GROUP_HEADER_TABS_BACKGROUND = registerColor('editorGroupHeader.tabsBackground', {
dark: '#252526',
light: '#F3F3F3',
hc: null
}, nls.localize('tabsContainerBackground', "Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));
}, localize('tabsContainerBackground', "Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));
export const EDITOR_GROUP_HEADER_TABS_BORDER = registerColor('editorGroupHeader.tabsBorder', {
dark: null,
light: null,
hc: null
}, nls.localize('tabsContainerBorder', "Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));
}, localize('tabsContainerBorder', "Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));
export const EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND = registerColor('editorGroupHeader.noTabsBackground', {
dark: editorBackground,
light: editorBackground,
hc: editorBackground
}, nls.localize('editorGroupHeaderBackground', "Background color of the editor group title header when tabs are disabled (`\"workbench.editor.showTabs\": false`). Editor groups are the containers of editors."));
}, localize('editorGroupHeaderBackground', "Background color of the editor group title header when tabs are disabled (`\"workbench.editor.showTabs\": false`). Editor groups are the containers of editors."));
export const EDITOR_GROUP_HEADER_BORDER = registerColor('editorGroupHeader.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('editorTitleContainerBorder', "Border color of the editor group title header. Editor groups are the containers of editors."));
}, localize('editorTitleContainerBorder', "Border color of the editor group title header. Editor groups are the containers of editors."));
export const EDITOR_GROUP_BORDER = registerColor('editorGroup.border', {
dark: '#444444',
light: '#E7E7E7',
hc: contrastBorder
}, nls.localize('editorGroupBorder', "Color to separate multiple editor groups from each other. Editor groups are the containers of editors."));
}, localize('editorGroupBorder', "Color to separate multiple editor groups from each other. Editor groups are the containers of editors."));
export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBackground', {
dark: Color.fromHex('#53595D').transparent(0.5),
light: Color.fromHex('#2677CB').transparent(0.18),
hc: null
}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));
}, localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));
// < --- Resource Viewer --- >
@@ -255,7 +255,7 @@ export const IMAGE_PREVIEW_BORDER = registerColor('imagePreview.border', {
dark: Color.fromHex('#808080').transparent(0.35),
light: Color.fromHex('#808080').transparent(0.35),
hc: contrastBorder
}, nls.localize('imagePreviewBorder', "Border color for image in image preview."));
}, localize('imagePreviewBorder', "Border color for image in image preview."));
// < --- Panels --- >
@@ -263,74 +263,74 @@ export const PANEL_BACKGROUND = registerColor('panel.background', {
dark: editorBackground,
light: editorBackground,
hc: editorBackground
}, nls.localize('panelBackground', "Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal."));
}, localize('panelBackground', "Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal."));
export const PANEL_BORDER = registerColor('panel.border', {
dark: Color.fromHex('#808080').transparent(0.35),
light: Color.fromHex('#808080').transparent(0.35),
hc: contrastBorder
}, nls.localize('panelBorder', "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."));
}, localize('panelBorder', "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."));
export const PANEL_ACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.activeForeground', {
dark: '#E7E7E7',
light: '#424242',
hc: Color.white
}, nls.localize('panelActiveTitleForeground', "Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
}, localize('panelActiveTitleForeground', "Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
export const PANEL_INACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.inactiveForeground', {
dark: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.6),
light: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.75),
hc: Color.white
}, nls.localize('panelInactiveTitleForeground', "Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
}, localize('panelInactiveTitleForeground', "Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
export const PANEL_ACTIVE_TITLE_BORDER = registerColor('panelTitle.activeBorder', {
dark: PANEL_ACTIVE_TITLE_FOREGROUND,
light: PANEL_ACTIVE_TITLE_FOREGROUND,
hc: contrastBorder
}, nls.localize('panelActiveTitleBorder', "Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal."));
}, localize('panelActiveTitleBorder', "Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal."));
export const PANEL_INPUT_BORDER = registerColor('panelInput.border', {
dark: null,
light: Color.fromHex('#ddd'),
hc: null
}, nls.localize('panelInputBorder', "Input box border for inputs in the panel."));
}, localize('panelInputBorder', "Input box border for inputs in the panel."));
export const PANEL_DRAG_AND_DROP_BORDER = registerColor('panel.dropBorder', {
dark: PANEL_ACTIVE_TITLE_FOREGROUND,
light: PANEL_ACTIVE_TITLE_FOREGROUND,
hc: PANEL_ACTIVE_TITLE_FOREGROUND,
}, nls.localize('panelDragAndDropBorder', "Drag and drop feedback color for the panel titles. Panels are shown below the editor area and contain views like output and integrated terminal."));
}, localize('panelDragAndDropBorder', "Drag and drop feedback color for the panel titles. Panels are shown below the editor area and contain views like output and integrated terminal."));
export const PANEL_SECTION_DRAG_AND_DROP_BACKGROUND = registerColor('panelSection.dropBackground', {
dark: EDITOR_DRAG_AND_DROP_BACKGROUND,
light: EDITOR_DRAG_AND_DROP_BACKGROUND,
hc: EDITOR_DRAG_AND_DROP_BACKGROUND,
}, nls.localize('panelSectionDragAndDropBackground', "Drag and drop feedback color for the panel sections. The color should have transparency so that the panel sections can still shine through. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
}, localize('panelSectionDragAndDropBackground', "Drag and drop feedback color for the panel sections. The color should have transparency so that the panel sections can still shine through. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
export const PANEL_SECTION_HEADER_BACKGROUND = registerColor('panelSectionHeader.background', {
dark: Color.fromHex('#808080').transparent(0.2),
light: Color.fromHex('#808080').transparent(0.2),
hc: null
}, nls.localize('panelSectionHeaderBackground', "Panel section header background color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
}, localize('panelSectionHeaderBackground', "Panel section header background color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
export const PANEL_SECTION_HEADER_FOREGROUND = registerColor('panelSectionHeader.foreground', {
dark: null,
light: null,
hc: null
}, nls.localize('panelSectionHeaderForeground', "Panel section header foreground color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
}, localize('panelSectionHeaderForeground', "Panel section header foreground color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
export const PANEL_SECTION_HEADER_BORDER = registerColor('panelSectionHeader.border', {
dark: contrastBorder,
light: contrastBorder,
hc: contrastBorder
}, nls.localize('panelSectionHeaderBorder', "Panel section header border color used when multiple views are stacked vertically in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
}, localize('panelSectionHeaderBorder', "Panel section header border color used when multiple views are stacked vertically in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
export const PANEL_SECTION_BORDER = registerColor('panelSection.border', {
dark: PANEL_BORDER,
light: PANEL_BORDER,
hc: PANEL_BORDER
}, nls.localize('panelSectionBorder', "Panel section border color used when multiple views are stacked horizontally in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
}, localize('panelSectionBorder', "Panel section border color used when multiple views are stacked horizontally in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels."));
// < --- Status --- >
@@ -339,79 +339,79 @@ export const STATUS_BAR_FOREGROUND = registerColor('statusBar.foreground', {
dark: '#FFFFFF',
light: '#FFFFFF',
hc: '#FFFFFF'
}, nls.localize('statusBarForeground', "Status bar foreground color when a workspace or folder is opened. The status bar is shown in the bottom of the window."));
}, localize('statusBarForeground', "Status bar foreground color when a workspace or folder is opened. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_NO_FOLDER_FOREGROUND = registerColor('statusBar.noFolderForeground', {
dark: STATUS_BAR_FOREGROUND,
light: STATUS_BAR_FOREGROUND,
hc: STATUS_BAR_FOREGROUND
}, nls.localize('statusBarNoFolderForeground', "Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window."));
}, localize('statusBarNoFolderForeground', "Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_BACKGROUND = registerColor('statusBar.background', {
dark: '#007ACC',
light: '#007ACC',
hc: null
}, nls.localize('statusBarBackground', "Status bar background color when a workspace or folder is opened. The status bar is shown in the bottom of the window."));
}, localize('statusBarBackground', "Status bar background color when a workspace or folder is opened. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_NO_FOLDER_BACKGROUND = registerColor('statusBar.noFolderBackground', {
dark: '#68217A',
light: '#68217A',
hc: null
}, nls.localize('statusBarNoFolderBackground', "Status bar background color when no folder is opened. The status bar is shown in the bottom of the window."));
}, localize('statusBarNoFolderBackground', "Status bar background color when no folder is opened. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_BORDER = registerColor('statusBar.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('statusBarBorder', "Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window."));
}, localize('statusBarBorder', "Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_NO_FOLDER_BORDER = registerColor('statusBar.noFolderBorder', {
dark: STATUS_BAR_BORDER,
light: STATUS_BAR_BORDER,
hc: STATUS_BAR_BORDER
}, nls.localize('statusBarNoFolderBorder', "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."));
}, localize('statusBarNoFolderBorder', "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."));
export const STATUS_BAR_ITEM_ACTIVE_BACKGROUND = registerColor('statusBarItem.activeBackground', {
dark: Color.white.transparent(0.18),
light: Color.white.transparent(0.18),
hc: Color.white.transparent(0.18)
}, nls.localize('statusBarItemActiveBackground', "Status bar item background color when clicking. The status bar is shown in the bottom of the window."));
}, localize('statusBarItemActiveBackground', "Status bar item background color when clicking. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.hoverBackground', {
dark: Color.white.transparent(0.12),
light: Color.white.transparent(0.12),
hc: Color.white.transparent(0.12)
}, nls.localize('statusBarItemHoverBackground', "Status bar item background color when hovering. The status bar is shown in the bottom of the window."));
}, localize('statusBarItemHoverBackground', "Status bar item background color when hovering. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_PROMINENT_ITEM_FOREGROUND = registerColor('statusBarItem.prominentForeground', {
dark: STATUS_BAR_FOREGROUND,
light: STATUS_BAR_FOREGROUND,
hc: STATUS_BAR_FOREGROUND
}, nls.localize('statusBarProminentItemForeground', "Status bar prominent items foreground color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
}, localize('statusBarProminentItemForeground', "Status bar prominent items foreground color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_PROMINENT_ITEM_BACKGROUND = registerColor('statusBarItem.prominentBackground', {
dark: Color.black.transparent(0.5),
light: Color.black.transparent(0.5),
hc: Color.black.transparent(0.5),
}, nls.localize('statusBarProminentItemBackground', "Status bar prominent items background color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
}, localize('statusBarProminentItemBackground', "Status bar prominent items background color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.prominentHoverBackground', {
dark: Color.black.transparent(0.3),
light: Color.black.transparent(0.3),
hc: Color.black.transparent(0.3),
}, nls.localize('statusBarProminentItemHoverBackground', "Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
}, localize('statusBarProminentItemHoverBackground', "Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
export const STATUS_BAR_ERROR_ITEM_BACKGROUND = registerColor('statusBarItem.errorBackground', {
dark: darken(errorForeground, .4),
light: darken(errorForeground, .4),
hc: null,
}, nls.localize('statusBarErrorItemBackground', "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."));
}, localize('statusBarErrorItemBackground', "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."));
export const STATUS_BAR_ERROR_ITEM_FOREGROUND = registerColor('statusBarItem.errorForeground', {
dark: Color.white,
light: Color.white,
hc: Color.white,
}, nls.localize('statusBarErrorItemForeground', "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."));
}, localize('statusBarErrorItemForeground', "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."));
// < --- Activity Bar --- >
@@ -419,61 +419,61 @@ export const ACTIVITY_BAR_BACKGROUND = registerColor('activityBar.background', {
dark: '#333333',
light: '#2C2C2C',
hc: '#000000'
}, nls.localize('activityBarBackground', "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."));
}, localize('activityBarBackground', "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."));
export const ACTIVITY_BAR_FOREGROUND = registerColor('activityBar.foreground', {
dark: Color.white,
light: Color.white,
hc: Color.white
}, nls.localize('activityBarForeground', "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."));
}, localize('activityBarForeground', "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."));
export const ACTIVITY_BAR_INACTIVE_FOREGROUND = registerColor('activityBar.inactiveForeground', {
dark: transparent(ACTIVITY_BAR_FOREGROUND, 0.4),
light: transparent(ACTIVITY_BAR_FOREGROUND, 0.4),
hc: Color.white
}, nls.localize('activityBarInActiveForeground', "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."));
}, localize('activityBarInActiveForeground', "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."));
export const ACTIVITY_BAR_BORDER = registerColor('activityBar.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('activityBarBorder', "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."));
}, localize('activityBarBorder', "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."));
export const ACTIVITY_BAR_ACTIVE_BORDER = registerColor('activityBar.activeBorder', {
dark: ACTIVITY_BAR_FOREGROUND,
light: ACTIVITY_BAR_FOREGROUND,
hc: null
}, nls.localize('activityBarActiveBorder', "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."));
}, localize('activityBarActiveBorder', "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."));
export const ACTIVITY_BAR_ACTIVE_FOCUS_BORDER = registerColor('activityBar.activeFocusBorder', {
dark: null,
light: null,
hc: null
}, nls.localize('activityBarActiveFocusBorder', "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."));
}, localize('activityBarActiveFocusBorder', "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."));
export const ACTIVITY_BAR_ACTIVE_BACKGROUND = registerColor('activityBar.activeBackground', {
dark: null,
light: null,
hc: null
}, nls.localize('activityBarActiveBackground', "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."));
}, localize('activityBarActiveBackground', "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."));
export const ACTIVITY_BAR_DRAG_AND_DROP_BORDER = registerColor('activityBar.dropBorder', {
dark: ACTIVITY_BAR_FOREGROUND,
light: ACTIVITY_BAR_FOREGROUND,
hc: ACTIVITY_BAR_FOREGROUND,
}, nls.localize('activityBarDragAndDropBorder', "Drag and drop feedback color for the activity bar items. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
}, localize('activityBarDragAndDropBorder', "Drag and drop feedback color for the activity bar items. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
export const ACTIVITY_BAR_BADGE_BACKGROUND = registerColor('activityBarBadge.background', {
dark: '#007ACC',
light: '#007ACC',
hc: '#000000'
}, nls.localize('activityBarBadgeBackground', "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."));
}, localize('activityBarBadgeBackground', "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."));
export const ACTIVITY_BAR_BADGE_FOREGROUND = registerColor('activityBarBadge.foreground', {
dark: Color.white,
light: Color.white,
hc: Color.white
}, nls.localize('activityBarBadgeForeground', "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."));
}, localize('activityBarBadgeForeground', "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."));
// < --- Remote --- >
@@ -482,25 +482,25 @@ export const STATUS_BAR_HOST_NAME_BACKGROUND = registerColor('statusBarItem.remo
dark: ACTIVITY_BAR_BADGE_BACKGROUND,
light: ACTIVITY_BAR_BADGE_BACKGROUND,
hc: ACTIVITY_BAR_BADGE_BACKGROUND
}, nls.localize('statusBarItemHostBackground', "Background color for the remote indicator on the status bar."));
}, localize('statusBarItemHostBackground', "Background color for the remote indicator on the status bar."));
export const STATUS_BAR_HOST_NAME_FOREGROUND = registerColor('statusBarItem.remoteForeground', {
dark: ACTIVITY_BAR_BADGE_FOREGROUND,
light: ACTIVITY_BAR_BADGE_FOREGROUND,
hc: ACTIVITY_BAR_BADGE_FOREGROUND
}, nls.localize('statusBarItemHostForeground', "Foreground color for the remote indicator on the status bar."));
}, localize('statusBarItemHostForeground', "Foreground color for the remote indicator on the status bar."));
export const EXTENSION_BADGE_REMOTE_BACKGROUND = registerColor('extensionBadge.remoteBackground', {
dark: ACTIVITY_BAR_BADGE_BACKGROUND,
light: ACTIVITY_BAR_BADGE_BACKGROUND,
hc: ACTIVITY_BAR_BADGE_BACKGROUND
}, nls.localize('extensionBadge.remoteBackground', "Background color for the remote badge in the extensions view."));
}, localize('extensionBadge.remoteBackground', "Background color for the remote badge in the extensions view."));
export const EXTENSION_BADGE_REMOTE_FOREGROUND = registerColor('extensionBadge.remoteForeground', {
dark: ACTIVITY_BAR_BADGE_FOREGROUND,
light: ACTIVITY_BAR_BADGE_FOREGROUND,
hc: ACTIVITY_BAR_BADGE_FOREGROUND
}, nls.localize('extensionBadge.remoteForeground', "Foreground color for the remote badge in the extensions view."));
}, localize('extensionBadge.remoteForeground', "Foreground color for the remote badge in the extensions view."));
// < --- Side Bar --- >
@@ -509,49 +509,49 @@ export const SIDE_BAR_BACKGROUND = registerColor('sideBar.background', {
dark: '#252526',
light: '#F3F3F3',
hc: '#000000'
}, nls.localize('sideBarBackground', "Side bar background color. The side bar is the container for views like explorer and search."));
}, localize('sideBarBackground', "Side bar background color. The side bar is the container for views like explorer and search."));
export const SIDE_BAR_FOREGROUND = registerColor('sideBar.foreground', {
dark: null,
light: null,
hc: null
}, nls.localize('sideBarForeground', "Side bar foreground color. The side bar is the container for views like explorer and search."));
}, localize('sideBarForeground', "Side bar foreground color. The side bar is the container for views like explorer and search."));
export const SIDE_BAR_BORDER = registerColor('sideBar.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('sideBarBorder', "Side bar border color on the side separating to the editor. The side bar is the container for views like explorer and search."));
}, localize('sideBarBorder', "Side bar border color on the side separating to the editor. The side bar is the container for views like explorer and search."));
export const SIDE_BAR_TITLE_FOREGROUND = registerColor('sideBarTitle.foreground', {
dark: SIDE_BAR_FOREGROUND,
light: SIDE_BAR_FOREGROUND,
hc: SIDE_BAR_FOREGROUND
}, nls.localize('sideBarTitleForeground', "Side bar title foreground color. The side bar is the container for views like explorer and search."));
}, localize('sideBarTitleForeground', "Side bar title foreground color. The side bar is the container for views like explorer and search."));
export const SIDE_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('sideBar.dropBackground', {
dark: EDITOR_DRAG_AND_DROP_BACKGROUND,
light: EDITOR_DRAG_AND_DROP_BACKGROUND,
hc: EDITOR_DRAG_AND_DROP_BACKGROUND,
}, nls.localize('sideBarDragAndDropBackground', "Drag and drop feedback color for the side bar sections. The color should have transparency so that the side bar sections can still shine through. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
}, localize('sideBarDragAndDropBackground', "Drag and drop feedback color for the side bar sections. The color should have transparency so that the side bar sections can still shine through. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionHeader.background', {
dark: Color.fromHex('#808080').transparent(0.2),
light: Color.fromHex('#808080').transparent(0.2),
hc: null
}, nls.localize('sideBarSectionHeaderBackground', "Side bar section header background color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
}, localize('sideBarSectionHeaderBackground', "Side bar section header background color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
export const SIDE_BAR_SECTION_HEADER_FOREGROUND = registerColor('sideBarSectionHeader.foreground', {
dark: SIDE_BAR_FOREGROUND,
light: SIDE_BAR_FOREGROUND,
hc: SIDE_BAR_FOREGROUND
}, nls.localize('sideBarSectionHeaderForeground', "Side bar section header foreground color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
}, localize('sideBarSectionHeaderForeground', "Side bar section header foreground color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
export const SIDE_BAR_SECTION_HEADER_BORDER = registerColor('sideBarSectionHeader.border', {
dark: contrastBorder,
light: contrastBorder,
hc: contrastBorder
}, nls.localize('sideBarSectionHeaderBorder', "Side bar section header border color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
}, localize('sideBarSectionHeaderBorder', "Side bar section header border color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));
// < --- Title Bar --- >
@@ -560,31 +560,31 @@ export const TITLE_BAR_ACTIVE_FOREGROUND = registerColor('titleBar.activeForegro
dark: '#CCCCCC',
light: '#333333',
hc: '#FFFFFF'
}, nls.localize('titleBarActiveForeground', "Title bar foreground when the window is active."));
}, localize('titleBarActiveForeground', "Title bar foreground when the window is active."));
export const TITLE_BAR_INACTIVE_FOREGROUND = registerColor('titleBar.inactiveForeground', {
dark: transparent(TITLE_BAR_ACTIVE_FOREGROUND, 0.6),
light: transparent(TITLE_BAR_ACTIVE_FOREGROUND, 0.6),
hc: null
}, nls.localize('titleBarInactiveForeground', "Title bar foreground when the window is inactive."));
}, localize('titleBarInactiveForeground', "Title bar foreground when the window is inactive."));
export const TITLE_BAR_ACTIVE_BACKGROUND = registerColor('titleBar.activeBackground', {
dark: '#3C3C3C',
light: '#DDDDDD',
hc: '#000000'
}, nls.localize('titleBarActiveBackground', "Title bar background when the window is active."));
}, localize('titleBarActiveBackground', "Title bar background when the window is active."));
export const TITLE_BAR_INACTIVE_BACKGROUND = registerColor('titleBar.inactiveBackground', {
dark: transparent(TITLE_BAR_ACTIVE_BACKGROUND, 0.6),
light: transparent(TITLE_BAR_ACTIVE_BACKGROUND, 0.6),
hc: null
}, nls.localize('titleBarInactiveBackground', "Title bar background when the window is inactive."));
}, localize('titleBarInactiveBackground', "Title bar background when the window is inactive."));
export const TITLE_BAR_BORDER = registerColor('titleBar.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('titleBarBorder', "Title bar border color."));
}, localize('titleBarBorder', "Title bar border color."));
// < --- Menubar --- >
@@ -592,19 +592,19 @@ export const MENUBAR_SELECTION_FOREGROUND = registerColor('menubar.selectionFore
dark: TITLE_BAR_ACTIVE_FOREGROUND,
light: TITLE_BAR_ACTIVE_FOREGROUND,
hc: TITLE_BAR_ACTIVE_FOREGROUND
}, nls.localize('menubarSelectionForeground', "Foreground color of the selected menu item in the menubar."));
}, localize('menubarSelectionForeground', "Foreground color of the selected menu item in the menubar."));
export const MENUBAR_SELECTION_BACKGROUND = registerColor('menubar.selectionBackground', {
dark: transparent(Color.white, 0.1),
light: transparent(Color.black, 0.1),
hc: null
}, nls.localize('menubarSelectionBackground', "Background color of the selected menu item in the menubar."));
}, localize('menubarSelectionBackground', "Background color of the selected menu item in the menubar."));
export const MENUBAR_SELECTION_BORDER = registerColor('menubar.selectionBorder', {
dark: null,
light: null,
hc: activeContrastBorder
}, nls.localize('menubarSelectionBorder', "Border color of the selected menu item in the menubar."));
}, localize('menubarSelectionBorder', "Border color of the selected menu item in the menubar."));
// < --- Notifications --- >
@@ -612,76 +612,76 @@ export const NOTIFICATIONS_CENTER_BORDER = registerColor('notificationCenter.bor
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('notificationCenterBorder', "Notifications center border color. Notifications slide in from the bottom right of the window."));
}, localize('notificationCenterBorder', "Notifications center border color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_TOAST_BORDER = registerColor('notificationToast.border', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('notificationToastBorder', "Notification toast border color. Notifications slide in from the bottom right of the window."));
}, localize('notificationToastBorder', "Notification toast border color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_FOREGROUND = registerColor('notifications.foreground', {
dark: editorWidgetForeground,
light: editorWidgetForeground,
hc: editorWidgetForeground
}, nls.localize('notificationsForeground', "Notifications foreground color. Notifications slide in from the bottom right of the window."));
}, localize('notificationsForeground', "Notifications foreground color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_BACKGROUND = registerColor('notifications.background', {
dark: editorWidgetBackground,
light: editorWidgetBackground,
hc: editorWidgetBackground
}, nls.localize('notificationsBackground', "Notifications background color. Notifications slide in from the bottom right of the window."));
}, localize('notificationsBackground', "Notifications background color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_LINKS = registerColor('notificationLink.foreground', {
dark: textLinkForeground,
light: textLinkForeground,
hc: textLinkForeground
}, nls.localize('notificationsLink', "Notification links foreground color. Notifications slide in from the bottom right of the window."));
}, localize('notificationsLink', "Notification links foreground color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_CENTER_HEADER_FOREGROUND = registerColor('notificationCenterHeader.foreground', {
dark: null,
light: null,
hc: null
}, nls.localize('notificationCenterHeaderForeground', "Notifications center header foreground color. Notifications slide in from the bottom right of the window."));
}, localize('notificationCenterHeaderForeground', "Notifications center header foreground color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_CENTER_HEADER_BACKGROUND = registerColor('notificationCenterHeader.background', {
dark: lighten(NOTIFICATIONS_BACKGROUND, 0.3),
light: darken(NOTIFICATIONS_BACKGROUND, 0.05),
hc: NOTIFICATIONS_BACKGROUND
}, nls.localize('notificationCenterHeaderBackground', "Notifications center header background color. Notifications slide in from the bottom right of the window."));
}, localize('notificationCenterHeaderBackground', "Notifications center header background color. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_BORDER = registerColor('notifications.border', {
dark: NOTIFICATIONS_CENTER_HEADER_BACKGROUND,
light: NOTIFICATIONS_CENTER_HEADER_BACKGROUND,
hc: NOTIFICATIONS_CENTER_HEADER_BACKGROUND
}, nls.localize('notificationsBorder', "Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window."));
}, localize('notificationsBorder', "Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_ERROR_ICON_FOREGROUND = registerColor('notificationsErrorIcon.foreground', {
dark: editorErrorForeground,
light: editorErrorForeground,
hc: editorErrorForeground
}, nls.localize('notificationsErrorIconForeground', "The color used for the icon of error notifications. Notifications slide in from the bottom right of the window."));
}, localize('notificationsErrorIconForeground', "The color used for the icon of error notifications. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_WARNING_ICON_FOREGROUND = registerColor('notificationsWarningIcon.foreground', {
dark: editorWarningForeground,
light: editorWarningForeground,
hc: editorWarningForeground
}, nls.localize('notificationsWarningIconForeground', "The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window."));
}, localize('notificationsWarningIconForeground', "The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window."));
export const NOTIFICATIONS_INFO_ICON_FOREGROUND = registerColor('notificationsInfoIcon.foreground', {
dark: editorInfoForeground,
light: editorInfoForeground,
hc: editorInfoForeground
}, nls.localize('notificationsInfoIconForeground', "The color used for the icon of info notifications. Notifications slide in from the bottom right of the window."));
}, localize('notificationsInfoIconForeground', "The color used for the icon of info notifications. Notifications slide in from the bottom right of the window."));
export const WINDOW_ACTIVE_BORDER = registerColor('window.activeBorder', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('windowActiveBorder', "The color used for the border of the window when it is active. Only supported in the desktop client when using the custom title bar."));
}, localize('windowActiveBorder', "The color used for the border of the window when it is active. Only supported in the desktop client when using the custom title bar."));
export const WINDOW_INACTIVE_BORDER = registerColor('window.inactiveBorder', {
dark: null,
light: null,
hc: contrastBorder
}, nls.localize('windowInactiveBorder', "The color used for the border of the window when it is inactive. Only supported in the desktop client when using the custom title bar."));
}, localize('windowInactiveBorder', "The color used for the border of the window when it is inactive. Only supported in the desktop client when using the custom title bar."));

View File

@@ -3,12 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IPaneComposite } from 'vs/workbench/common/panecomposite';
export const SideBarVisibleContext = new RawContextKey<boolean>('sideBarVisible', false);
export const SidebarFocusContext = new RawContextKey<boolean>('sideBarFocus', false);
export const ActiveViewletContext = new RawContextKey<string>('activeViewlet', '');
export const SideBarVisibleContext = new RawContextKey<boolean>('sideBarVisible', false, localize('sideBarVisible', "Whether the sidebar is visible"));
export const SidebarFocusContext = new RawContextKey<boolean>('sideBarFocus', false, localize('sideBarFocus', "Whether the sidebar has keyboard focus"));
export const ActiveViewletContext = new RawContextKey<string>('activeViewlet', '', localize('activeViewlet', "The identifier of the active viewlet"));
export interface IViewlet extends IPaneComposite {

View File

@@ -14,7 +14,6 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService';
import { getOrSet } from 'vs/base/common/map';
import { Registry } from 'vs/platform/registry/common/platform';
import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { IAction, IActionViewItem } from 'vs/base/common/actions';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { flatten, mergeSort } from 'vs/base/common/arrays';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
@@ -48,32 +47,76 @@ export function ViewContainerLocationToString(viewContainerLocation: ViewContain
}
}
type OpenCommandActionDescriptor = {
readonly id: string;
readonly title?: string;
readonly mnemonicTitle?: string;
readonly order?: number;
readonly keybindings?: IKeybindings & { when?: ContextKeyExpression };
};
/**
* View Container Contexts
*/
export function getEnabledViewContainerContextKey(viewContainerId: string): string { return `viewContainer.${viewContainerId}.enabled`; }
export interface IViewContainerDescriptor {
/**
* The id of the view container
*/
readonly id: string;
readonly name: string;
/**
* The title of the view container
*/
readonly title: string;
/**
* Icon representation of the View container
*/
readonly icon?: ThemeIcon | URI;
/**
* Order of the view container.
*/
readonly order?: number;
/**
* IViewPaneContainer Ctor to instantiate
*/
readonly ctorDescriptor: SyncDescriptor<IViewPaneContainer>;
/**
* Descriptor for open view container command
* If not provided, view container info (id, title) is used.
*
* Note: To prevent registering open command, use `donotRegisterOpenCommand` flag while registering the view container
*/
readonly openCommandActionDescriptor?: OpenCommandActionDescriptor;
/**
* Storage id to use to store the view container state.
* If not provided, it will be derived.
*/
readonly storageId?: string;
readonly icon?: ThemeIcon | URI;
/**
* If enabled, view container is not shown if it has no active views.
*/
readonly hideIfEmpty?: boolean;
/**
* Id of the extension that contributed the view container
*/
readonly extensionId?: ExtensionIdentifier;
readonly alwaysUseContainerInfo?: boolean;
readonly focusCommand?: { id: string, keybindings?: IKeybindings };
readonly viewOrderDelegate?: ViewOrderDelegate;
readonly hideIfEmpty?: boolean;
readonly extensionId?: ExtensionIdentifier;
readonly rejectAddedViews?: boolean;
readonly order?: number;
requestedIndex?: number;
}
@@ -102,7 +145,7 @@ export interface IViewContainersRegistry {
*
* @returns the registered ViewContainer.
*/
registerViewContainer(viewContainerDescriptor: IViewContainerDescriptor, location: ViewContainerLocation, isDefault?: boolean): ViewContainer;
registerViewContainer(viewContainerDescriptor: IViewContainerDescriptor, location: ViewContainerLocation, options?: { isDefault?: boolean, donotRegisterOpenCommand?: boolean }): ViewContainer;
/**
* Deregisters the given view container
@@ -139,6 +182,11 @@ interface ViewOrderDelegate {
export interface ViewContainer extends IViewContainerDescriptor { }
interface RelaxedViewContainer extends ViewContainer {
openCommandActionDescriptor?: OpenCommandActionDescriptor;
}
class ViewContainersRegistryImpl extends Disposable implements IViewContainersRegistry {
private readonly _onDidRegister = this._register(new Emitter<{ viewContainer: ViewContainer, viewContainerLocation: ViewContainerLocation }>());
@@ -154,16 +202,17 @@ class ViewContainersRegistryImpl extends Disposable implements IViewContainersRe
return flatten([...this.viewContainers.values()]);
}
registerViewContainer(viewContainerDescriptor: IViewContainerDescriptor, viewContainerLocation: ViewContainerLocation, isDefault?: boolean): ViewContainer {
registerViewContainer(viewContainerDescriptor: IViewContainerDescriptor, viewContainerLocation: ViewContainerLocation, options?: { isDefault?: boolean, donotRegisterOpenCommand?: boolean }): ViewContainer {
const existing = this.get(viewContainerDescriptor.id);
if (existing) {
return existing;
}
const viewContainer: ViewContainer = viewContainerDescriptor;
const viewContainer: RelaxedViewContainer = viewContainerDescriptor;
viewContainer.openCommandActionDescriptor = options?.donotRegisterOpenCommand ? undefined : (viewContainer.openCommandActionDescriptor ?? { id: viewContainer.id });
const viewContainers = getOrSet(this.viewContainers, viewContainerLocation, []);
viewContainers.push(viewContainer);
if (isDefault) {
if (options?.isDefault) {
this.defaultViewContainers.push(viewContainer);
}
this._onDidRegister.fire({ viewContainer, viewContainerLocation });
@@ -241,6 +290,8 @@ export interface IViewDescriptor {
readonly group?: string;
readonly remoteAuthority?: string | string[];
readonly openCommandActionDescriptor?: OpenCommandActionDescriptor
}
export interface IViewDescriptorRef {
@@ -265,7 +316,8 @@ export interface IViewContainerModel {
readonly title: string;
readonly icon: ThemeIcon | URI | undefined;
readonly onDidChangeContainerInfo: Event<{ title?: boolean, icon?: boolean }>;
readonly keybindingId: string | undefined;
readonly onDidChangeContainerInfo: Event<{ title?: boolean, icon?: boolean, keybindingId?: boolean }>;
readonly allViewDescriptors: ReadonlyArray<IViewDescriptor>;
readonly onDidChangeAllViewDescriptors: Event<{ added: ReadonlyArray<IViewDescriptor>, removed: ReadonlyArray<IViewDescriptor> }>;
@@ -505,13 +557,14 @@ export interface IViewsService {
openView<T extends IView>(id: string, focus?: boolean): Promise<T | null>;
closeView(id: string): void;
getActiveViewWithId<T extends IView>(id: string): T | null;
getViewWithId<T extends IView>(id: string): T | null;
getViewProgressIndicator(id: string): IProgressIndicator | undefined;
}
/**
* View Contexts
*/
export const FocusedViewContext = new RawContextKey<string>('focusedView', '');
export const FocusedViewContext = new RawContextKey<string>('focusedView', '', localize('focusedView', "The identifier of the view that has keyboard focus"));
export function getVisbileViewContextKey(viewId: string): string { return `view.${viewId}.visible`; }
export const IViewDescriptorService = createDecorator<IViewDescriptorService>('viewDescriptorService');
@@ -761,9 +814,6 @@ export interface IViewPaneContainer {
setVisible(visible: boolean): void;
isVisible(): boolean;
focus(): void;
getActions(): IAction[];
getSecondaryActions(): IAction[];
getActionViewItem(action: IAction): IActionViewItem | undefined;
getActionsContext(): unknown;
getView(viewId: string): IView | undefined;
toggleViewVisibility(viewId: string): void;