From a0b4aa5d788174a33f9def7d3218dccf830591a7 Mon Sep 17 00:00:00 2001 From: whosydd Date: Thu, 14 Oct 2021 17:11:50 +0800 Subject: [PATCH] 1.2.4 --- .vscode/extensions.json | 8 -------- CHANGELOG.md | 4 ++++ package.json | 2 +- src/extension.ts | 6 +++--- src/{ => utils}/add.ts | 2 +- src/{ => utils}/remove.ts | 23 +++++++++++++---------- src/{ => utils}/reset.ts | 2 +- 7 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 .vscode/extensions.json rename src/{ => utils}/add.ts (98%) rename src/{ => utils}/remove.ts (73%) rename src/{ => utils}/reset.ts (98%) diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 3d11ddc..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "dbaeumer.vscode-eslint", - "eamodio.tsl-problem-matcher" - ] -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 02bdd3e..f6c6319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.2.4 (2021-10-14) + +- 修复:移除主题时,没有选择会弹出‘移除 undefined 的提示’ + ## 1.2.3 (2021-09-21) - 修改 "debugConsole.warningForeground": "#dfbb74" diff --git a/package.json b/package.json index dc4b80a..f9a6a13 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ayu-mirage-plus", "displayName": "Ayu Mirage Plus", "description": "This theme is basic on Ayu Mirage, just for fun! :)", - "version": "1.2.3", + "version": "1.2.4", "publisher": "GY", "repository": { "type": "git", diff --git a/src/extension.ts b/src/extension.ts index 23bb8ef..1d4d2c2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ import * as vscode from 'vscode' -import add from './add' -import remove from './remove' -import reset from './reset' +import add from './utils/add' +import remove from './utils/remove' +import reset from './utils/reset' export function activate(context: vscode.ExtensionContext) { // 生成主题 diff --git a/src/add.ts b/src/utils/add.ts similarity index 98% rename from src/add.ts rename to src/utils/add.ts index 395b607..a9aafc6 100644 --- a/src/add.ts +++ b/src/utils/add.ts @@ -1,6 +1,6 @@ import * as fs from 'fs' import * as vscode from 'vscode' -import settings from './config/settings' +import settings from '../config/settings' const { foregroundColors, themeColors, borderColors, highlightColors } = settings diff --git a/src/remove.ts b/src/utils/remove.ts similarity index 73% rename from src/remove.ts rename to src/utils/remove.ts index de86312..7081ec2 100644 --- a/src/remove.ts +++ b/src/utils/remove.ts @@ -30,15 +30,18 @@ export default async () => { const res = themes.filter(item => !rmThemeList?.includes(item)) packageFile.contributes.themes = res fs.writeFileSync(`${__dirname}/../package.json`, JSON.stringify(packageFile)) - vscode.window - .showInformationMessage( - `${rmThemeList?.map(item => item.label).toString()} has been removed!`, - 'Reload Window' - ) - .then(value => - value === 'Reload Window' - ? vscode.commands.executeCommand('workbench.action.reloadWindow') - : null - ) + + if (rmThemeList !== undefined) { + vscode.window + .showInformationMessage( + `${rmThemeList?.map(item => item.label).toString()} has been removed!`, + 'Reload Window' + ) + .then(value => + value === 'Reload Window' + ? vscode.commands.executeCommand('workbench.action.reloadWindow') + : null + ) + } }) } diff --git a/src/reset.ts b/src/utils/reset.ts similarity index 98% rename from src/reset.ts rename to src/utils/reset.ts index f53973c..edaf7a1 100644 --- a/src/reset.ts +++ b/src/utils/reset.ts @@ -1,6 +1,6 @@ import * as fs from 'fs' import * as vscode from 'vscode' -import settings from './config/settings' +import settings from '../config/settings' const { foregroundColors, themeColors, borderColors, highlightColors } = settings