Closed wuseal closed 10 months ago
My file is located at ~/.ctags.d/kotlin.ctags
. Give that a try and see if it fixes the issue.
@daveyarwood Hi, Thanks for you reply.
After putting the content in ~/.ctags.d/kotlin.ctags
as you said, It seems do work, but there is an error throw out when I run
ctags --list-languages
ctags: Non-alphanumeric char is used in kind name: 'data classes' in "--regex-kotlin" option
May something not compatible with current Universal-ctags
?
Hi, I follow the solution here:https://gist.github.com/kittinunf/25484de6294a0c4263c86dda3aa1580c#gistcomment-3171742
Because you can't have spaces in Kind names. Replacing line 6 with the line below fixes the problem.
--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy|open)[[:space:]]*)*(private[^ ]*|protected)?[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*data[[:space:]]+class[[:space:]]+([[:alnum:]_:]+)/\6/d,dataclasses/
It works for me. Thank you for your help, best wishes to you 😄
It seems do not work with TagbarToggle
No file tags could be found 😢
Are you generating the ctags? You can do it manually with ctags -R
followed by the directory that your source code is in. For example, ctags -R .
or ctags -R src
Having to do this manually every time your source code changes would be really annoying, so there are Vim plugins to automate it. I use https://github.com/ludovicchabant/vim-gutentags and it works well.
You will be interested in https://github.com/universal-ctags/ctags/pull/2769.
Nice! Looks like I might be able to simplify my setup once that is released.
I've since deleted my Kotlin ctags config, as there now seems to be good built-in support for Kotlin (possibly related to the commit linked above).
Hello, After putting the content in kotlin.ctags into ~/.ctags file. I run this command:
ctags --list-languages
It doesn't containsKotlin
.I am using Universal-ctags.
Hi, Bro, I need your help 😢