vsc-material-theme/extensions/material.theme.config.ts

34 lines
923 B
TypeScript
Raw Normal View History

2017-05-28 16:50:44 +02:00
import * as vscode from 'vscode';
import { IGenericObject } from "./interfaces/igeneric-object";
import { THEME_ACCENTS_SETTER } from "./commands/accents-setter/index";
import { THEME_CHANGE_LISTENER } from "./commands/theme-icons/index";
2017-05-28 16:50:44 +02:00
enum Commands {
ACCENTS,
COLOR_THEME
}
const OPTIONS: IGenericObject<number> = {
2017-06-13 09:46:37 +02:00
'Change accent color': Commands.ACCENTS
2017-05-28 16:50:44 +02:00
}
export function activate(context: vscode.ExtensionContext) {
// registering the command
let command = vscode.commands.registerCommand('material.theme.config', () => {
// the user is going to choose what aspect of theme to config
vscode.window.showQuickPick(Object.keys(OPTIONS)).then(response => {
// switching selected option
switch(OPTIONS[response]) {
2017-05-29 18:01:55 +02:00
case Commands.ACCENTS:
THEME_ACCENTS_SETTER();
2017-05-28 16:50:44 +02:00
break;
}
});
});
THEME_CHANGE_LISTENER();
2017-05-28 16:50:44 +02:00
context.subscriptions.push(command);
}