-
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
goto-definition for include*!(expr)
, where expr
is not a string literal
#15836
Comments
Ah yes thanks for showing this. I realised this is something I could do soon after I posted this issue too, but I don't think it fully solves the issue. I believe this to be a workaround rather than actual support. It is reliant on the goto-definition on the included file content, rather than that on the I probably didn't explain myself with the best clarity. Please don't hesitate to ask for clarifications. |
Do you want Go-to-definition on the Because you initially wrote about diagnostics, so that's clearly |
Yes that would be ideal.
I think currently
I was thinking more about both. Because I saw in #9149 that the goto-definition impl for literals is shared across all Also I took a look at #9149. It seems like this is the only bit of code that needs changing: rust-analyzer/crates/ide/src/goto_definition.rs Lines 99 to 100 in 3b7c7f9
I can take a shot at this over the weekend. |
Well, not for me.. It works on |
Huh, curious. Maybe (I'm guessing here) it's because the current path resolution is too naive? |
This is because of how our VFS handles source roots probably |
Hi folks, how can I help drive this forward? I am currently seeing this in linux where my source directory is "rust-analyzer.linkedProjects": [
".kunit/rust-project.json",
], The errors are anchored on
however those files clearly exist:
|
Related: #3767, #5871,#9149.
At the moment, rust-analyzer already supports goto-definition when including a file with a string literal. However the following case is not addressed:
Not having support for this case is especially inconvenient because
OUT_DIR
may change for each build, and finding the correct file intarget/$PROFILE/build/$CRATE_NAME-$HASH/out
is not the easiest thing in the world.Right now I deliberately keep an unused item in the generated file, so that rust-analyzer marks it as containing a warning, allowing me to find it quickly in the file tree. Obviously this is a terrible hack and won't work for non Rust source files.
The text was updated successfully, but these errors were encountered: