File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed 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