Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -3,10 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { Event, Emitter } from 'vs/base/common/event';
import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService';
import { IThemeService, ITheme, DARK, IIconTheme } from 'vs/platform/theme/common/themeService';
import { Color } from 'vs/base/common/color';
export class TestTheme implements ITheme {
@@ -14,12 +12,12 @@ export class TestTheme implements ITheme {
constructor(private colors: { [id: string]: string; } = {}, public type = DARK) {
}
getColor(color: string, useDefault?: boolean): Color {
getColor(color: string, useDefault?: boolean): Color | null {
let value = this.colors[color];
if (value) {
return Color.fromHex(value);
}
return void 0;
return null;
}
defines(color: string): boolean {
@@ -27,14 +25,23 @@ export class TestTheme implements ITheme {
}
}
export class TestIconTheme implements IIconTheme {
hasFileIcons = false;
hasFolderIcons = false;
hidesExplorerArrows = false;
}
export class TestThemeService implements IThemeService {
_serviceBrand: any;
_theme: ITheme;
_iconTheme: IIconTheme;
_onThemeChange = new Emitter<ITheme>();
_onIconThemeChange = new Emitter<IIconTheme>();
constructor(theme = new TestTheme()) {
constructor(theme = new TestTheme(), iconTheme = new TestIconTheme()) {
this._theme = theme;
this._iconTheme = iconTheme;
}
getTheme(): ITheme {
@@ -53,4 +60,12 @@ export class TestThemeService implements IThemeService {
public get onThemeChange(): Event<ITheme> {
return this._onThemeChange.event;
}
getIconTheme(): IIconTheme {
return this._iconTheme;
}
public get onIconThemeChange(): Event<IIconTheme> {
return this._onIconThemeChange.event;
}
}

View File

@@ -3,21 +3,21 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { Registry } from 'vs/platform/registry/common/platform';
import { IColorRegistry, Extensions, ColorContribution } from 'vs/platform/theme/common/colorRegistry';
import { editorMarkerNavigationError } from 'vs/editor/contrib/gotoError/gotoErrorWidget';
import { overviewRulerModifiedForeground } from 'vs/workbench/parts/scm/electron-browser/dirtydiffDecorator';
import { STATUS_BAR_DEBUGGING_BACKGROUND } from 'vs/workbench/parts/debug/browser/statusbarColorProvider';
import { debugExceptionWidgetBackground } from 'vs/workbench/parts/debug/browser/exceptionWidget';
import { debugToolBarBackground } from 'vs/workbench/parts/debug/browser/debugActionsWidget';
import { debugToolBarBackground } from 'vs/workbench/parts/debug/browser/debugToolbar';
import { buttonBackground } from 'vs/workbench/parts/welcome/page/electron-browser/welcomePage';
import { embeddedEditorBackground } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart';
import { request, asText } from 'vs/base/node/request';
import * as pfs from 'vs/base/node/pfs';
import * as path from 'path';
import * as assert from 'assert';
import { getPathFromAmdModule } from 'vs/base/common/amd';
import { CancellationToken } from 'vs/base/common/cancellation';
interface ColorInfo {
@@ -35,12 +35,12 @@ interface DescriptionDiff {
export const forceColorLoad = [editorMarkerNavigationError, overviewRulerModifiedForeground, STATUS_BAR_DEBUGGING_BACKGROUND,
debugExceptionWidgetBackground, debugToolBarBackground, buttonBackground, embeddedEditorBackground];
export const experimental = []; // 'settings.modifiedItemForeground', 'editorUnnecessary.foreground' ];
export const experimental: string[] = []; // 'settings.modifiedItemForeground', 'editorUnnecessary.foreground' ];
suite('Color Registry', function () {
test('all colors documented', async function () {
const reqContext = await request({ url: 'https://raw.githubusercontent.com/Microsoft/vscode-docs/vnext/docs/getstarted/theme-color-reference.md' });
const reqContext = await request({ url: 'https://raw.githubusercontent.com/Microsoft/vscode-docs/vnext/docs/getstarted/theme-color-reference.md' }, CancellationToken.None);
const content = await asText(reqContext);
const expression = /\-\s*\`([\w\.]+)\`: (.*)/g;
@@ -103,7 +103,7 @@ function getDescription(color: ColorContribution) {
}
async function getColorsFromExtension(): Promise<{ [id: string]: string }> {
let extPath = require.toUrl('../../../../../../extensions');
let extPath = getPathFromAmdModule(require, '../../../../../../extensions');
let extFolders = await pfs.readDirsInDir(extPath);
let result: { [id: string]: string } = Object.create(null);
for (let folder of extFolders) {
@@ -127,4 +127,4 @@ async function getColorsFromExtension(): Promise<{ [id: string]: string }> {
}
return result;
}
}