File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export class BuiltinTypesCompletionProvider implements CompletionProvider {
2626 [ "Int" , "257 bits" ] ,
2727 [ "UInt" , "256 bits" ] ,
2828 [ "Bits" , "1023 bits" ] ,
29- [ "bits" , "1023 bits" ] ,
29+ [ "bits" , "X bits" ] ,
3030 [ "uint" , "" ] ,
3131 [ "uint8" , "" ] ,
3232 [ "uint16" , "" ] ,
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ export function provideTlbSemanticTokens(file: TlbFile): SemanticTokens {
2424
2525 RecursiveVisitor . visit ( file . rootNode , ( node ) : boolean => {
2626 switch ( node . type ) {
27- case "##" : {
27+ case "#" :
28+ case "##" :
29+ case "#<" :
30+ case "#<=" :
31+ case "builtin_field" : {
2832 pushToken ( node , SemanticTokenTypes . macro )
2933 break
3034 }
@@ -41,6 +45,11 @@ export function provideTlbSemanticTokens(file: TlbFile): SemanticTokens {
4145 break
4246 }
4347 case "type_identifier" : {
48+ if ( isBuiltinType ( node . text ) ) {
49+ pushToken ( node , SemanticTokenTypes . macro )
50+ break
51+ }
52+
4453 const parent = node . parent
4554 if ( ! parent ) break
4655
@@ -91,13 +100,22 @@ export function provideTlbSemanticTokens(file: TlbFile): SemanticTokens {
91100 case "combinator" : {
92101 break
93102 }
94- case "builtin_field" : {
95- pushToken ( node , SemanticTokenTypes . property )
96- break
97- }
98103 }
99104 return true
100105 } )
101106
102107 return builder . build ( )
103108}
109+
110+ function isBuiltinType ( name : string ) : boolean {
111+ return (
112+ name === "Any" ||
113+ name === "Cell" ||
114+ name === "Int" ||
115+ name === "UInt" ||
116+ name === "Bits" ||
117+ name . startsWith ( "bits" ) ||
118+ name . startsWith ( "uint" ) ||
119+ name . startsWith ( "int" )
120+ )
121+ }
You can’t perform that action at this time.
0 commit comments