Skip to content

Commit 3906823

Browse files
committed
auto merge of #11072 : chris-morgan/rust/ctags-tweaks, r=cmr
Anchoring the keyword as the first non-whitespace on a line may mean that the occasional genuine-but-unconventionally-formatted tag is missed, but it avoids a large number of false positives. I changed the type descriptive texts about a bit too. That part's purely cosmetic. I also changed the ignored file list to use a filename matching the make rule, `TAGS.vi` instead of `TAGS.vim`.
2 parents bc17e4f + a1ca745 commit 3906823

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
lexer.ml
5353
TAGS
5454
TAGS.emacs
55-
TAGS.vim
55+
TAGS.vi
5656
version.ml
5757
version.texi
5858
/Makefile

src/etc/ctags.rust

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
--langdef=rust
2-
--langmap=rust:.rs
3-
--regex-rust=/[ \t]*fn[ \t]+([a-zA-Z0-9_]+)/\1/f,function/
4-
--regex-rust=/[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
5-
--regex-rust=/[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
6-
--regex-rust=/[ \t]*struct[ \t]+([a-zA-Z0-9_]+)/\1/m,types/
7-
--regex-rust=/[ \t]*mod[ \t]+([a-zA-Z0-9_]+)/\1/m,modules/
8-
--regex-rust=/[ \t]*static[ \t]+([a-zA-Z0-9_]+)/\1/m,consts/
9-
--regex-rust=/[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\1/m,traits/
10-
--regex-rust=/[ \t]*impl[ \t]+([a-zA-Z0-9_]+)/\1/m,impls/
11-
--regex-rust=/[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/m,macros/
1+
--langdef=Rust
2+
--langmap=Rust:.rs
3+
--regex-Rust=/^[ \t]*(pub[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\2/f,functions,function definitions/
4+
--regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/
5+
--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/
6+
--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/
7+
--regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/
8+
--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/
9+
--regex-Rust=/^[ \t]*(pub[ \t]+)?static[ \t]+([a-zA-Z0-9_]+)/\2/c,consts,static constants/
10+
--regex-Rust=/^[ \t]*(pub[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\2/t,traits,traits/
11+
--regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]+<.*>)?[ \t]+([a-zA-Z0-9_]+)/\3/i,impls,trait implementations/
12+
--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\2/d,macros,macro definitions/

0 commit comments

Comments
 (0)