Skip to content

Commit

Permalink
简介增加一些常用图标,更换令牌后自动刷新数据
Browse files Browse the repository at this point in the history
  • Loading branch information
itldg committed Apr 6, 2022
1 parent 24bbf8c commit 2658ba9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ dist
node_modules
.vscode-test/
*.vsix
/.DS_Store
*/.DS_Store
.DS_Store
.DS_Store
*/.DS_Store
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"ldgGist.accessToken": "c3b37799402699cbab9c2df7c98ec2eb"
}
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
[comment]: <> (语义化版本 2.0.0 https://semver.org/lang/zh-CN/) [comment]: <> (如何维护更新日志 https://keepachangelog.com/zh-CN/1.0.0/)

[comment]: <> (Added 新添加的功能。) [comment]: <> (Changed 对现有功能的变更。) [comment]: <> (Deprecated 已经不建议使用,准备很快移除的功能。) [comment]: <> (Removed 已经移除的功能。) [comment]: <> (Fixed 对 bug 的修复) [comment]: <> (Security 对安全的改进)

# 更新日志

> 记录程序的版本变更历程
## [Unreleased]

- 暂无
- 列表搜索代码片段

## [0.0.3] - 2022-04-06

### Added
- 简介增加一些常用图标
- 更换令牌后自动刷新数据

## [0.0.2] - 2022-04-05

### Added
Expand Down Expand Up @@ -38,6 +41,7 @@
- 修改评论
- 删除评论

[unreleased]: https://github.com/wanglong126/vscode-ldggist/compare/v1.0.0...HEAD
[unreleased]: https://github.com/wanglong126/vscode-ldggist/compare/v0.0.3...HEAD
[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
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# LdgGist

> 基于 `Gitee 和 GitHub` 的代码片段管理工具
> 基于 `Gitee``GitHub` 的代码片段管理工具
<p align="center">
<img src="https://raw.githubusercontent.com/wanglong126/vscode-ldggist/main/resources/logo.png" alt="">
</p>

<p align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=itldg.ldgGist&ssr=false#version-history">
<img src="https://vsmarketplacebadge.apphb.com/version-short/itldg.ldgGist.svg?color=blue&style=?style=for-the-badge&logo=visual-studio-code" alt="">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=itldg.ldgGist">
<img src="https://img.shields.io/visual-studio-marketplace/d/itldg.ldgGist.svg?style=flat-square" alt="">
<img src="https://vsmarketplacebadge.apphb.com/installs-short/itldg.ldgGist.svg" alt="">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=itldg.ldgGist&ssr=false#review-details">
<img src="https://vsmarketplacebadge.apphb.com/rating-short/itldg.ldgGist.svg?color=blue" alt="">
</a>
<a href="https://github.com/wanglong126/vscode-ldggist/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/wanglong126/vscode-ldggist.svg?style=flat-square" alt="">
<img src="https://img.shields.io/github/license/wanglong126/vscode-ldggist.svg" alt="">
</a>
</p>


## 快速开始

### 创建代码片段
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"displayName": "LdgGist",
"publisher": "itldg",
"description": "基于Gitee和GitHub的代码片段管理工具",
"version": "0.0.2",
"version": "0.0.3",
"icon": "resources/logo.png",
"engines": {
"vscode": "^1.65.0"
},
"categories": [
"Snippets",
"Other"
],
"activationEvents": [
Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const gist = new GistApi();
var lastToken: string = '';
export function activate(context: vscode.ExtensionContext) {
console.log(`${pluginName} activate`);
registerCommand(context, "login", () => { setToken(); vscode.commands.executeCommand(`${pluginName}.refreshGists`); vscode.commands.executeCommand(`${pluginName}.refreshPublicGists`); });
registerCommand(context, "login", setToken);
registerCommandOneArg(context, "selectedGist", async (id: string) => {
if (gist.currId === id) { return; }
gist.currId = id; gist.getCommits(); gist.getComments();
Expand Down Expand Up @@ -66,6 +66,7 @@ async function setToken(): Promise<boolean> {
if (token) {
await vscode.workspace.getConfiguration(pluginName).update('accessToken', token);
checkType(token);
vscode.commands.executeCommand(`${pluginName}.refreshGists`); vscode.commands.executeCommand(`${pluginName}.refreshPublicGists`);
return true;
}
return false;
Expand Down

0 comments on commit 2658ba9

Please sign in to comment.