mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user