Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Jump to definition" in Rust

Tags:

rust

After years of coding in modern IDEs (Visual Studio, Xcode, JetBrain's products) I'm quite used to invaluable Jump to definition feature. It is especially invaluable for system libraries and frameworks when you yet learning the core features of the new language.

Is there any way to achieve the same functionality for the Rust combined with any modern IDE or text editor? Any vim, sublime text plugin?

like image 427
Artem Abramov Avatar asked Jun 20 '14 11:06

Artem Abramov


4 Answers

IDE support for Rust is not there yet. There exists at least the Racer project, that provides a jump-to-definition feature among other things.

Racer is intended to be integrated into any IDE/text editor, and ships with an emacs integration.

like image 128
barjak Avatar answered Oct 04 '22 10:10

barjak


In Vim and emacs you can use ctags to get you a lot of the way there; the language definitions are in src/etc/ctags.rust and you can produce tags for the Rust distribution with make TAGS.vi (or make TAGS.emacs for emacs’ format). See mk/ctags.mk for more information.

For setting them up and using them in Vim, see :help tags.

like image 29
Chris Morgan Avatar answered Oct 01 '22 10:10

Chris Morgan


There is a project called rusty-tags generating ctags for Rust. At the time of this post, it is still actively maintained.

like image 36
Xavier T. Avatar answered Sep 30 '22 10:09

Xavier T.


The RustDT IDE now supports Open Definition functionality, using the Racer tool.

like image 42
BrunoMedeiros Avatar answered Oct 03 '22 10:10

BrunoMedeiros