File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ impl KeywordCounter {
94
94
95
95
// loop through the characters to find the first boundary
96
96
for ( i, c) in kwc. k . as_bytes ( ) . iter ( ) . enumerate ( ) {
97
- // keep iterating until the first separator (not -._"')
98
- if c. is_ascii_alphanumeric ( ) || * c == 45u8 || * c == 46u8 || * c == 95u8 {
97
+ // keep iterating until the first separator (not -._"'@ )
98
+ if c. is_ascii_alphanumeric ( ) || * c == 45u8 || * c == 46u8 || * c == 95u8 || * c == 64u8 {
99
99
continue ;
100
100
}
101
101
Original file line number Diff line number Diff line change @@ -291,6 +291,23 @@ impl Tech {
291
291
tech. refs . remove ( & local_import) ;
292
292
}
293
293
294
+ // some TypeScript refs start with @, e.g. @angular/core
295
+ // it's a valid name, but @ will get in the way of users searching for "angular"
296
+ tech. refs = tech
297
+ . refs
298
+ . into_iter ( )
299
+ . map ( |kwc| {
300
+ if kwc. k . starts_with ( "@" ) {
301
+ KeywordCounter {
302
+ k : kwc. k . trim_start_matches ( "@" ) . to_string ( ) ,
303
+ ..kwc
304
+ }
305
+ } else {
306
+ kwc
307
+ }
308
+ } )
309
+ . collect :: < HashSet < KeywordCounter > > ( ) ;
310
+
294
311
tech
295
312
}
296
313
}
Original file line number Diff line number Diff line change 16
16
],
17
17
"block_comments_end" : [
18
18
" (?i)\\ */\\ s*$"
19
+ ],
20
+ "refs" : [
21
+ " ^[[:blank:]]*import[[:blank:]]+.*[[:blank:]]*['\" ]([@A-Za-z0-9_][@A-Za-z0-9_\\ -\\ .]+).*['\" ][[:blank:]]*;"
19
22
]
20
23
}
You can’t perform that action at this time.
0 commit comments