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

Racer doesn't find the source for a function defined in a local crate #101

Open
db48x opened this issue Apr 13, 2018 · 1 comment
Open

Comments

@db48x
Copy link

db48x commented Apr 13, 2018

Perhaps I've configured it incorrectly? I had a very old copy of Racer installed which at some point stopped working, so today I'm finally trying to fix it. It's now mostly working, but here's a scenario that doesn't:

I've got a copy of Remacs checked out, and in rust_src/src/base64.rs there is the line

unsafe { LispObject::from_raw(make_unibyte_string(encoded, encoded_length)) }

I can use M-. to jump all of the identifiers on this line except make_unibyte_string. For LispObject and from_raw, it jumps correctly to their definitions in rust_src/src/lisp.rs. For encoded and encoded_length, it jumps a few lines up to where those local variables are defined. For make_unibyte_string I expected it to jump to rust_src/remacs-sys/lib.rs, which has the definition on line 1434. This is inside of a local crate, listed in the Cargo.toml file like this:

[dependencies]
remacs-lib = { version = "0.1.0", path = "remacs-lib/" }
remacs-macros = { version = "0.1.0", path = "remacs-macros" }
remacs-sys = { version = "0.1.0", path = "remacs-sys/" }
base64 = "0.9"
...

I've also checked that I can jump to items in the standard library, and to items from the base64 crate, but not to either of the local crates. I've also verified that I can jump to definitions inside these local crates if I'm starting from a file that is already in that crate.

racer-debug shows this racer command:

CARGO_HOME=/home/db48x/.cargo RUST_SRC_PATH=/home/db48x/.rustup/toolchains/nightly-2018-02-08-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src /home/db48x/.cargo/bin/racer find-definition 363 42 /home/db48x/projects/remacs/rust_src/src/base64.rs

It also shows that it's executing racer from the rust_src directory, so the Cargo.toml file is right there for it to find.

@j0ni
Copy link

j0ni commented Mar 27, 2019

Hey @db48x did you find a solution for this? I see the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants