[PATCH 0/2] rust: fix rust-analyzer configuration for generated files

Tamir Duberstein posted 2 patches 12 months ago
There is a newer version of this series
scripts/generate_rust_analyzer.py | 41 ++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 20 deletions(-)
[PATCH 0/2] rust: fix rust-analyzer configuration for generated files
Posted by Tamir Duberstein 12 months ago
The individual patches should be descriptive on their own. They are
included in a single series because the second patch uses a function
introduced in the first.

I've confirmed this allows me to navigate to symbols defined in
generated files as well as to the generated files themselves. I am using
an out-of-source build.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
Tamir Duberstein (2):
      scripts: generate_rust_analyzer.py: add missing include_dirs
      scripts: generate_rust_analyzer.py: add uapi crate

 scripts/generate_rust_analyzer.py | 41 ++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 20 deletions(-)
---
base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
change-id: 20250210-rust-analyzer-bindings-include-531e9dacec8d

Best regards,
-- 
Tamir Duberstein <tamird@gmail.com>
Re: [PATCH 0/2] rust: fix rust-analyzer configuration for generated files
Posted by Miguel Ojeda 11 months ago
On Mon, Feb 10, 2025 at 6:56 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> The individual patches should be descriptive on their own. They are
> included in a single series because the second patch uses a function
> introduced in the first.
>
> I've confirmed this allows me to navigate to symbols defined in
> generated files as well as to the generated files themselves. I am using
> an out-of-source build.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>

Applied to `rust-fixes` -- thanks everyone!

      [ Originally we were not using `OBJTREE` in the `kernel` crate, but
        we did pass the variable anyway, so conceptually it could have been
        there since then.

        Regarding `include_dirs`, it started in `kernel` before being in
        mainline because we included the bindings directly there (i.e.
        there was no `bindings` crate). However, when that crate got
        created, we moved the `OBJTREE` there but not the `include_dirs`.
        Nowadays, though, we happen to need the `include_dirs` also in
        the `kernel` crate for `generated_arch_static_branch_asm.rs` which
        was not there back then -- Tamir confirms it is indeed required
        for that reason. - Miguel ]

    [ Slightly reworded title. - Miguel ]

    [ Slightly reworded title. - Miguel ]

Cheers,
Miguel
Re: [PATCH 0/2] rust: fix rust-analyzer configuration for generated files
Posted by Miguel Ojeda 11 months ago
On Wed, Mar 12, 2025 at 12:19 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Applied to `rust-fixes` -- thanks everyone!

Sorry, this was intended to be sent to v2 -- resending there.

Cheers,
Miguel