<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import nls = require('vs/nls');
import winjs = require('vs/base/common/winjs.base');
import actions = require('vs/base/common/actions');
import Constants = require('vs/workbench/common/constants');
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
import {IMessageService, Severity} from 'vs/platform/message/common/message';
import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage';
import platform = require('vs/platform/platform');
import commonPlatform = require('vs/base/common/platform');
import workbenchActionRegistry = require('vs/workbench/common/actionRegistry');
import Themes = require('vs/platform/theme/common/themes');
import {IQuickOpenService, IPickOpenEntry} from 'vs/workbench/services/quickopen/common/quickOpenService';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IThemeService, IThemeData, DEFAULT_THEME_ID} from 'vs/workbench/services/themes/common/themeService';

import {ipcRenderer as ipc} from 'electron';

class SelectThemeAction extends actions.Action {

	public static ID = 'workbench.action.selectTheme';
	public static LABEL = nls.localize('selectTheme.label', 'Color Theme');

	constructor(
		id: string,
		label: string,
		@IWorkspaceContextService private contextService: IWorkspaceContextService,
		@IQuickOpenService private quickOpenService: IQuickOpenService,
		@IStorageService private storageService: IStorageService,
		@IMessageService private messageService: IMessageService,
		@IThemeService private themeService: IThemeService
	) {
		super(id, label);
	}

	public run(): winjs.TPromise<void> {

		return this.themeService.getThemes().then(contributedThemes => {
			let currentTheme = this.storageService.get(Constants.Preferences.THEME, StorageScope.GLOBAL, DEFAULT_THEME_ID);

			let picks: IPickOpenEntry[] = [];
			Themes.getBaseThemes(commonPlatform.isWindows).forEach(baseTheme => {
				picks.push({ label: Themes.toLabel(baseTheme), id: Themes.toId(baseTheme) });
			});

			let contributedThemesById: { [id: string]: IThemeData } = {};
			contributedThemes.forEach(theme => {
				picks.push({ id: theme.id, label: theme.label, description: theme.description });
				contributedThemes[theme.id] = theme;
			});

			picks = picks.sort((t1, t2) => t1.label.localeCompare(t2.label));

			let selectedPickIndex: number;
			picks.forEach((p, index) => {
				if (p.id === currentTheme) {
					selectedPickIndex = index;
				}
			});
<commit_msg>Enable high-contrast theme on all platforms.  Removed unused variable per hygiene.js<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import nls = require('vs/nls');
import winjs = require('vs/base/common/winjs.base');
import actions = require('vs/base/common/actions');
import Constants = require('vs/workbench/common/constants');
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
import {IMessageService, Severity} from 'vs/platform/message/common/message';
import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage';
import platform = require('vs/platform/platform');
import workbenchActionRegistry = require('vs/workbench/common/actionRegistry');
import Themes = require('vs/platform/theme/common/themes');
import {IQuickOpenService, IPickOpenEntry} from 'vs/workbench/services/quickopen/common/quickOpenService';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IThemeService, IThemeData, DEFAULT_THEME_ID} from 'vs/workbench/services/themes/common/themeService';

import {ipcRenderer as ipc} from 'electron';

class SelectThemeAction extends actions.Action {

	public static ID = 'workbench.action.selectTheme';
	public static LABEL = nls.localize('selectTheme.label', 'Color Theme');

	constructor(
		id: string,
		label: string,
		@IWorkspaceContextService private contextService: IWorkspaceContextService,
		@IQuickOpenService private quickOpenService: IQuickOpenService,
		@IStorageService private storageService: IStorageService,
		@IMessageService private messageService: IMessageService,
		@IThemeService private themeService: IThemeService
	) {
		super(id, label);
	}

	public run(): winjs.TPromise<void> {

		return this.themeService.getThemes().then(contributedThemes => {
			let currentTheme = this.storageService.get(Constants.Preferences.THEME, StorageScope.GLOBAL, DEFAULT_THEME_ID);

			let picks: IPickOpenEntry[] = [];
			Themes.getBaseThemes(true).forEach(baseTheme => {
				picks.push({ label: Themes.toLabel(baseTheme), id: Themes.toId(baseTheme) });
			});

			let contributedThemesById: { [id: string]: IThemeData } = {};
			contributedThemes.forEach(theme => {
				picks.push({ id: theme.id, label: theme.label, description: theme.description });
				contributedThemes[theme.id] = theme;
			});

			picks = picks.sort((t1, t2) => t1.label.localeCompare(t2.label));

			let selectedPickIndex: number;
			picks.forEach((p, index) => {
				if (p.id === currentTheme) {
					selectedPickIndex = index;
				}
			});

{'fraction_non_alphanumeric': 0.18196119559517568, 'fraction_numerical': 0.0013983569306065373, 'mean_word_length': 3.8368554522400675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4556428', 'n_tokens_mistral': 1698, 'n_tokens_neox': 1574, 'n_words': 351}