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

Can't get autocompletion with cargo #1095

Open
trayanr opened this issue Mar 21, 2020 · 0 comments
Open

Can't get autocompletion with cargo #1095

trayanr opened this issue Mar 21, 2020 · 0 comments

Comments

@trayanr
Copy link

trayanr commented Mar 21, 2020

Racer doesn't show lool up definitions in $CARGO_HOME

rustc 1.42.0 
cargo 1.42.0 
racer 2.1.31
RUST_SRC_PATH = /home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
CARGO_HOME = /home/trayan/.cargo

Cargo toml:

[package]
name = "gtk"
version = "0.1.0"
authors = ["trayan"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

[dependencies.gtk]
version = "0.8.0"
features = ["v3_16"]

[dependencies.gio]
version = ""
features = ["v2_44"]

I ran cargo run to generate the .lock file.
Now if I run RUST_BACKTRACE=1 RUST_LOG=racer=trace racer complete std

DEBUG 2020-03-21T11:54:03.945489284Z: racer::util: Getting rust source path. Trying env var RUST_SRC_PATH.
DEBUG 2020-03-21T11:54:03.945551380Z: racer::nameres: do_file_search with search string "std"
DEBUG 2020-03-21T11:54:03.945560597Z: racer::util: Getting rust source path. Trying env var RUST_SRC_PATH.
DEBUG 2020-03-21T11:54:03.945571187Z: racer::nameres: do_file_search std_path: Some("/home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")
DEBUG 2020-03-21T11:54:03.945587388Z: racer::nameres: do_file_search v: ["/home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src", "."]
MATCH std,1,0,/home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/lib.rs,Module,std

But running RUST_BACKTRACE=1 RUST_LOG=racer=trace racer complete gtk results in:

DEBUG 2020-03-21T11:54:57.536131170Z: racer::util: Getting rust source path. Trying env var RUST_SRC_PATH.
DEBUG 2020-03-21T11:54:57.536201101Z: racer::nameres: do_file_search with search string "gtk"
DEBUG 2020-03-21T11:54:57.536211952Z: racer::util: Getting rust source path. Trying env var RUST_SRC_PATH.
DEBUG 2020-03-21T11:54:57.536223513Z: racer::nameres: do_file_search std_path: Some("/home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")
DEBUG 2020-03-21T11:54:57.536245675Z: racer::nameres: do_file_search v: ["/home/trayan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src", "."]

It would seem that racer doesn't look in the cargo directory, so it doesn't find the definitions. Can I manually add it from the command line?

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

1 participant