From ab6f2d5a683041a46c48b28418d4a2a01bbd5551 Mon Sep 17 00:00:00 2001 From: Damir Sharipov Date: Fri, 6 Aug 2021 15:23:55 +0300 Subject: [PATCH] feature: Add basic Crystal support (#787) --- autoload/tagbar/types/ctags.vim | 15 +++++++++++++++ autoload/tagbar/types/uctags.vim | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/autoload/tagbar/types/ctags.vim b/autoload/tagbar/types/ctags.vim index 97c49f2..ca49ab1 100644 --- a/autoload/tagbar/types/ctags.vim +++ b/autoload/tagbar/types/ctags.vim @@ -195,6 +195,21 @@ function! tagbar#types#ctags#init(supported_types) abort \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1} \ ] let types.cobol = type_cobol + " Crystal {{{1 + let type_crystal = tagbar#prototypes#typeinfo#new() + let type_crystal.ctagstype = 'crystal' + let type_crystal.kinds = [ + \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'd', 'long' : 'defs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'M', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'l', 'long' : 'libs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 1} + \ ] + let type_crystal.sro = '::' + let types.crystal = type_crystal " DOS Batch {{{1 let type_dosbatch = tagbar#prototypes#typeinfo#new() let type_dosbatch.ctagstype = 'dosbatch' diff --git a/autoload/tagbar/types/uctags.vim b/autoload/tagbar/types/uctags.vim index 5fd4a28..db98384 100644 --- a/autoload/tagbar/types/uctags.vim +++ b/autoload/tagbar/types/uctags.vim @@ -319,6 +319,21 @@ function! tagbar#types#uctags#init(supported_types) abort \ 'function' : 'f', \ } let types.cmake = type_cmake + " Crystal {{{1 + let type_crystal = tagbar#prototypes#typeinfo#new() + let type_crystal.ctagstype = 'crystal' + let type_crystal.kinds = [ + \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'd', 'long' : 'defs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'M', 'long' : 'macros', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'l', 'long' : 'libs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1}, + \ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 1} + \ ] + let type_crystal.sro = '::' + let types.crystal = type_crystal " Ctags config {{{1 let type_ctags = tagbar#prototypes#typeinfo#new() let type_ctags.ctagstype = 'ctags'