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 22 "name" : " antd-design-token" ,
33 "displayName" : " antd Design Token" ,
44 "description" : " VSCode extension for antd v5 design token." ,
5- "version" : " 0.3.3 " ,
5+ "version" : " 0.3.4 " ,
66 "publisher" : " shezhangzhang" ,
77 "engines" : {
88 "vscode" : " ^1.68.0"
Original file line number Diff line number Diff line change @@ -17,12 +17,16 @@ export default function setupAntdTokenCompletion(
1717 const items : any [ ] | undefined = [ ] ;
1818
1919 for ( let key in fullToken ) {
20- const value = String ( fullToken [ key as keyof typeof fullToken ] ) ;
20+ let value = fullToken [ key as keyof typeof fullToken ] ;
2121 const item = new vscode . CompletionItem ( `antd-${ key } : ${ value } ` , 11 ) ;
2222 item . insertText = key . includes ( "-" ) ? `['${ key } ']` : key ;
2323
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+ }
2630
2731 const colorSpan = genMarkdownString ( value ) ;
2832 let documentContent : vscode . MarkdownString | string = "" ;
You can’t perform that action at this time.
0 commit comments