racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 279 forks source link

Autocompletion of External Crate Fields and Members #1045

Open SpencerMacKinnon opened 5 years ago

SpencerMacKinnon commented 5 years ago

I have racer mainly working now but I can't get it to complete fields within a struct or methods for that struct. When I try and complete structs from a crate ("cgmath::" then autocomplete) that seems to work. When I try and autocomplete a field or method ("v2.") that doesn't seem to return anything. Are fields and methods supported? Thanks for helping look into this!

Windows 10.0.17134
rustc --version: rustc 1.35.0 (3c235d560 2019-05-20)
cargo --version: cargo 1.35.0 (6f3e9c367 2019-04-04)
racer --version: racer 2.1.22
rustup --version: rustup 1.18.3 (435397f48 2019-05-22)
echo %CARGO_HOME%: C:\Users\spenc\.cargo
echo %RUST_SRC_PATH%: C:\Users\spenc\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

main.rs

extern crate cgmath;

use cgmath::

fn main() {
    let v2 = Vector2::new(1.0, 2.0);
    v2.
    println!("{:#?}", v2.yy());
}

cargo.toml

[package]
name = "luxr"
version = "0.1.0"
authors = ["Spencer MacKinnon <spencer@spencermackinnon.com>"]
edition = "2018"

[dependencies]

[dependencies.cgmath]
version = "0.17.0"
features = ["swizzle"]
augustocdias commented 5 years ago

I'm having a related issue with opencv bindings library. I have autocomplete for the prelude and error modules but not the ones exported from the hub module as it is in their code here: https://github.com/twistedfall/opencv-rust/blob/5dbbc565d3cc88c093f816bc225797261395fa29/src/lib.rs#L8