Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"@microsoft/1ds-post-js": "^3.2.13",
"@parcel/watcher": "parcel-bundler/watcher#1ca032aa8339260a8a3bcf825c3a1a71e3e43542",
"@types/semver": "^7.5.8",
"@vscode/codicons": "^0.0.43",
"@vscode/deviceid": "^0.1.1",
"@vscode/iconv-lite-umd": "0.7.1",
"@vscode/policy-watcher": "^1.3.2",
Expand Down
6 changes: 0 additions & 6 deletions src/vs/base/browser/ui/codicons/codicon/codicon.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

@font-face {
font-family: "codicon";
font-display: block;
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
}

.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/standalone/browser/standaloneThemeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ export class StandaloneThemeService extends Disposable implements IStandaloneThe
this._knownThemes.set(VS_DARK_THEME_NAME, newBuiltInTheme(VS_DARK_THEME_NAME));
this._knownThemes.set(HC_BLACK_THEME_NAME, newBuiltInTheme(HC_BLACK_THEME_NAME));
this._knownThemes.set(HC_LIGHT_THEME_NAME, newBuiltInTheme(HC_LIGHT_THEME_NAME));

const iconsStyleSheet = this._register(getIconsStyleSheet(this));
this._environment.isBuilt = false;
const iconsStyleSheet = this._register(getIconsStyleSheet(this, this._environment));

this._codiconCSS = iconsStyleSheet.getCSS();
this._themeCSS = '';
Expand Down
10 changes: 9 additions & 1 deletion src/vs/platform/theme/browser/iconsStyleSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { canASAR } from '../../../amdX.js';
import * as css from '../../../base/browser/cssValue.js';
import { Emitter, Event } from '../../../base/common/event.js';
import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js';
import { AppResourcePath, FileAccess, nodeModulesAsarUnpackedPath, nodeModulesPath } from '../../../base/common/network.js';
import { ThemeIcon } from '../../../base/common/themables.js';
import { IEnvironmentService } from '../../environment/common/environment.js';
import { getIconRegistry, IconContribution, IconFontDefinition } from '../common/iconRegistry.js';
import { IProductIconTheme, IThemeService } from '../common/themeService.js';

Expand All @@ -15,7 +18,11 @@ export interface IIconsStyleSheet extends IDisposable {
readonly onDidChange: Event<void>;
}

