From 7ffec4539d457a1ccc0d3cd74fa2c295f6ccb77c Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 18 Aug 2017 03:07:39 +0300 Subject: [PATCH] Added php scopes and additional kinds Added scopes, so tagbar will show the following hierarchy: ``` namespace subnamespace ... class property (variable) ... method ... ``` Additional kinds added (basically the same as #283): * namespaces * use aliases (imports) * traits --- autoload/tagbar/types/uctags.vim | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/autoload/tagbar/types/uctags.vim b/autoload/tagbar/types/uctags.vim index ff6913e..0933669 100644 --- a/autoload/tagbar/types/uctags.vim +++ b/autoload/tagbar/types/uctags.vim @@ -426,13 +426,25 @@ function! tagbar#types#uctags#init(supported_types) abort let type_php = tagbar#prototypes#typeinfo#new() let type_php.ctagstype = 'php' let type_php.kinds = [ - \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, - \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 0}, + \ {'short' : 'a', 'long' : 'use aliases', 'fold' : 1, 'stl' : 0}, \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0}, + \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1}, + \ {'short' : 't', 'long' : 'traits', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'c', 'long' : 'classes', 'fold' : 1, 'stl' : 1}, + \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0}, \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, - \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, - \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1} + \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1}, \ ] + let type_php.sro = '\\\\' + let type_php.kind2scope = { + \ 'c' : 'class', + \ 'n' : 'namespace' + \ } + let type_php.scope2kind = { + \ 'class' : 'c', + \ 'namespace' : 'n' + \ } let types.php = type_php " Python {{{1 let type_python = tagbar#prototypes#typeinfo#new()