Skip to content

Commit

Permalink
release v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shezhangzhang committed Aug 4, 2022
1 parent b889acd commit 673b8fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "antd-design-token",
"displayName": "antd Design Token",
"description": "VSCode extension for antd v5 design token.",
"version": "0.3.1",
"version": "0.3.3",
"publisher": "shezhangzhang",
"engines": {
"vscode": "^1.68.0"
Expand Down
19 changes: 10 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import setupAntdTokenCompletion from "./typing";
import { checkAntdProject } from "./utils";

export function activate(context: vscode.ExtensionContext) {
const ACTIVE_KEY = "antd-design-token-active-key";
const isActive = context.globalState.get(ACTIVE_KEY);
let isActive = true;
let disposeTyping: vscode.Disposable | undefined;
let disposableAndClear: DisposableAndClear | undefined;
let disposeEditor: vscode.Disposable | undefined;
Expand All @@ -20,19 +19,17 @@ export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand(
"antd-design-token.toggle",
() => {
const isActive = context.globalState.get(ACTIVE_KEY);
context.globalState.update(ACTIVE_KEY, !isActive);
isActive = !isActive;
disposeAll();

if (isActive) {
disposeAll();
setup();
vscode.window.showInformationMessage(
"antd design token is inactive now."
"antd design token is active now."
);
} else {
disposeEditor?.dispose();
setup();
vscode.window.showInformationMessage(
"antd design token is active now."
"antd design token is inactive now."
);
}
}
Expand Down Expand Up @@ -77,6 +74,10 @@ export function activate(context: vscode.ExtensionContext) {
disposableAndClear.clear();
disposableAndClear = undefined;
}

if (disposeEditor) {
disposeEditor.dispose();
}
}

function activeEditorListener(fullToken: any) {
Expand Down

0 comments on commit 673b8fe

Please sign in to comment.