-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support Goto Definition into include!
#3767
Comments
Goto definition do not work in |
Oh, I see. Yes, completions do work. Is there an already opened issue for that? (So I might close this one.) |
@cynecx This is the first issue for that :) |
@edwin0cheng Nevermind, it seems that the option changed from |
Maybe we update the title? I was about to open an issue for |
loadOutDirsFromCheck
+ Go to definition points to wrong pathinclude!
What is missing for this to be supported? |
@mvtec-bergdolll I think it's not so much "anything missing", but rather "we need to redesign one of our core abstractions to support this at all". See #9403. |
This would make life a lot easier when working with tonic in vscode. |
It's a bit hacky and brittle but you can set the output path for the generated Rust files tonic_build::configure()
.out_dir("src/") // put the generated files under src/, could be a nested directory like src/proto, too.
.compile(&["./protobuf.proto"], &["./"]) and include the generated file like a regular module: // lib.rs
mod protobuf; If your CI runs |
If you put that in build.rs you need to be aware that cargo prevents publishing crates if it detects that building them changes their source code. |
Publishing should work by adding a feature gate to the code gen (and running rustfmt), e.g. with code gen turned off by default: (I have no experience with publishing the workaround through cargo, so this is speculation on my end) |
@rustbot claim |
settings.json (vscode):
rust-analyzer:
1c2d4135db867efe335a0654d86429bea7bb9caf
(current master)How to reproduce:
lapin = { version = "0.34" }
to your deps.BasicAckOptions
,BasicConsumeOptions
andBasicRejectOptions
come from proc-macro. "Go to definition" doesn't work on them. It works but redirects you a wrong source-site.The text was updated successfully, but these errors were encountered: