mirror of
https://github.com/coder/code-server.git
synced 2026-05-10 06:17:27 +02:00
chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@@ -11,7 +11,7 @@ import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
import { CSSIcon } from 'vs/base/common/codicons';
|
||||
import { Codicon, CSSIcon } from 'vs/base/common/codicons';
|
||||
|
||||
export const IThemeService = createDecorator<IThemeService>('themeService');
|
||||
|
||||
@@ -70,50 +70,13 @@ export namespace ThemeIcon {
|
||||
return ti1.id === ti2.id && ti1.color?.id === ti2.color?.id;
|
||||
}
|
||||
|
||||
const _regexAsClassName = /^(codicon\/)?([a-z-]+)(~[a-z]+)?$/i;
|
||||
|
||||
export function asClassNameArray(icon: ThemeIcon): string[] {
|
||||
const match = _regexAsClassName.exec(icon.id);
|
||||
if (!match) {
|
||||
return ['codicon', 'codicon-error'];
|
||||
}
|
||||
let [, , name, modifier] = match;
|
||||
let className = `codicon-${name}`;
|
||||
if (modifier) {
|
||||
return ['codicon', className, modifier.substr(1)];
|
||||
}
|
||||
return ['codicon', className];
|
||||
}
|
||||
|
||||
|
||||
export function asClassName(icon: ThemeIcon): string {
|
||||
return asClassNameArray(icon).join(' ');
|
||||
}
|
||||
|
||||
export function asCSSSelector(icon: ThemeIcon): string {
|
||||
return '.' + asClassNameArray(icon).join('.');
|
||||
}
|
||||
|
||||
export function asCSSIcon(icon: ThemeIcon): CSSIcon {
|
||||
return {
|
||||
classNames: asClassName(icon)
|
||||
};
|
||||
}
|
||||
|
||||
export function asCodiconLabel(icon: ThemeIcon): string {
|
||||
return '$(' + icon.id + ')';
|
||||
}
|
||||
|
||||
export function revive(icon: any): ThemeIcon | undefined {
|
||||
if (ThemeIcon.isThemeIcon(icon)) {
|
||||
return { id: icon.id, color: icon.color ? { id: icon.color.id } : undefined };
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
export const asClassNameArray: (icon: ThemeIcon) => string[] = CSSIcon.asClassNameArray;
|
||||
export const asClassName: (icon: ThemeIcon) => string = CSSIcon.asClassName;
|
||||
export const asCSSSelector: (icon: ThemeIcon) => string = CSSIcon.asCSSSelector;
|
||||
}
|
||||
|
||||
export const FileThemeIcon = { id: 'file' };
|
||||
export const FolderThemeIcon = { id: 'folder' };
|
||||
export const FileThemeIcon = Codicon.file;
|
||||
export const FolderThemeIcon = Codicon.folder;
|
||||
|
||||
export function getThemeTypeSelector(type: ColorScheme): string {
|
||||
switch (type) {
|
||||
|
||||
Reference in New Issue
Block a user