Autocompletion does not work when files use include!
See original GitHub issueI’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).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:17 (6 by maintainers)
Top GitHub Comments
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.