/Plugins/TagBar/Plugin/autoload/tagbar/types/ctags.vim

https://bitbucket.org/WscriChy/vim-configuration · Vim Script · 752 lines · 685 code · 6 blank · 61 comment · 6 complexity · bd9903f7b8416781ad46ec4049619483 MD5 · raw file

  1. " Type definitions for standard Exuberant Ctags
  2. function! tagbar#types#ctags#init(supported_types) abort
  3. let types = {}
  4. " Ant {{{1
  5. let type_ant = tagbar#prototypes#typeinfo#new()
  6. let type_ant.ctagstype = 'ant'
  7. let type_ant.kinds = [
  8. \ {'short' : 'p', 'long' : 'projects', 'fold' : 0, 'stl' : 1},
  9. \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1}
  10. \ ]
  11. let types.ant = type_ant
  12. " Asm {{{1
  13. let type_asm = tagbar#prototypes#typeinfo#new()
  14. let type_asm.ctagstype = 'asm'
  15. let type_asm.kinds = [
  16. \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1},
  17. \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
  18. \ {'short' : 'd', 'long' : 'defines', 'fold' : 0, 'stl' : 1},
  19. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
  20. \ ]
  21. let types.asm = type_asm
  22. " ASP {{{1
  23. let type_aspvbs = tagbar#prototypes#typeinfo#new()
  24. let type_aspvbs.ctagstype = 'asp'
  25. let type_aspvbs.kinds = [
  26. \ {'short' : 'd', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
  27. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  28. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  29. \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
  30. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
  31. \ ]
  32. let types.aspvbs = type_aspvbs
  33. " Asymptote {{{1
  34. " Asymptote gets parsed well using filetype = c
  35. let type_asy = tagbar#prototypes#typeinfo#new()
  36. let type_asy.ctagstype = 'c'
  37. let type_asy.kinds = [
  38. \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
  39. \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
  40. \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
  41. \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
  42. \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
  43. \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
  44. \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
  45. \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
  46. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
  47. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  48. \ ]
  49. let type_asy.sro = '::'
  50. let type_asy.kind2scope = {
  51. \ 'g' : 'enum',
  52. \ 's' : 'struct',
  53. \ 'u' : 'union'
  54. \ }
  55. let type_asy.scope2kind = {
  56. \ 'enum' : 'g',
  57. \ 'struct' : 's',
  58. \ 'union' : 'u'
  59. \ }
  60. let types.asy = type_asy
  61. " Awk {{{1
  62. let type_awk = tagbar#prototypes#typeinfo#new()
  63. let type_awk.ctagstype = 'awk'
  64. let type_awk.kinds = [
  65. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  66. \ ]
  67. let types.awk = type_awk
  68. " Basic {{{1
  69. let type_basic = tagbar#prototypes#typeinfo#new()
  70. let type_basic.ctagstype = 'basic'
  71. let type_basic.kinds = [
  72. \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
  73. \ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1},
  74. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  75. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
  76. \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
  77. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
  78. \ ]
  79. let types.basic = type_basic
  80. " BETA {{{1
  81. let type_beta = tagbar#prototypes#typeinfo#new()
  82. let type_beta.ctagstype = 'beta'
  83. let type_beta.kinds = [
  84. \ {'short' : 'f', 'long' : 'fragments', 'fold' : 0, 'stl' : 1},
  85. \ {'short' : 's', 'long' : 'slots', 'fold' : 0, 'stl' : 1},
  86. \ {'short' : 'v', 'long' : 'patterns', 'fold' : 0, 'stl' : 1}
  87. \ ]
  88. let types.beta = type_beta
  89. " C {{{1
  90. let type_c = tagbar#prototypes#typeinfo#new()
  91. let type_c.ctagstype = 'c'
  92. let type_c.kinds = [
  93. \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
  94. \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
  95. \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
  96. \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
  97. \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
  98. \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
  99. \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
  100. \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
  101. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
  102. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  103. \ ]
  104. let type_c.sro = '::'
  105. let type_c.kind2scope = {
  106. \ 'g' : 'enum',
  107. \ 's' : 'struct',
  108. \ 'u' : 'union'
  109. \ }
  110. let type_c.scope2kind = {
  111. \ 'enum' : 'g',
  112. \ 'struct' : 's',
  113. \ 'union' : 'u'
  114. \ }
  115. let types.c = type_c
  116. " C++ {{{1
  117. let type_cpp = tagbar#prototypes#typeinfo#new()
  118. let type_cpp.ctagstype = 'c++'
  119. let type_cpp.kinds = [
  120. \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
  121. \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
  122. \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
  123. \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
  124. \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
  125. \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
  126. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  127. \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
  128. \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
  129. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  130. \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
  131. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
  132. \ ]
  133. let type_cpp.sro = '::'
  134. let type_cpp.kind2scope = {
  135. \ 'g' : 'enum',
  136. \ 'n' : 'namespace',
  137. \ 'c' : 'class',
  138. \ 's' : 'struct',
  139. \ 'u' : 'union'
  140. \ }
  141. let type_cpp.scope2kind = {
  142. \ 'enum' : 'g',
  143. \ 'namespace' : 'n',
  144. \ 'class' : 'c',
  145. \ 'struct' : 's',
  146. \ 'union' : 'u'
  147. \ }
  148. let types.cpp = type_cpp
  149. let types.cuda = type_cpp
  150. " C# {{{1
  151. let type_cs = tagbar#prototypes#typeinfo#new()
  152. let type_cs.ctagstype = 'c#'
  153. let type_cs.kinds = [
  154. \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
  155. \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 1},
  156. \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
  157. \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
  158. \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 1},
  159. \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
  160. \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
  161. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  162. \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
  163. \ {'short' : 'E', 'long' : 'events', 'fold' : 0, 'stl' : 1},
  164. \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
  165. \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}
  166. \ ]
  167. let type_cs.sro = '.'
  168. let type_cs.kind2scope = {
  169. \ 'n' : 'namespace',
  170. \ 'i' : 'interface',
  171. \ 'c' : 'class',
  172. \ 's' : 'struct',
  173. \ 'g' : 'enum'
  174. \ }
  175. let type_cs.scope2kind = {
  176. \ 'namespace' : 'n',
  177. \ 'interface' : 'i',
  178. \ 'class' : 'c',
  179. \ 'struct' : 's',
  180. \ 'enum' : 'g'
  181. \ }
  182. let types.cs = type_cs
  183. " COBOL {{{1
  184. let type_cobol = tagbar#prototypes#typeinfo#new()
  185. let type_cobol.ctagstype = 'cobol'
  186. let type_cobol.kinds = [
  187. \ {'short' : 'd', 'long' : 'data items', 'fold' : 0, 'stl' : 1},
  188. \ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0, 'stl' : 1},
  189. \ {'short' : 'g', 'long' : 'group items', 'fold' : 0, 'stl' : 1},
  190. \ {'short' : 'p', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 1},
  191. \ {'short' : 'P', 'long' : 'program ids', 'fold' : 0, 'stl' : 1},
  192. \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}
  193. \ ]
  194. let types.cobol = type_cobol
  195. " DOS Batch {{{1
  196. let type_dosbatch = tagbar#prototypes#typeinfo#new()
  197. let type_dosbatch.ctagstype = 'dosbatch'
  198. let type_dosbatch.kinds = [
  199. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
  200. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
  201. \ ]
  202. let types.dosbatch = type_dosbatch
  203. " Eiffel {{{1
  204. let type_eiffel = tagbar#prototypes#typeinfo#new()
  205. let type_eiffel.ctagstype = 'eiffel'
  206. let type_eiffel.kinds = [
  207. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  208. \ {'short' : 'f', 'long' : 'features', 'fold' : 0, 'stl' : 1}
  209. \ ]
  210. let type_eiffel.sro = '.' " Not sure, is nesting even possible?
  211. let type_eiffel.kind2scope = {
  212. \ 'c' : 'class',
  213. \ 'f' : 'feature'
  214. \ }
  215. let type_eiffel.scope2kind = {
  216. \ 'class' : 'c',
  217. \ 'feature' : 'f'
  218. \ }
  219. let types.eiffel = type_eiffel
  220. " Erlang {{{1
  221. let type_erlang = tagbar#prototypes#typeinfo#new()
  222. let type_erlang.ctagstype = 'erlang'
  223. let type_erlang.kinds = [
  224. \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
  225. \ {'short' : 'd', 'long' : 'macro definitions', 'fold' : 0, 'stl' : 1},
  226. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  227. \ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0, 'stl' : 1}
  228. \ ]
  229. let type_erlang.sro = '.' " Not sure, is nesting even possible?
  230. let type_erlang.kind2scope = {
  231. \ 'm' : 'module'
  232. \ }
  233. let type_erlang.scope2kind = {
  234. \ 'module' : 'm'
  235. \ }
  236. let types.erlang = type_erlang
  237. " Flex {{{1
  238. " Vim doesn't support Flex out of the box, this is based on rough
  239. " guesses and probably requires
  240. " http://www.vim.org/scripts/script.php?script_id=2909
  241. " Improvements welcome!
  242. let type_as = tagbar#prototypes#typeinfo#new()
  243. let type_as.ctagstype = 'flex'
  244. let type_as.kinds = [
  245. \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
  246. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  247. \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
  248. \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1},
  249. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  250. \ {'short' : 'x', 'long' : 'mxtags', 'fold' : 0, 'stl' : 0}
  251. \ ]
  252. let type_as.sro = '.'
  253. let type_as.kind2scope = {
  254. \ 'c' : 'class'
  255. \ }
  256. let type_as.scope2kind = {
  257. \ 'class' : 'c'
  258. \ }
  259. let types.mxml = type_as
  260. let types.actionscript = type_as
  261. " Fortran {{{1
  262. let type_fortran = tagbar#prototypes#typeinfo#new()
  263. let type_fortran.ctagstype = 'fortran'
  264. let type_fortran.kinds = [
  265. \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
  266. \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1},
  267. \ {'short' : 'k', 'long' : 'components', 'fold' : 0, 'stl' : 1},
  268. \ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0,
  269. \ 'stl' : 1},
  270. \ {'short' : 'c', 'long' : 'common blocks', 'fold' : 0, 'stl' : 1},
  271. \ {'short' : 'b', 'long' : 'block data', 'fold' : 0, 'stl' : 0},
  272. \ {'short' : 'e', 'long' : 'entry points', 'fold' : 0, 'stl' : 1},
  273. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  274. \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
  275. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
  276. \ {'short' : 'n', 'long' : 'namelists', 'fold' : 0, 'stl' : 1},
  277. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
  278. \ ]
  279. let type_fortran.sro = '.' " Not sure, is nesting even possible?
  280. let type_fortran.kind2scope = {
  281. \ 'm' : 'module',
  282. \ 'p' : 'program',
  283. \ 'f' : 'function',
  284. \ 's' : 'subroutine'
  285. \ }
  286. let type_fortran.scope2kind = {
  287. \ 'module' : 'm',
  288. \ 'program' : 'p',
  289. \ 'function' : 'f',
  290. \ 'subroutine' : 's'
  291. \ }
  292. let types.fortran = type_fortran
  293. " HTML {{{1
  294. let type_html = tagbar#prototypes#typeinfo#new()
  295. let type_html.ctagstype = 'html'
  296. let type_html.kinds = [
  297. \ {'short' : 'f', 'long' : 'JavaScript functions', 'fold' : 0, 'stl' : 1},
  298. \ {'short' : 'a', 'long' : 'named anchors', 'fold' : 0, 'stl' : 1}
  299. \ ]
  300. let types.html = type_html
  301. " Java {{{1
  302. let type_java = tagbar#prototypes#typeinfo#new()
  303. let type_java.ctagstype = 'java'
  304. let type_java.kinds = [
  305. \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
  306. \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0},
  307. \ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 1},
  308. \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0},
  309. \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
  310. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  311. \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}
  312. \ ]
  313. let type_java.sro = '.'
  314. let type_java.kind2scope = {
  315. \ 'g' : 'enum',
  316. \ 'i' : 'interface',
  317. \ 'c' : 'class'
  318. \ }
  319. let type_java.scope2kind = {
  320. \ 'enum' : 'g',
  321. \ 'interface' : 'i',
  322. \ 'class' : 'c'
  323. \ }
  324. let types.java = type_java
  325. " JavaScript {{{1
  326. let type_javascript = tagbar#prototypes#typeinfo#new()
  327. let type_javascript.ctagstype = 'javascript'
  328. let type_javascript.kinds = [
  329. \ {'short': 'v', 'long': 'global variables', 'fold': 0, 'stl': 0},
  330. \ {'short': 'c', 'long': 'classes', 'fold': 0, 'stl': 1},
  331. \ {'short': 'p', 'long': 'properties', 'fold': 0, 'stl': 0},
  332. \ {'short': 'm', 'long': 'methods', 'fold': 0, 'stl': 1},
  333. \ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1},
  334. \ ]
  335. let type_javascript.sro = '.'
  336. let type_javascript.kind2scope = {
  337. \ 'c' : 'class',
  338. \ 'f' : 'function',
  339. \ 'm' : 'method',
  340. \ 'p' : 'property',
  341. \ }
  342. let type_javascript.scope2kind = {
  343. \ 'class' : 'c',
  344. \ 'function' : 'f',
  345. \ }
  346. let types.javascript = type_javascript
  347. " Lisp {{{1
  348. let type_lisp = tagbar#prototypes#typeinfo#new()
  349. let type_lisp.ctagstype = 'lisp'
  350. let type_lisp.kinds = [
  351. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  352. \ ]
  353. let types.lisp = type_lisp
  354. let types.clojure = type_lisp
  355. " Lua {{{1
  356. let type_lua = tagbar#prototypes#typeinfo#new()
  357. let type_lua.ctagstype = 'lua'
  358. let type_lua.kinds = [
  359. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  360. \ ]
  361. let types.lua = type_lua
  362. " Make {{{1
  363. let type_make = tagbar#prototypes#typeinfo#new()
  364. let type_make.ctagstype = 'make'
  365. let type_make.kinds = [
  366. \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}
  367. \ ]
  368. let types.make = type_make
  369. " Matlab {{{1
  370. let type_matlab = tagbar#prototypes#typeinfo#new()
  371. let type_matlab.ctagstype = 'matlab'
  372. let type_matlab.kinds = [
  373. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  374. \ ]
  375. let types.matlab = type_matlab
  376. " ObjectiveC {{{1
  377. let type_objc = tagbar#prototypes#typeinfo#new()
  378. let type_objc.ctagstype = 'objectivec'
  379. let type_objc.kinds = [
  380. \ {'short' : 'M', 'long' : 'preprocessor macros', 'fold' : 1, 'stl' : 0},
  381. \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
  382. \ {'short' : 'i', 'long' : 'class interfaces', 'fold' : 0, 'stl' : 1},
  383. \ {'short' : 'I', 'long' : 'class implementations', 'fold' : 0, 'stl' : 1},
  384. \ {'short' : 'c', 'long' : 'class methods', 'fold' : 0, 'stl' : 1},
  385. \ {'short' : 'F', 'long' : 'object fields', 'fold' : 0, 'stl' : 0},
  386. \ {'short' : 'm', 'long' : 'object methods', 'fold' : 0, 'stl' : 1},
  387. \ {'short' : 's', 'long' : 'type structures', 'fold' : 0, 'stl' : 1},
  388. \ {'short' : 't', 'long' : 'type aliases', 'fold' : 0, 'stl' : 1},
  389. \ {'short' : 'e', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1},
  390. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  391. \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 0},
  392. \ ]
  393. let type_objc.sro = ':'
  394. let type_objc.kind2scope = {
  395. \ 'i' : 'interface',
  396. \ 'I' : 'implementation',
  397. \ 's' : 'struct',
  398. \ }
  399. let type_objc.scope2kind = {
  400. \ 'interface' : 'i',
  401. \ 'implementation' : 'I',
  402. \ 'struct' : 's',
  403. \ }
  404. let types.objc = type_objc
  405. let types.objcpp = type_objc
  406. " Ocaml {{{1
  407. let type_ocaml = tagbar#prototypes#typeinfo#new()
  408. let type_ocaml.ctagstype = 'ocaml'
  409. let type_ocaml.kinds = [
  410. \ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0, 'stl' : 1},
  411. \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
  412. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  413. \ {'short' : 'C', 'long' : 'constructors', 'fold' : 0, 'stl' : 1},
  414. \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
  415. \ {'short' : 'e', 'long' : 'exceptions', 'fold' : 0, 'stl' : 1},
  416. \ {'short' : 't', 'long' : 'type names', 'fold' : 0, 'stl' : 1},
  417. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  418. \ {'short' : 'r', 'long' : 'structure fields', 'fold' : 0, 'stl' : 0}
  419. \ ]
  420. let type_ocaml.sro = '.' " Not sure, is nesting even possible?
  421. let type_ocaml.kind2scope = {
  422. \ 'M' : 'Module',
  423. \ 'c' : 'class',
  424. \ 't' : 'type'
  425. \ }
  426. let type_ocaml.scope2kind = {
  427. \ 'Module' : 'M',
  428. \ 'class' : 'c',
  429. \ 'type' : 't'
  430. \ }
  431. let types.ocaml = type_ocaml
  432. " Pascal {{{1
  433. let type_pascal = tagbar#prototypes#typeinfo#new()
  434. let type_pascal.ctagstype = 'pascal'
  435. let type_pascal.kinds = [
  436. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  437. \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
  438. \ ]
  439. let types.pascal = type_pascal
  440. " Perl {{{1
  441. let type_perl = tagbar#prototypes#typeinfo#new()
  442. let type_perl.ctagstype = 'perl'
  443. let type_perl.kinds = [
  444. \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
  445. \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
  446. \ {'short' : 'f', 'long' : 'formats', 'fold' : 0, 'stl' : 0},
  447. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
  448. \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
  449. \ ]
  450. let types.perl = type_perl
  451. " PHP {{{1
  452. let type_php = tagbar#prototypes#typeinfo#new()
  453. let type_php.ctagstype = 'php'
  454. let type_php.kinds = [
  455. \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
  456. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  457. \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0},
  458. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  459. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
  460. \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1}
  461. \ ]
  462. let types.php = type_php
  463. " Python {{{1
  464. let type_python = tagbar#prototypes#typeinfo#new()
  465. let type_python.ctagstype = 'python'
  466. let type_python.kinds = [
  467. \ {'short' : 'i', 'long' : 'imports', 'fold' : 1, 'stl' : 0},
  468. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  469. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  470. \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
  471. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
  472. \ ]
  473. let type_python.sro = '.'
  474. let type_python.kind2scope = {
  475. \ 'c' : 'class',
  476. \ 'f' : 'function',
  477. \ 'm' : 'function'
  478. \ }
  479. let type_python.scope2kind = {
  480. \ 'class' : 'c',
  481. \ 'function' : 'f'
  482. \ }
  483. let types.python = type_python
  484. let types.pyrex = type_python
  485. let types.cython = type_python
  486. " REXX {{{1
  487. let type_rexx = tagbar#prototypes#typeinfo#new()
  488. let type_rexx.ctagstype = 'rexx'
  489. let type_rexx.kinds = [
  490. \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
  491. \ ]
  492. let types.rexx = type_rexx
  493. " Ruby {{{1
  494. let type_ruby = tagbar#prototypes#typeinfo#new()
  495. let type_ruby.ctagstype = 'ruby'
  496. let type_ruby.kinds = [
  497. \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
  498. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  499. \ {'short' : 'f', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
  500. \ {'short' : 'F', 'long' : 'singleton methods', 'fold' : 0, 'stl' : 1}
  501. \ ]
  502. let type_ruby.sro = '.'
  503. let type_ruby.kind2scope = {
  504. \ 'c' : 'class',
  505. \ 'm' : 'class',
  506. \ 'f' : 'class'
  507. \ }
  508. let type_ruby.scope2kind = {
  509. \ 'class' : 'c'
  510. \ }
  511. let types.ruby = type_ruby
  512. " Scheme {{{1
  513. let type_scheme = tagbar#prototypes#typeinfo#new()
  514. let type_scheme.ctagstype = 'scheme'
  515. let type_scheme.kinds = [
  516. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  517. \ {'short' : 's', 'long' : 'sets', 'fold' : 0, 'stl' : 1}
  518. \ ]
  519. let types.scheme = type_scheme
  520. let types.racket = type_scheme
  521. " Shell script {{{1
  522. let type_sh = tagbar#prototypes#typeinfo#new()
  523. let type_sh.ctagstype = 'sh'
  524. let type_sh.kinds = [
  525. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  526. \ ]
  527. let types.sh = type_sh
  528. let types.csh = type_sh
  529. let types.zsh = type_sh
  530. " SLang {{{1
  531. let type_slang = tagbar#prototypes#typeinfo#new()
  532. let type_slang.ctagstype = 'slang'
  533. let type_slang.kinds = [
  534. \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
  535. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
  536. \ ]
  537. let types.slang = type_slang
  538. " SML {{{1
  539. let type_sml = tagbar#prototypes#typeinfo#new()
  540. let type_sml.ctagstype = 'sml'
  541. let type_sml.kinds = [
  542. \ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0, 'stl' : 0},
  543. \ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1},
  544. \ {'short' : 'c', 'long' : 'functor definitions', 'fold' : 0, 'stl' : 1},
  545. \ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0, 'stl' : 0},
  546. \ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0, 'stl' : 0},
  547. \ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1},
  548. \ {'short' : 'v', 'long' : 'value bindings', 'fold' : 0, 'stl' : 0}
  549. \ ]
  550. let types.sml = type_sml
  551. " SQL {{{1
  552. " The SQL ctags parser seems to be buggy for me, so this just uses the
  553. " normal kinds even though scopes should be available. Improvements
  554. " welcome!
  555. let type_sql = tagbar#prototypes#typeinfo#new()
  556. let type_sql.ctagstype = 'sql'
  557. let type_sql.kinds = [
  558. \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 1},
  559. \ {'short' : 'd', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1},
  560. \ {'short' : 'c', 'long' : 'cursors', 'fold' : 0, 'stl' : 1},
  561. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  562. \ {'short' : 'F', 'long' : 'record fields', 'fold' : 0, 'stl' : 1},
  563. \ {'short' : 'L', 'long' : 'block label', 'fold' : 0, 'stl' : 1},
  564. \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1},
  565. \ {'short' : 's', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
  566. \ {'short' : 't', 'long' : 'tables', 'fold' : 0, 'stl' : 1},
  567. \ {'short' : 'T', 'long' : 'triggers', 'fold' : 0, 'stl' : 1},
  568. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1},
  569. \ {'short' : 'i', 'long' : 'indexes', 'fold' : 0, 'stl' : 1},
  570. \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
  571. \ {'short' : 'U', 'long' : 'publications', 'fold' : 0, 'stl' : 1},
  572. \ {'short' : 'R', 'long' : 'services', 'fold' : 0, 'stl' : 1},
  573. \ {'short' : 'D', 'long' : 'domains', 'fold' : 0, 'stl' : 1},
  574. \ {'short' : 'V', 'long' : 'views', 'fold' : 0, 'stl' : 1},
  575. \ {'short' : 'n', 'long' : 'synonyms', 'fold' : 0, 'stl' : 1},
  576. \ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0, 'stl' : 1},
  577. \ {'short' : 'y', 'long' : 'MobiLink Conn Scripts', 'fold' : 0, 'stl' : 1},
  578. \ {'short' : 'z', 'long' : 'MobiLink Properties', 'fold' : 0, 'stl' : 1}
  579. \ ]
  580. let types.sql = type_sql
  581. " Tcl {{{1
  582. let type_tcl = tagbar#prototypes#typeinfo#new()
  583. let type_tcl.ctagstype = 'tcl'
  584. let type_tcl.kinds = [
  585. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  586. \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
  587. \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
  588. \ ]
  589. let types.tcl = type_tcl
  590. " LaTeX {{{1
  591. let type_tex = tagbar#prototypes#typeinfo#new()
  592. let type_tex.ctagstype = 'tex'
  593. let type_tex.kinds = [
  594. \ {'short' : 'i', 'long' : 'includes', 'fold' : 1, 'stl' : 0},
  595. \ {'short' : 'p', 'long' : 'parts', 'fold' : 0, 'stl' : 1},
  596. \ {'short' : 'c', 'long' : 'chapters', 'fold' : 0, 'stl' : 1},
  597. \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1},
  598. \ {'short' : 'u', 'long' : 'subsections', 'fold' : 0, 'stl' : 1},
  599. \ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0, 'stl' : 1},
  600. \ {'short' : 'P', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 0},
  601. \ {'short' : 'G', 'long' : 'subparagraphs', 'fold' : 0, 'stl' : 0},
  602. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 0}
  603. \ ]
  604. let type_tex.sro = '""'
  605. let type_tex.kind2scope = {
  606. \ 'p' : 'part',
  607. \ 'c' : 'chapter',
  608. \ 's' : 'section',
  609. \ 'u' : 'subsection',
  610. \ 'b' : 'subsubsection'
  611. \ }
  612. let type_tex.scope2kind = {
  613. \ 'part' : 'p',
  614. \ 'chapter' : 'c',
  615. \ 'section' : 's',
  616. \ 'subsection' : 'u',
  617. \ 'subsubsection' : 'b'
  618. \ }
  619. let type_tex.sort = 0
  620. let types.tex = type_tex
  621. " Vala {{{1
  622. " Vala is supported by the ctags fork provided by Anjuta, so only add the
  623. " type if the fork is used to prevent error messages otherwise
  624. if has_key(a:supported_types, 'vala') || executable('anjuta-tags')
  625. let type_vala = tagbar#prototypes#typeinfo#new()
  626. let type_vala.ctagstype = 'vala'
  627. let type_vala.kinds = [
  628. \ {'short' : 'e', 'long' : 'Enumerations', 'fold' : 0, 'stl' : 1},
  629. \ {'short' : 'v', 'long' : 'Enumeration values', 'fold' : 0, 'stl' : 0},
  630. \ {'short' : 's', 'long' : 'Structures', 'fold' : 0, 'stl' : 1},
  631. \ {'short' : 'i', 'long' : 'Interfaces', 'fold' : 0, 'stl' : 1},
  632. \ {'short' : 'd', 'long' : 'Delegates', 'fold' : 0, 'stl' : 1},
  633. \ {'short' : 'c', 'long' : 'Classes', 'fold' : 0, 'stl' : 1},
  634. \ {'short' : 'p', 'long' : 'Properties', 'fold' : 0, 'stl' : 0},
  635. \ {'short' : 'f', 'long' : 'Fields', 'fold' : 0, 'stl' : 0},
  636. \ {'short' : 'm', 'long' : 'Methods', 'fold' : 0, 'stl' : 1},
  637. \ {'short' : 'E', 'long' : 'Error domains', 'fold' : 0, 'stl' : 1},
  638. \ {'short' : 'r', 'long' : 'Error codes', 'fold' : 0, 'stl' : 1},
  639. \ {'short' : 'S', 'long' : 'Signals', 'fold' : 0, 'stl' : 1}
  640. \ ]
  641. let type_vala.sro = '.'
  642. " 'enum' doesn't seem to be used as a scope, but it can't hurt to have
  643. " it here
  644. let type_vala.kind2scope = {
  645. \ 's' : 'struct',
  646. \ 'i' : 'interface',
  647. \ 'c' : 'class',
  648. \ 'e' : 'enum'
  649. \ }
  650. let type_vala.scope2kind = {
  651. \ 'struct' : 's',
  652. \ 'interface' : 'i',
  653. \ 'class' : 'c',
  654. \ 'enum' : 'e'
  655. \ }
  656. let types.vala = type_vala
  657. endif
  658. if !has_key(a:supported_types, 'vala') && executable('anjuta-tags')
  659. let types.vala.ctagsbin = 'anjuta-tags'
  660. endif
  661. " Vera {{{1
  662. " Why are variables 'virtual'?
  663. let type_vera = tagbar#prototypes#typeinfo#new()
  664. let type_vera.ctagstype = 'vera'
  665. let type_vera.kinds = [
  666. \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
  667. \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
  668. \ {'short' : 'T', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
  669. \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
  670. \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
  671. \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
  672. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  673. \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1},
  674. \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
  675. \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1}
  676. \ ]
  677. let type_vera.sro = '.' " Nesting doesn't seem to be possible
  678. let type_vera.kind2scope = {
  679. \ 'g' : 'enum',
  680. \ 'c' : 'class',
  681. \ 'v' : 'virtual'
  682. \ }
  683. let type_vera.scope2kind = {
  684. \ 'enum' : 'g',
  685. \ 'class' : 'c',
  686. \ 'virtual' : 'v'
  687. \ }
  688. let types.vera = type_vera
  689. " Verilog {{{1
  690. let type_verilog = tagbar#prototypes#typeinfo#new()
  691. let type_verilog.ctagstype = 'verilog'
  692. let type_verilog.kinds = [
  693. \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
  694. \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
  695. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  696. \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
  697. \ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 1},
  698. \ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 1},
  699. \ {'short' : 'r', 'long' : 'register data types', 'fold' : 0, 'stl' : 1},
  700. \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}
  701. \ ]
  702. let types.verilog = type_verilog
  703. " VHDL {{{1
  704. " The VHDL ctags parser unfortunately doesn't generate proper scopes
  705. let type_vhdl = tagbar#prototypes#typeinfo#new()
  706. let type_vhdl.ctagstype = 'vhdl'
  707. let type_vhdl.kinds = [
  708. \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
  709. \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
  710. \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
  711. \ {'short' : 'T', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
  712. \ {'short' : 'r', 'long' : 'records', 'fold' : 0, 'stl' : 1},
  713. \ {'short' : 'e', 'long' : 'entities', 'fold' : 0, 'stl' : 1},
  714. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  715. \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
  716. \ ]
  717. let types.vhdl = type_vhdl
  718. " Vim {{{1
  719. let type_vim = tagbar#prototypes#typeinfo#new()
  720. let type_vim.ctagstype = 'vim'
  721. let type_vim.kinds = [
  722. \ {'short' : 'n', 'long' : 'vimball filenames', 'fold' : 0, 'stl' : 1},
  723. \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0},
  724. \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
  725. \ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1, 'stl' : 1},
  726. \ {'short' : 'c', 'long' : 'commands', 'fold' : 0, 'stl' : 0},
  727. \ {'short' : 'm', 'long' : 'maps', 'fold' : 1, 'stl' : 0}
  728. \ ]
  729. let types.vim = type_vim
  730. " YACC {{{1
  731. let type_yacc = tagbar#prototypes#typeinfo#new()
  732. let type_yacc.ctagstype = 'yacc'
  733. let type_yacc.kinds = [
  734. \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
  735. \ ]
  736. let types.yacc = type_yacc
  737. " }}}1
  738. for [type, typeinfo] in items(types)
  739. let typeinfo.ftype = type
  740. endfor
  741. for typeinfo in values(types)
  742. call typeinfo.createKinddict()
  743. endfor
  744. return types
  745. endfunction
  746. " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1