sheerun / vim-polyglot

A solid language pack for Vim.
5.6k stars 298 forks source link

typescript support breaks preservim / tagbar #730

Open vitaly opened 3 years ago

vitaly commented 3 years ago

Does this bug happen when you install plugin without vim-polyglot? no

Describe the bug: The problem is with the g:tagbar_type_typescript setting set at https://github.com/sheerun/vim-polyglot/blob/master/ftplugin/typescript.vim#L109

when vim-polyglot is loaded tagbar is empty.

I tried to diagnose the issue. first, it seems that ctags now natively supports typescript, at least mine does:

> ctags --version
Universal Ctags 0.0.0(2ebf5b1), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Dec  7 2019, 15:48:52
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +case-insensitive-filenames, +packcc

> ctags --list-kinds-full=typescript
#LETTER NAME       ENABLED REFONLY NROLES MASTER DESCRIPTION
C       constant   yes     no      0      NONE   constants
G       generator  yes     no      0      NONE   generators
a       alias      yes     no      0      NONE   aliases
c       class      yes     no      0      NONE   classes
e       enumerator yes     no      0      NONE   enumerators (values inside an enumeration)
f       function   yes     no      0      NONE   functions
g       enum       yes     no      0      NONE   enums
i       interface  yes     no      0      NONE   interfaces
l       local      no      no      0      NONE   local variables
m       method     yes     no      0      NONE   methods
n       namespace  yes     no      0      NONE   namespaces
p       property   yes     no      0      NONE   properties
v       variable   yes     no      0      NONE   variables
z       parameter  no      no      0      NONE   function parameters inside function definitions

This is what happens when I try to run ctags with the config file provided by vim-polyglot (same as tagbar does):

> ctags --options=/Users/vitaly/.vim/bundle/vim-polyglot/ctags/typescript.ctags
ctags: Language "typescript" already defined

If I disable provided ctags file via g:typescript_use_builtin_tagbar_defs tagbar does work, somewhat, but it way less helpfull then without g:tagbar_type_typescript completely:

This is with let g:typescript_use_builtin_tagbar_defs=0 Screenshot 2021-06-28 at 07 24 43

This is with unlet g:tagbar_type_typescript before opening tagbar: Screenshot 2021-06-28 at 07 22 47

To Reproduce:

rf- commented 2 years ago

It looks like this is actually a problem with yats.vim: https://github.com/HerringtonDarkholme/yats.vim/issues/206