0

I installed tagbar in vim.

It parses the whole js file perfectly. But, when i try to use ctags, it doesnt parse the file well.

Now, isnt tagbar using ctags?

https://picasaweb.google.com/lh/photo/dVQuETMxHXqTEgM7Zeim1dMTjNZETYmyPJy0liipFm0?feat=directlink

2 Answers 2

0

Check your tags and pwd status:

:set tags?
:pwd

The tags files shown by the set tags? command should be reachable from your pwd.

7
  • i tried :set tags? It gave me tags=./tags, ./TAGS, tags, TAGS. The ~/tags file contains the tags information, so i guess that map to the ./tags file outputted by the :set tags? command. the rest - ./TAGS, tags, TAGS - are none existent. Dec 21, 2011 at 21:28
  • ohh yea, and when i try to do :tag /draw, it tell me there are 26 tags for draw. i dont know if it means 26 references and definition or just 26 definitions. Dec 21, 2011 at 21:46
  • ctags deals with definitions only. You are supposed to use cscope for usage. Please, answer clearly to these questions: 0. What is your working directory (:pwd)? 1. Is it the same as the one containing myjs.js? 2. Do you have a tags file at the root of the working directory or at the root of the directory where myjs.js resides? 3. How and why did you set tags that way?
    – romainl
    Dec 21, 2011 at 22:18
  • Also, depending on how you write your JavaScript or how ctags is configured it may record tags in a dotted format like constructor.method in such a case :tag method won't work, only :tag constructor.method or :tag /method would do. It looks like you have a single tags file for all your stuff; if that's correct, it means that you have 26 definitions containing the word draw.
    – romainl
    Dec 21, 2011 at 22:34
  • 0)the working directory is ~. 1)it is the same as the one containing myjs.js. 2) i dont understand very well what do you mean "the root of a directory". But the tags file is in ~ - thats the pwd and the directory that contains myjs.js. 3) i did not set the tags. I discovered it hehe ;) Dec 21, 2011 at 23:10
0

TagBar generates its own tags on the fly and it doesn't even write it to disk somewhere: ctags' output is directly parsed and displayed in the window.

You may get this error because you didn't generate a tags file with :!ctags -R . or because it's out of date.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.