11import * as vscode from 'vscode' ;
2- import { activateIconTheme } from './activate' ;
2+ import { activateIcons } from './activate' ;
33import { toggleFolderArrows } from './folderArrows' ;
44import { changeFolderColor } from './folderColor' ;
55import { changeFolderTheme } from './folders' ;
@@ -9,59 +9,19 @@ import { changeOpacity } from './opacity';
99import { restoreDefaultConfig } from './restoreConfig' ;
1010import { changeSaturation } from './saturation' ;
1111
12- // Activate theme
13- const activateThemeCommand = vscode . commands . registerCommand ( 'material-icon-theme.activateIcons' , ( ) => {
14- activateIconTheme ( ) ;
12+ const commands = {
13+ activateIcons,
14+ toggleIconPacks,
15+ changeFolderTheme,
16+ changeFolderColor,
17+ restoreDefaultConfig,
18+ toggleFolderArrows,
19+ changeOpacity,
20+ toggleGrayscale,
21+ changeSaturation
22+ } ;
23+
24+ export const registered = Object . keys ( commands ) . map ( commandName => {
25+ const callCommand = ( ) => commands [ commandName ] ( ) ;
26+ return vscode . commands . registerCommand ( `material-icon-theme.${ commandName } ` , callCommand ) ;
1527} ) ;
16-
17- // Icon packs
18- const toggleIconPacksCommand = vscode . commands . registerCommand ( 'material-icon-theme.toggleIconPacks' , ( ) => {
19- toggleIconPacks ( ) ;
20- } ) ;
21-
22- // Folder themes
23- const changeFolderThemeCommand = vscode . commands . registerCommand ( 'material-icon-theme.changeFolderTheme' , ( ) => {
24- changeFolderTheme ( ) ;
25- } ) ;
26-
27- // Folder color
28- const toggleFolderColorCommand = vscode . commands . registerCommand ( 'material-icon-theme.changeFolderColor' , ( ) => {
29- changeFolderColor ( ) ;
30- } ) ;
31-
32- // Reset config
33- const restoreDefaultConfigCommand = vscode . commands . registerCommand ( 'material-icon-theme.restoreDefaultConfig' , ( ) => {
34- restoreDefaultConfig ( ) ;
35- } ) ;
36-
37- // Toggle the arrows near the folder icons
38- const hidesExplorerArrowsCommand = vscode . commands . registerCommand ( 'material-icon-theme.hidesExplorerArrows' , ( ) => {
39- toggleFolderArrows ( ) ;
40- } ) ;
41-
42- // Change the opacity of the icons
43- const changeOpacityCommand = vscode . commands . registerCommand ( 'material-icon-theme.opacity' , ( ) => {
44- changeOpacity ( ) ;
45- } ) ;
46-
47- // Toggle grayscale icons
48- const grayscaleCommand = vscode . commands . registerCommand ( 'material-icon-theme.grayscale' , ( ) => {
49- toggleGrayscale ( ) ;
50- } ) ;
51-
52- // Change the saturation of the icons
53- const changeSaturationCommand = vscode . commands . registerCommand ( 'material-icon-theme.saturation' , ( ) => {
54- changeSaturation ( ) ;
55- } ) ;
56-
57- export const commands = [
58- activateThemeCommand ,
59- toggleIconPacksCommand ,
60- changeFolderThemeCommand ,
61- toggleFolderColorCommand ,
62- restoreDefaultConfigCommand ,
63- hidesExplorerArrowsCommand ,
64- changeOpacityCommand ,
65- grayscaleCommand ,
66- changeSaturationCommand
67- ] ;
0 commit comments