preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.1k stars 485 forks source link

No tags found in Go1.18 with generics #813

Closed heimonsy closed 2 years ago

heimonsy commented 2 years ago

Steps to reproduce:

import ( "golang.org/x/exp/constraints" )

func Test[T constraints.Ordered](arr T) { }

- :TagbarToggle

Expected behavior:
Find tags in tagbar window.

Real behavior:
No tags found.

uctags outcome:

Test main.go /^func Test[T constraints.Ordered](arr T) {$/;" f package:main typeref:typename:(arr T) main main.go /^package main$/;" p



Envs:
NVIM v0.6.1
Universal Ctags 5.9.0
heimonsy commented 2 years ago

Sorry for bothering . I found out tagbar are using gotags, tags showed up after I deleted gotags.

And now there's a little problem, the generic function didn't show function arguments, only the function name and generic type parts are showed up。

▾ functions
    Test[T constraints.Ordered]
heimonsy commented 2 years ago

Now I find out gotags works after I reinstall it. Thank you for your awesome plugin.