Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim9: no tag is generated for ":def" functions #2589

Closed
lacygoill opened this issue Jul 8, 2020 · 4 comments
Closed

Vim9: no tag is generated for ":def" functions #2589

lacygoill opened this issue Jul 8, 2020 · 4 comments

Comments

@lacygoill
Copy link
Contributor

lacygoill commented Jul 8, 2020

Describe the bug

No tag is generated for Vim9 :def functions.

To Reproduce

Run these shell commands:

mkdir -p /tmp/vim_plugin \
&& cd /tmp/vim_plugin \
&& cat <<'EOF' >foo.vim
    fu Legacy()
        echo 'legacy function'
    endfu
    def Vim9Function()
        echo 'Vim9 function'
    enddef
EOF

ctags --options=NONE -R .

Here is the contents of the generated tags file:

!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_FILESEP	slash	/slash or backslash/
!_TAG_OUTPUT_MODE	u-ctags	/u-ctags or e-ctags/
!_TAG_PATTERN_LENGTH_LIMIT	96	/0 for no limit/
!_TAG_PROGRAM_AUTHOR	Universal Ctags Team	//
!_TAG_PROGRAM_NAME	Universal Ctags	/Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL	https://ctags.io/	/official site/
!_TAG_PROGRAM_VERSION	0.0.0	/b4574f0a/
Legacy	foo.vim	/^    fu Legacy()$/;"	f

It does not contain a tag for the Vim9Function().

Expected behavior

I would expect this line to be present in the tags file:

Vim9Function	foo.vim	/^    def Vim9Function()$/;"	f

Environment

  • ctags version:

    Universal Ctags 0.0.0(b4574f0a), Copyright (C) 2015 Universal Ctags Team
    Universal Ctags is derived from Exuberant Ctags.
    Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
      Compiled: Jul  8 2020, 09:30:25
      URL: https://ctags.io/
      Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc
    
  • OS: Ubuntu 16.04.6 LTS

I built ctags locally after cloning the source code from the github repository, and making sure I was on the latest commit of the master branch.

Additional context

These new :def functions are documented on the vimhelp.org website.

@lacygoill lacygoill changed the title no tag is generated for Vim9 ":def" functions Vim9: no tag is generated for ":def" functions Jul 8, 2020
@lacygoill
Copy link
Contributor Author

lacygoill commented Jul 8, 2020

Not sure whether this is a bug, but no tag is generated either for constants defined with the :const keyword.


I guess those tokens are too recent. I'll read the manpage to learn how to configure ctags(1) so that it parses them correctly.

@k-takata
Copy link
Member

k-takata commented Jul 8, 2020

Universal ctags has a Vim script parser: https://github.com/universal-ctags/ctags/blob/master/parsers/vim.c
It doesn't support Vim9 script yet.
I think this should be discussed at the u-ctags repository, not here.

@lacygoill
Copy link
Contributor Author

Universal ctags has a Vim script parser: https://github.com/universal-ctags/ctags/blob/master/parsers/vim.c

Oh, thank you very much for the pointer. I don't know C, but if it's not too difficult, maybe I'll try to submit a PR.

I think this should be discussed at the u-ctags repository, not here.

You're right, but I opened the issue on the u-ctags repository, not the Vim one.

@k-takata
Copy link
Member

k-takata commented Jul 8, 2020

You're right, but I opened the issue on the u-ctags repository, not the Vim one.

Oh, I totally misunderstood if this is in the Vim repository.
(Because you reused the Vim repository's issue tempate.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants