Skip to content

release v0.3.4 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3",
"version": "0.3.4",
"publisher": "shezhangzhang",
"engines": {
"vscode": "^1.68.0"
Expand Down
10 changes: 7 additions & 3 deletions src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ export default function setupAntdTokenCompletion(
const items: any[] | undefined = [];

for (let key in fullToken) {
const value = String(fullToken[key as keyof typeof fullToken]);
let value = fullToken[key as keyof typeof fullToken];
const item = new vscode.CompletionItem(`antd-${key}: ${value}`, 11);
item.insertText = key.includes("-") ? `['${key}']` : key;

const sortValue = value.padStart(5, "0");
item.sortText = `a-${sortValue}-${key}`;
if (typeof value === "number") {
const sortValue = String(value).padStart(5, "0");
item.sortText = `a-${sortValue}-${key}`;
} else {
item.sortText = `a-${key}`;
}

const colorSpan = genMarkdownString(value);
let documentContent: vscode.MarkdownString | string = "";
Expand Down