From b859b33bbe0df3653e3be7a038752fb6b062783e Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Mon, 4 Jun 2018 20:40:23 -0500 Subject: [PATCH] Add bit about ctags; close #80 --- src/how-to-build-and-run.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/how-to-build-and-run.md b/src/how-to-build-and-run.md index 66c73654..54e60ddc 100644 --- a/src/how-to-build-and-run.md +++ b/src/how-to-build-and-run.md @@ -75,9 +75,9 @@ internally. The result is the compiling `rustc` is done in stages. For hacking, often building the stage 1 compiler is enough, but for final testing and release, the stage 2 compiler is used. -`./x.py check` is really fast to build the rust compiler. -It is, in particular, very useful when you're doing some kind of -"type-based refactoring", like renaming a method, or changing the +`./x.py check` is really fast to build the rust compiler. +It is, in particular, very useful when you're doing some kind of +"type-based refactoring", like renaming a method, or changing the signature of some function. Once you've created a config.toml, you are now ready to run @@ -155,3 +155,21 @@ in other sections: more details): - `./x.py test --stage 1 src/libstd` – runs the `#[test]` tests from libstd - `./x.py test --stage 1 src/test/run-pass` – runs the `run-pass` test suite + +### ctags + +One of the challenges with rustc is that the RLS can't handle it, making code +navigation difficult. One solution is to use `ctags`. The following script can +be used to set it up: [https://github.com/nikomatsakis/rust-etags][etags]. + +CTAGS integrates into emacs and vim quite easily. The following can then be +used to build and generate tags: + +``` +rust-ctags src/lib* && ./x.py build +``` + +This allows you to do "jump-to-def" with whatever functions were around when +you last built, which is ridiculously useful. + +[etags]: https://github.com/nikomatsakis/rust-etags