Skip to content

Commit 7629c50

Browse files
authored
Small fix for rust-analyzer syntax highlighting of parameters for functions annotated with #[builder] (#275)
This isn't a complete fix. Unfortunately, the parameters are now getting assigned the semantic token type of `variable` instead of `parameter` after this fix, which is only slightly better than `struct` semantic token type that they were assigned before this fix. This problem became worse after #269 which added unconditional two-level macro expansion, after which I noticed this problem, although a little later after that patch was released. Created an issue in rust-analyzer repository to track this problem: rust-lang/rust-analyzer#19556.
1 parent 4fcfdec commit 7629c50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • bon-macros/src/builder/builder_gen

bon-macros/src/builder/builder_gen/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ impl BuilderGenCtx {
6767
// -- Postprocessing --
6868
// Here we parse all items back and add the `allow` attributes to them.
6969
let other_items = quote! {
70-
#state_mod
7170
#builder_decl
72-
#builder_derives
7371
#builder_impl
72+
#builder_derives
73+
#state_mod
7474
};
7575

7676
let other_items_str = other_items.to_string();

0 commit comments

Comments
 (0)