Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.1766 breaks intellisense & "go to definition" for generated tonic types #16109

Closed
mikeparisstuff opened this issue Dec 13, 2023 · 1 comment · Fixed by #16348
Closed
Labels
A-macro macro expansion Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@mikeparisstuff
Copy link

mikeparisstuff commented Dec 13, 2023

After updating to v0.3.1766 "go to definition" and intellisense breaks for tonic generated types. Reverting to version v0.3.1756 fixes the issue. I suspect it has something to do with the handling of include! macros as the tonic code-gen creates modules like this:

pub mod protos {
    pub mod accounts {
        pub mod service {
            pub mod v1 {
                include!("protos.accounts.service.v1.rs");
            }
        }
    }
}

The "go to definition" works for

aiproto::protos::aimodels::v1

but not for

aiproto::protos::aimodels::v1::Account which lives behind the include!.

RA does not report any other errors and running cargo build continues to build successfully. Let me know if you need more details.

rust-analyzer version: v0.3.1766

rustc version: rustc 1.74.1 (also tried with rustc 1.70.*)

relevant settings: Its specific to the v0.3.1766 version as rolling back to v0.3.1756 fixes the issue

@mikeparisstuff mikeparisstuff added the C-bug Category: bug label Dec 13, 2023
@awgn
Copy link

awgn commented Dec 14, 2023

I encountered the same issue as well. I also tried the RA pre-release version 0.4.1769, but it has the same problem.

Furthermore, for the sake of convenience, I reverted to version 0.3.1740, and it also works without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants