@@ -1504,7 +1504,11 @@ pub(crate) fn handle_semantic_tokens_full(
15041504 let text = snap. analysis . file_text ( file_id) ?;
15051505 let line_index = snap. file_line_index ( file_id) ?;
15061506
1507- let highlights = snap. analysis . highlight ( snap. config . highlighting_config ( ) , file_id) ?;
1507+ let mut highlight_config = snap. config . highlighting_config ( ) ;
1508+ // Avoid flashing a bunch of unresolved references when the proc-macro servers haven't been spawned yet.
1509+ highlight_config. syntactic_name_ref_highlighting = !snap. proc_macros_loaded ;
1510+
1511+ let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
15081512 let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
15091513
15101514 // Unconditionally cache the tokens
@@ -1523,7 +1527,11 @@ pub(crate) fn handle_semantic_tokens_full_delta(
15231527 let text = snap. analysis . file_text ( file_id) ?;
15241528 let line_index = snap. file_line_index ( file_id) ?;
15251529
1526- let highlights = snap. analysis . highlight ( snap. config . highlighting_config ( ) , file_id) ?;
1530+ let mut highlight_config = snap. config . highlighting_config ( ) ;
1531+ // Avoid flashing a bunch of unresolved references when the proc-macro servers haven't been spawned yet.
1532+ highlight_config. syntactic_name_ref_highlighting = !snap. proc_macros_loaded ;
1533+
1534+ let highlights = snap. analysis . highlight ( highlight_config, file_id) ?;
15271535 let semantic_tokens = to_proto:: semantic_tokens ( & text, & line_index, highlights) ;
15281536
15291537 let mut cache = snap. semantic_tokens_cache . lock ( ) ;
0 commit comments