export function getIconsStyleSheet(themeService: IThemeService | undefined): IIconsStyleSheet {
export function getModuleLocation(environmentService: IEnvironmentService): AppResourcePath {
return `${(canASAR && environmentService.isBuilt) ? nodeModulesAsarUnpackedPath : nodeModulesPath}/@vscode/codicons/dist/codicon.ttf`;
}

export function getIconsStyleSheet(themeService: IThemeService | undefined, environmentService: IEnvironmentService): IIconsStyleSheet {
const disposable = new DisposableStore();

const onDidChangeEmmiter = disposable.add(new Emitter<void>());
Expand All @@ -34,6 +41,7 @@ export function getIconsStyleSheet(themeService: IThemeService | undefined): IIc

const rules = new css.Builder();
const rootAttribs = new css.Builder();
rules.push(css.inline`@font-face { font-family: "codicon"; font-display: block; src: ${css.asCSSUrl(FileAccess.asFileUri(getModuleLocation(environmentService)).with({ query: '5d4d76ab2ce5108968ad644d591a16a6' }))} format("truetype");}`);
for (const contribution of iconRegistry.getIcons()) {
const definition = productIconTheme.getIcon(contribution);
if (!definition) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { IIssueFormService, IssueReporterData, IssueReporterExtensionData, Issue
import { normalizeGitHubUrl } from '../common/issueReporterUtil.js';
import { IssueReporterModel, IssueReporterData as IssueReporterModelData } from './issueReporterModel.js';
import { IAuthenticationService } from '../../../services/authentication/common/authentication.js';
import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';

const MAX_URL_LENGTH = 7500;

Expand Down Expand Up @@ -92,7 +93,8 @@ export class BaseIssueReporterService extends Disposable {
@IFileDialogService public readonly fileDialogService: IFileDialogService,
@IContextMenuService public readonly contextMenuService: IContextMenuService,
@IAuthenticationService public readonly authenticationService: IAuthenticationService,
@IOpenerService public readonly openerService: IOpenerService
@IOpenerService public readonly openerService: IOpenerService,
@IEnvironmentService private readonly environmentService: IEnvironmentService
) {
super();
const targetExtension = data.extensionId ? data.enabledExtensions.find(extension => extension.id.toLocaleLowerCase() === data.extensionId?.toLocaleLowerCase()) : undefined;
Expand Down Expand Up @@ -175,7 +177,7 @@ export class BaseIssueReporterService extends Disposable {
const codiconStyleSheet = createStyleSheet();
codiconStyleSheet.id = 'codiconStyles';

const iconsStyleSheet = this._register(getIconsStyleSheet(this.themeService));
const iconsStyleSheet = this._register(getIconsStyleSheet(this.themeService, this.environmentService));
function updateAll() {
codiconStyleSheet.textContent = iconsStyleSheet.getCSS();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IProductConfiguration } from '../../../../base/common/product.js';
import { localize } from '../../../../nls.js';
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
import { IFileDialogService } from '../../../../platform/dialogs/common/dialogs.js';
import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';
import { IFileService } from '../../../../platform/files/common/files.js';
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
Expand Down Expand Up @@ -33,9 +34,10 @@ export class IssueWebReporter extends BaseIssueReporterService {
@IFileDialogService fileDialogService: IFileDialogService,
@IContextMenuService contextMenuService: IContextMenuService,
@IAuthenticationService authenticationService: IAuthenticationService,
@IOpenerService openerService: IOpenerService
@IOpenerService openerService: IOpenerService,
@IEnvironmentService environmentService: IEnvironmentService
) {
super(disableExtensions, data, os, product, window, true, issueFormService, themeService, fileService, fileDialogService, contextMenuService, authenticationService, openerService);
super(disableExtensions, data, os, product, window, true, issueFormService, themeService, fileService, fileDialogService, contextMenuService, authenticationService, openerService, environmentService);

// eslint-disable-next-line no-restricted-syntax
const target = this.window.document.querySelector<HTMLElement>('.block-system .block-info');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { IAuthenticationService } from '../../../services/authentication/common/
import { BaseIssueReporterService } from '../browser/baseIssueReporterService.js';
import { IssueReporterData as IssueReporterModelData } from '../browser/issueReporterModel.js';
import { IIssueFormService, IssueReporterData, IssueType } from '../common/issue.js';
import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';

// GitHub has let us know that we could up our limit here to 8k. We chose 7500 to play it safe.
// ref https://github.com/microsoft/vscode/issues/159191
Expand Down Expand Up @@ -57,9 +58,10 @@ export class IssueReporter extends BaseIssueReporterService {
@IContextKeyService contextKeyService: IContextKeyService,
@IContextMenuService contextMenuService: IContextMenuService,
@IAuthenticationService authenticationService: IAuthenticationService,
@IOpenerService openerService: IOpenerService
@IOpenerService openerService: IOpenerService,
@IEnvironmentService environmentService: IEnvironmentService
) {
super(disableExtensions, data, os, product, window, false, issueFormService, themeService, fileService, fileDialogService, contextMenuService, authenticationService, openerService);
super(disableExtensions, data, os, product, window, false, issueFormService, themeService, fileService, fileDialogService, contextMenuService, authenticationService, openerService, environmentService);
this.processService = processService;
this.processService.getSystemInfo().then(info => {
this.issueReporterModel.update({ systemInfo: info });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class WorkbenchThemeService extends Disposable implements IWorkbenchTheme
const codiconStyleSheet = createStyleSheet();
codiconStyleSheet.id = 'codiconStyles';

const iconsStyleSheet = this._register(getIconsStyleSheet(this));
const iconsStyleSheet = this._register(getIconsStyleSheet(this, this.environmentService));
function updateAll() {
codiconStyleSheet.textContent = iconsStyleSheet.getCSS();
}
Expand Down
Loading