Skip to content

Commit fb62bc3

Browse files
andoriyujyn514
authored andcommitted
Move ctag section to "Suggested Workflow"
1 parent 5b607d9 commit fb62bc3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/building/suggested.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,34 @@ Task] instead:
7171

7272
[Build Task]: https://code.visualstudio.com/docs/editor/tasks
7373

74+
75+
## Configuring `ctags`
76+
77+
One of the challenges with rustc is that the RLS can't handle it, since it's a
78+
bootstrapping compiler. This makes code navigation difficult. One solution is to
79+
use `ctags`.
80+
81+
`ctags` has a long history and several variants. Exuberant Ctags seems to be
82+
quite commonly distributed but it does not have out-of-box Rust support. Some
83+
distributions seem to use [Universal Ctags][utags], which is a maintained fork
84+
and does have built-in Rust support.
85+
86+
The following script can be used to set up Exuberant Ctags:
87+
[https://github.com/nikomatsakis/rust-etags][etags].
88+
89+
`ctags` integrates into emacs and vim quite easily. The following can then be
90+
used to build and generate tags:
91+
92+
```console
93+
$ rust-ctags src/lib* && ./x.py build <something>
94+
```
95+
96+
This allows you to do "jump-to-def" with whatever functions were around when
97+
you last built, which is ridiculously useful.
98+
99+
[etags]: https://github.com/nikomatsakis/rust-etags
100+
[utags]: https://github.com/universal-ctags/ctags
101+
74102
## Check, check, and check again
75103

76104
When doing simple refactorings, it can be useful to run `./x.py check`

0 commit comments

Comments
 (0)