Skip to content

Commit 59ea6d6

Browse files
committed
Merge branch 'wdv4758h-rust'
Closes #395 Closes #284
2 parents 817d8a6 + c6c8800 commit 59ea6d6

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

autoload/tagbar/types/uctags.vim

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,43 @@ function! tagbar#types#uctags#init(supported_types) abort
528528
\ 'module' : 'm'
529529
\ }
530530
let types.ruby = type_ruby
531+
" Rust {{{1
532+
let type_rust = tagbar#prototypes#typeinfo#new()
533+
let type_rust.ctagstype = 'rust'
534+
let type_rust.kinds = [
535+
\ {'short' : 'n', 'long' : 'module', 'fold' : 1, 'stl' : 0},
536+
\ {'short' : 's', 'long' : 'struct', 'fold' : 0, 'stl' : 1},
537+
\ {'short' : 'i', 'long' : 'trait', 'fold' : 0, 'stl' : 1},
538+
\ {'short' : 'c', 'long' : 'implementation', 'fold' : 0, 'stl' : 0},
539+
\ {'short' : 'f', 'long' : 'function', 'fold' : 0, 'stl' : 1},
540+
\ {'short' : 'g', 'long' : 'enum', 'fold' : 0, 'stl' : 1},
541+
\ {'short' : 't', 'long' : 'type alias', 'fold' : 0, 'stl' : 1},
542+
\ {'short' : 'v', 'long' : 'global variable', 'fold' : 0, 'stl' : 1},
543+
\ {'short' : 'M', 'long' : 'macro', 'fold' : 0, 'stl' : 1},
544+
\ {'short' : 'm', 'long' : 'struct field', 'fold' : 0, 'stl' : 1},
545+
\ {'short' : 'e', 'long' : 'enum variant', 'fold' : 0, 'stl' : 1},
546+
\ {'short' : 'F', 'long' : 'method', 'fold' : 0, 'stl' : 1}
547+
\ ]
548+
let type_rust.sro = '::'
549+
let type_rust.kind2scope = {
550+
\ 'n' : 'module',
551+
\ 's' : 'struct',
552+
\ 'i' : 'interface',
553+
\ 'c' : 'implementation',
554+
\ 'f' : 'function',
555+
\ 'g' : 'enum',
556+
\ 'F' : 'method',
557+
\ }
558+
let type_rust.scope2kind = {
559+
\ 'module' : 'n',
560+
\ 'struct' : 's',
561+
\ 'interface' : 'i',
562+
\ 'implementation': 'c',
563+
\ 'function' : 'f',
564+
\ 'enum' : 'g',
565+
\ 'method' : 'F',
566+
\ }
567+
let types.rust = type_rust
531568
" Scheme {{{1
532569
let type_scheme = tagbar#prototypes#typeinfo#new()
533570
let type_scheme.ctagstype = 'scheme'

0 commit comments

Comments
 (0)