@@ -1470,7 +1470,8 @@ pub(crate) fn handle_semantic_tokens_full(
14701470
14711471 let mut highlight_config = snap. config . highlighting_config ( ) ;
14721472 // 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 ;
14741475
14751476 let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
14761477 let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
@@ -1493,7 +1494,8 @@ pub(crate) fn handle_semantic_tokens_full_delta(
14931494
14941495 let mut highlight_config = snap. config . highlighting_config ( ) ;
14951496 // 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 ;
14971499
14981500 let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
14991501 let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
@@ -1524,7 +1526,12 @@ pub(crate) fn handle_semantic_tokens_range(
15241526 let text = snap. analysis . file_text ( frange. file_id ) ?;
15251527 let line_index = snap. file_line_index ( frange. file_id ) ?;
15261528
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) ?;
15281535 let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
15291536 Ok ( Some ( semantic_tokens. into ( ) ) )
15301537}
0 commit comments