From 167d7aba1ad060afedd4c7a863d863e3e8d008e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=A4=A7=E5=93=A5?= Date: Tue, 19 Apr 2022 08:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E5=B0=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 14 +++++++++++++- package-lock.json | 4 ++-- package.json | 2 +- package.nls.json | 1 - package.nls.zh-cn.json | 3 +-- src/extension.ts | 18 +++++++++--------- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b95da08..1c91ab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ - 列表搜索代码片段 +## [0.0.4] - 2022-04-06 + +### Added +- 增加非工作区修改配置的警告提示 + +### Fixed +- 一处文档翻译的错误 + +### Removed +- 取消填写token的提示 + ## [0.0.3] - 2022-04-06 ### Added @@ -41,7 +52,8 @@ - 修改评论 - 删除评论 -[unreleased]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.3...HEAD +[unreleased]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.4...HEAD +[0.0.4]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.3...v0.0.4 [0.0.3]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.2...v0.0.3 [0.0.2]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.1...v0.0.2 [0.0.1]: https://github.com/wanglong126/vscode-ldggist/releases/tag/v0.0.1 diff --git a/package-lock.json b/package-lock.json index ea85a87..3c83868 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ldggist", - "version": "0.0.1", + "version": "0.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ldggist", - "version": "0.0.1", + "version": "0.0.3", "dependencies": { "fs-extra": "^10.0.1", "request": "^2.88.2" diff --git a/package.json b/package.json index a78ef7a..1fde894 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "LdgGist", "publisher": "itldg", "description": "基于Gitee和GitHub的代码片段管理工具", - "version": "0.0.3", + "version": "0.0.4", "icon": "resources/logo.png", "engines": { "vscode": "^1.65.0" diff --git a/package.nls.json b/package.nls.json index 8897eca..8f18a80 100644 --- a/package.nls.json +++ b/package.nls.json @@ -3,7 +3,6 @@ "ldgGist.login":"Set access token", "ldgGist.fillToken":"Please fill in Access_token", "ldgGist.noTokenMsg": "You have not configured access_token, please enter access_token in the input box to continue.", - "ldgGist.tokenFillCanceled":"Token fill in canceled", "ldgGist.gists":"Gists", "ldgGist.commits":"Commits", "ldgGist.comments":"Comments", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index f6f73c7..b7cdb21 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -2,8 +2,7 @@ "ldgGist.name":"LDG 代码片段", "ldgGist.login":"设置私人令牌", "ldgGist.fillToken":"请填写您的私人令牌", - "ldgGist.noTokenMsg": "测试中文翻译", - "ldgGist.tokenFillCanceled":"私人令牌填写已取消", + "ldgGist.noTokenMsg": "您还没有配置access_token,请在输入框中输入access_token", "ldgGist.gists":"代码片段", "ldgGist.commits":"提交历史", "ldgGist.comments":"评论列表", diff --git a/src/extension.ts b/src/extension.ts index 54a32bb..6715e6d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -64,10 +64,14 @@ async function checkConfig() { async function setToken(): Promise { const token = await vscode.window.showInputBox({ placeHolder: localize(`${pluginName}.fillToken`), value: lastToken }); if (token) { - await vscode.workspace.getConfiguration(pluginName).update('accessToken', token); - checkType(token); - vscode.commands.executeCommand(`${pluginName}.refreshGists`); vscode.commands.executeCommand(`${pluginName}.refreshPublicGists`); - return true; + try { + await vscode.workspace.getConfiguration(pluginName).update('accessToken', token); + checkType(token); + vscode.commands.executeCommand(`${pluginName}.refreshGists`); vscode.commands.executeCommand(`${pluginName}.refreshPublicGists`); + return true; + } catch (error:any) { + vscode.window.showWarningMessage(error.message); + } } return false; } @@ -82,8 +86,6 @@ function registerCommand(context: vscode.ExtensionContext, name: string, callbac let disposable = vscode.commands.registerCommand(`${pluginName}.${name}`, async (...args: any) => { if (name === "login" || await checkConfig()) { callback(args); - } else { - vscode.window.showInformationMessage(localize(`%${pluginName}.tokenFillCanceled%`)); } }); context.subscriptions.push(disposable); @@ -92,9 +94,7 @@ function registerCommandOneArg(context: vscode.ExtensionContext, name: string, c let disposable = vscode.commands.registerCommand(`${pluginName}.${name}`, async (arg: any) => { if (name === "login" || await checkConfig()) { callback(arg); - } else { - vscode.window.showInformationMessage(localize(`%${pluginName}.tokenFillCanceled%`)); - } + } }); context.subscriptions.push(disposable); }