intellij-rust: Autocompletion does not work when files use include!
I’m working with a very large code base that uses include!
to break up modules that otherwise would be excessively large. We also use it to make sure our code is well organized, with a file-per-major item pattern (a struct, a pub fn, a pub type, that sort of thing). It make finding things a snap - find, TextMate cmd-T, etc. And it works with intellij-rust too - Cmd-N is wonderful.
What doesn’t work is autocompletion. Autocompletion works perfectly for things in the stdlib. And within a file referencing other items. But not across files. Likewise, find usages does not work, either, and we’re not confident refactor change name will. For us, this is a major reason to use an IDE.
(We realise we’re not doing things “The Rust Way”, but the “Rust Way” for modules doesn’t scale. It’s an anti pattern. It’s more code, and it creates more collisions that need not occur when many developers are at work on a code base. And the the file system does not represent the contents. A million and one mod X / pub use X aren’t appropriate, along with all the duplicated use X statements that creates).
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 17 (6 by maintainers)
Commits related to this issue
- Merge #3935 #3993 3935: MACRO&RES: initial version of include macro support r=vlad20012 a=Undin Add initial support of `include!` macro. It brings all common code insight features (like name resolut... — committed to intellij-rust/intellij-rust by bors[bot] 5 years ago
- Merge #3935 3935: MACRO&RES: initial version of include macro support r=vlad20012 a=Undin Add initial support of `include!` macro. It brings all common code insight features (like name resolution, c... — committed to intellij-rust/intellij-rust by bors[bot] 5 years ago
- Merge #3961 3961: UI: introduce detached notification provider r=vlad20012 a=Undin Extract "File is not included in module tree, ..." notification introduced in #3826 to separate notification provid... — committed to intellij-rust/intellij-rust by bors[bot] 5 years ago
- Merge #3961 3961: UI: introduce detached notification provider r=vlad20012 a=Undin Extract "File is not included in module tree, ..." notification introduced in #3826 to separate notification provid... — committed to intellij-rust/intellij-rust by bors[bot] 5 years ago
Is there any update on this? Since I got the same problem and this issue is open since Nov 2016.
Also I have to agree that the Rust module way just doesn’t really scale. I am working on a project with ~150 structs in one module (and yes, they belong this tightly together…) and it would be a blessing to be able to split them into multiple files while retaining autocomplete.
And including generated bindings which get completed would be really great too.
Now works! Thank you.
More importantly, this allows using generated code like bindgen ffi bindings. Normally I can sacrifice features like macros for the autocomplete productivity gains, but bindgen is so useful I can’t go without it. It’d be awesome if this worked for this use case.