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

no tag found using with tagbar #49

Open
GeekaholicLin opened this issue Jan 17, 2017 · 2 comments
Open

no tag found using with tagbar #49

GeekaholicLin opened this issue Jan 17, 2017 · 2 comments

Comments

@GeekaholicLin
Copy link

GeekaholicLin commented Jan 17, 2017

I want to use jsctags and tagbar in vim,but there were something wrong.

When I used them in vim,the tagbar always said 'no tag found'.

I used the command find . -type f -iregex ".*\.js$" -exec jsctags {} -f \; | sed '/^$/d' | sort > tags for a test file test.js, and it created a file named 'tags' in the directory.The file tags showes the result of the command successfully.

The content of file:

a	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/a/;"	f	lineno:1	type:void function()
b	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/b/;"	v	lineno:19	namespace:y	type:boolean
b	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/b/;"	v	lineno:29	type:number
e1	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/e1/;"	v	lineno:33	type:string
e3	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/e3/;"	v	lineno:33	type:number
Foo	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/Foo/;"	f	lineno:4	type:void function(?, ?)
func	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/func/;"	f	lineno:18	namespace:y	type:number function()
it	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/it/;"	f	lineno:23	type:!0 function(?)
method	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/method/;"	f	lineno:10	namespace:Foo.prototype	type:void function()
n	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/n/;"	v	lineno:23	namespace:it
prototype	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/class Foo \{/;"	v	lineno:4	namespace:Foo
x	D:\babun\.babun\cygwin\home\Garcin\test\test.js	/x/;"	v	lineno:12	namespace:Foo.prototype	type:string

But when I toggle the tagbar, it does not work.And I found a issue in the repo majutsushi/tagbar.

Are there any configs that I should write in my vimrc file to let it work correctly for js?

@GeekaholicLin GeekaholicLin changed the title No Tag Found no tag found using with tagbar Jan 17, 2017
@jchain
Copy link

jchain commented May 2, 2017

I have the same issue. I compared the formats jsctags and ctags(vanilla) and found out the two are a bit different. Especially the 'lineno' part. I guess tagbar can't parse the jsctags correctly so shows nothing in the side windows.

@majutsushi
Copy link

Tagbar doesn't use pre-generated tags files, it generates the necessary information on the fly. That said, this should work automatically as long as jsctags is in your $PATH. If it is and it is still not working, please generate a logfile as explained in :h tagbar-issues and open a new issue in the Tagbar repo.

The lineno part should work, Tagbar has a special case for that.

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

3 participants