Racer/RustDT can't find definition of type in another source file (same cargo project)


#1

Hi guys,

I am still new to Rust and I recently installed Eclipse Neon 2 (release 4.6.2) and the RustDT plugin (0.8.1.v201612291856). I am also using the racer tool for auto-complete and find-definition (racer version 2.0.5).

While the racer tool can find the definition of symbols located in the same source file as well as in any Rust source file under the Rust source code directory which is set in Rust toolchain properties in Eclipse (such as String, Vec, etc.), it fails to find the definition of a symbol defined in another source file from the same cargo project. In fact, I am building a library and my lib.rs file has a list of includes (i.e. include!("somefile1.rs");include!("somefile2.rs");// etc.) which allows me to write each type in its own source file.

My question is how can I make the racer tool (in Eclipse with RustDT) find the definition of a type which is defined in another source file in the same cargo project – as all my .rs files are listed under the src directory of my cargo project.

I can’t have all my types in the same source file. Does the racer find-definition command currently support looking into multiple source files of the same cargo project (since it is able to look up any definition in any Rust installation source code successfully)?

Thanks


#2

I finally found a solution to my racer issue here, thanks to other members in this forum. I should use pub mod module_name; entries instead of include!("file.rs"); entries in my lib.rs and use the modules where needed.

racer does not support macros obviously.

Thanks again.