You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(theme): zero-allocation scope prefix matching in TokenStyleResolver #1530
In TokenStyleResolver._scopePrefixes (lib/core/theme/parser/token_style_resolver.dart), resolving uncached syntax highlighting scopes splits the scope string (scope.split('.')) and generates sublists joined by dot (parts.sublist(0, i).join('.')).
For deeply nested syntax token scopes, this allocates multiple intermediate lists and strings on every uncached token lookup.
Solution
Traverse scope prefixes backwards using scope.lastIndexOf('.') and yield slices via scope.substring(0, dot).
Eliminate all intermediate List<String> and join('.') calls.
Benefits
0 List allocations during scope prefix resolution.
Faster syntax highlight cold start and theme switching.
Activity