File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " antd-design-token" ,
3
3
"displayName" : " antd Design Token" ,
4
4
"description" : " VSCode extension for antd v5 design token." ,
5
- "version" : " 0.3.3 " ,
5
+ "version" : " 0.3.4 " ,
6
6
"publisher" : " shezhangzhang" ,
7
7
"engines" : {
8
8
"vscode" : " ^1.68.0"
Original file line number Diff line number Diff line change @@ -17,12 +17,16 @@ export default function setupAntdTokenCompletion(
17
17
const items : any [ ] | undefined = [ ] ;
18
18
19
19
for ( let key in fullToken ) {
20
- const value = String ( fullToken [ key as keyof typeof fullToken ] ) ;
20
+ let value = fullToken [ key as keyof typeof fullToken ] ;
21
21
const item = new vscode . CompletionItem ( `antd-${ key } : ${ value } ` , 11 ) ;
22
22
item . insertText = key . includes ( "-" ) ? `['${ key } ']` : key ;
23
23
24
- const sortValue = value . padStart ( 5 , "0" ) ;
25
- item . sortText = `a-${ sortValue } -${ key } ` ;
24
+ if ( typeof value === "number" ) {
25
+ const sortValue = String ( value ) . padStart ( 5 , "0" ) ;
26
+ item . sortText = `a-${ sortValue } -${ key } ` ;
27
+ } else {
28
+ item . sortText = `a-${ key } ` ;
29
+ }
26
30
27
31
const colorSpan = genMarkdownString ( value ) ;
28
32
let documentContent : vscode . MarkdownString | string = "" ;
You can’t perform that action at this time.
0 commit comments