From 678d5c3e97ae7a2ff5affdada907e00f97c9804d Mon Sep 17 00:00:00 2001 From: Alessio Occhipinti Date: Sun, 25 Nov 2018 23:06:27 +0100 Subject: [PATCH] fix: revert id on package json for conflict (#292) --- extensions/helpers/fs.ts | 5 +---- extensions/helpers/settings.ts | 2 +- extensions/interfaces/ipackage.json.ts | 1 - package.json | 10 ---------- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/extensions/helpers/fs.ts b/extensions/helpers/fs.ts index ca80024..9dca63b 100644 --- a/extensions/helpers/fs.ts +++ b/extensions/helpers/fs.ts @@ -61,10 +61,7 @@ export function getThemeIconsContribute(ID: string): IPackageJSONThemeIcons { */ export function getIconVariantFromTheme(theme: string): string { const {themeIconVariants} = getDefaultValues(); - const splitted = theme.split('-'); - const variantIcon = splitted[splitted.length - 1]; - const found = Object.keys(themeIconVariants) - .find(key => themeIconVariants[key].includes(variantIcon)); + const found = Object.keys(themeIconVariants).find(variant => theme.includes(variant)); return found ? found.toLowerCase() : null; } diff --git a/extensions/helpers/settings.ts b/extensions/helpers/settings.ts index da1a811..a943ed6 100644 --- a/extensions/helpers/settings.ts +++ b/extensions/helpers/settings.ts @@ -44,7 +44,7 @@ export function isAccent(accentName: string, defaults: IDefaults): boolean { */ export function isMaterialTheme(themeName: string): boolean { const packageJSON = getPackageJSON(); - return Boolean(packageJSON.contributes.themes.find(contrib => contrib.id === themeName)); + return Boolean(packageJSON.contributes.themes.find(contrib => contrib.label === themeName)); } /** diff --git a/extensions/interfaces/ipackage.json.ts b/extensions/interfaces/ipackage.json.ts index 0c1b572..edd732a 100644 --- a/extensions/interfaces/ipackage.json.ts +++ b/extensions/interfaces/ipackage.json.ts @@ -24,7 +24,6 @@ export interface IPackageJSONCommand { } export interface IPackageJSONTheme { - id: string; label: string; path: string; uiTheme: string; diff --git a/package.json b/package.json index 5aac379..94ccb3f 100644 --- a/package.json +++ b/package.json @@ -122,61 +122,51 @@ }, "themes": [ { - "id": "eq-material-theme-default", "label": "Material Theme", "path": "./themes/Material-Theme-Default.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-default-high-contrast", "label": "Material Theme High Contrast", "path": "./themes/Material-Theme-Default-High-Contrast.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-darker", "label": "Material Theme Darker", "path": "./themes/Material-Theme-Darker.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-darker-high-contrast", "label": "Material Theme Darker High Contrast", "path": "./themes/Material-Theme-Darker-High-Contrast.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-palenight", "label": "Material Theme Palenight", "path": "./themes/Material-Theme-Palenight.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-palenight-high-contrast", "label": "Material Theme Palenight High Contrast", "path": "./themes/Material-Theme-Palenight-High-Contrast.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-ocean", "label": "Material Theme Ocean", "path": "./themes/Material-Theme-Ocean.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-ocean-high-contrast", "label": "Material Theme Ocean High Contrast", "path": "./themes/Material-Theme-Ocean-High-Contrast.json", "uiTheme": "vs-dark" }, { - "id": "eq-material-theme-lighter", "label": "Material Theme Lighter", "path": "./themes/Material-Theme-Lighter.json", "uiTheme": "vs" }, { - "id": "eq-material-theme-lighter-high-contrast", "label": "Material Theme Lighter High Contrast", "path": "./themes/Material-Theme-Lighter-High-Contrast.json", "uiTheme": "vs"