Skip to content

Commit 8e59c5d

Browse files
committed
Don't make tags for our dependencies and tests.
Largely, this is just being more specific about where tags get searched for to remove external dependencies like src/llvm, which reduces the number of tags *enormously* and significantly increases the usefulness of the tags file as it is then focusing on 240K lines of Rust code and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly from LLVM) and another 100K lines of Rust tests and a diverse collection of other languages. src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are getting tags made, but I'm not sure if that's desirable or not. At worst, it's not a significant wrong. A future, desirable step is producing tags for just libstd and libextra for the use of people using Rust-the-language rather than working on Rust itself.
1 parent 90754ae commit 8e59c5d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Diff for: mk/ctags.mk

+21-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,27 @@
1515

1616
.PHONY: TAGS.emacs TAGS.vi
1717

18-
CTAGS_OPTS=--options=${CFG_SRC_DIR}/src/etc/ctags.rust -R ${CFG_SRC_DIR}/src
18+
# This is using a blacklist approach, probably more durable than a whitelist.
19+
# We exclude: external dependencies (llvm, libuv, gyp, rt/{msvc,sundown,vg}),
20+
# tests (compiletest, test) and a couple of other things (rt/arch, etc)
21+
CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,,\
22+
$(patsubst ${CFG_SRC_DIR}src/libuv,,\
23+
$(patsubst ${CFG_SRC_DIR}src/compiletest,,\
24+
$(patsubst ${CFG_SRC_DIR}src/test,,\
25+
$(patsubst ${CFG_SRC_DIR}src/gyp,,\
26+
$(patsubst ${CFG_SRC_DIR}src/etc,,\
27+
$(patsubst ${CFG_SRC_DIR}src/rt,,\
28+
$(patsubst ${CFG_SRC_DIR}src/rt/arch,,\
29+
$(patsubst ${CFG_SRC_DIR}src/rt/msvc,,\
30+
$(patsubst ${CFG_SRC_DIR}src/rt/sundown,,\
31+
$(patsubst ${CFG_SRC_DIR}src/rt/vg,,\
32+
$(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*)\
33+
)))))))))))
34+
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
35+
# We could use `--languages=Rust`, but there is value in producing tags for the
36+
# C++ parts of the code base too (at the time of writing, those are .h and .cpp
37+
# files in src/rt, src/rt/sync and src/rustllvm); we mainly just want to
38+
# exclude the external dependencies.
1939

2040
TAGS.emacs:
2141
ctags -e -f $@ ${CTAGS_OPTS}

0 commit comments

Comments
 (0)