Wednesday, August 10, 2022

Re: vim9 exported functions not recognized by ctags

On 2022-08-10, N V <nivaemail@gmail.com> wrote:
> Hi,
>
> Exported functions in New vim9 are not found by exubérant ctags, universal
> ctags and not displayed by tagbar plugin
> https://github.com/preservim/tagbar
>
> Is there a work around.

I have the same problem. I think that this will be eventually solved
upstream, but in the meantime the following works for me with Universal
Ctags (I haven't had time to refine this, so what follows is just
a sketch):

1. Create ~/.ctags.d/vim.ctags with the following content:

--kinddef-vim=e,export,exported function
--regex-vim=/^[ \t]*export[ \t]+def[ \t]+([^(]+)/\1/e,export/

2. In your .vimrc, or in your after/ftplugin/vim.vim file, inform Tagbar
about the new entity:

g:tagbar_type_vim = { 'ctagstype': 'vim', 'kinds': ['e:export'] }

Now, Tagbar should display (only) exported functions. Refer to Tagbar
documentation to learn how to *extend* the already recognized entities
by adding exported functions.

Hope this helps,
Life.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/td13uj%24dph%241%40ciao.gmane.io.

No comments: