Skip to content

Commit

Permalink
修复一些小错误
Browse files Browse the repository at this point in the history
  • Loading branch information
itldg committed Apr 19, 2022
1 parent cba40c1 commit 167d7ab
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

- 列表搜索代码片段

## [0.0.4] - 2022-04-06

### Added
- 增加非工作区修改配置的警告提示

### Fixed
- 一处文档翻译的错误

### Removed
- 取消填写token的提示

## [0.0.3] - 2022-04-06

### Added
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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":"评论列表",
Expand Down
18 changes: 9 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ async function checkConfig() {
async function setToken(): Promise<boolean> {
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;
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 167d7ab

Please sign in to comment.