@@ -1470,7 +1470,8 @@ pub(crate) fn handle_semantic_tokens_full(
1470
1470
1471
1471
let mut highlight_config = snap. config . highlighting_config ( ) ;
1472
1472
// Avoid flashing a bunch of unresolved references when the proc-macro servers haven't been spawned yet.
1473
- highlight_config. syntactic_name_ref_highlighting = !snap. proc_macros_loaded ;
1473
+ highlight_config. syntactic_name_ref_highlighting =
1474
+ snap. workspaces . is_empty ( ) || !snap. proc_macros_loaded ;
1474
1475
1475
1476
let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
1476
1477
let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
@@ -1493,7 +1494,8 @@ pub(crate) fn handle_semantic_tokens_full_delta(
1493
1494
1494
1495
let mut highlight_config = snap. config . highlighting_config ( ) ;
1495
1496
// Avoid flashing a bunch of unresolved references when the proc-macro servers haven't been spawned yet.
1496
- highlight_config. syntactic_name_ref_highlighting = !snap. proc_macros_loaded ;
1497
+ highlight_config. syntactic_name_ref_highlighting =
1498
+ snap. workspaces . is_empty ( ) || !snap. proc_macros_loaded ;
1497
1499
1498
1500
let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
1499
1501
let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
@@ -1524,7 +1526,12 @@ pub(crate) fn handle_semantic_tokens_range(
1524
1526
let text = snap. analysis . file_text ( frange. file_id ) ?;
1525
1527
let line_index = snap. file_line_index ( frange. file_id ) ?;
1526
1528
1527
- let highlights = snap. analysis . highlight_range ( snap. config . highlighting_config ( ) , frange) ?;
1529
+ let mut highlight_config = snap. config . highlighting_config ( ) ;
1530
+ // Avoid flashing a bunch of unresolved references when the proc-macro servers haven't been spawned yet.
1531
+ highlight_config. syntactic_name_ref_highlighting =
1532
+ snap. workspaces . is_empty ( ) || !snap. proc_macros_loaded ;
1533
+
1534
+ let highlights = snap. analysis . highlight_range ( highlight_config, frange) ?;
1528
1535
let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
1529
1536
Ok ( Some ( semantic_tokens. into ( ) ) )
1530
1537
}
0 commit comments