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

tagbar is empty when using jsctags( ramitos/jsctags ) #353

Closed
maple-leaf opened this issue Oct 24, 2016 · 1 comment
Closed

tagbar is empty when using jsctags( ramitos/jsctags ) #353

maple-leaf opened this issue Oct 24, 2016 · 1 comment

Comments

@maple-leaf
Copy link

maple-leaf commented Oct 24, 2016

Some details here:
1, tags file is being generated correct, messages is clean. (generated by Plug 'ludovicchabant/vim-gutentags')
2, I can use ctrl+] and ctrl+T to jump tag.(use tags generated by vim-gutentags)
3, call :Tagbar will get an window has "No tags found"
4, I delete tags file and try ctrl+] will raise tag file not found error, which is exptected.
5, It's same wheather I add let g:tagbar_ctags_bin='jsctags' manually or not.
6, The js code is AMD way

OS: Mac yosemite

.tern-project file:

{ "libs": [ "browser", "jquery" ], "plugins": { "requirejs": { "baseURL": "./", "paths": {} } } }
output of npm info jsctags:

{ name: 'jsctags', description: 'jsctags generator', 'dist-tags': { latest: '5.1.0' }, versions: [ '0.1.0', '1.0.0', '2.0.0', ... users: { felixjung: true, yatsu: true }, homepage: 'https://github.com/ramitos/jsctags', keywords: [ 'ctags', 'jsctags', 'tern' ], ... dist: { shasum: '81479afa5893e9a4801d1f7123b5be94afc82696', tarball: 'https://registry.npmjs.org/jsctags/-/jsctags-5.1.0.tgz' } }

And here's my :TagbarDebug output:

1970-01-18 15:10:36.203723: AutoUpdate called [/the/path/to/project/root/]
1970-01-18 15:10:36.204332: Vim filetype: '', sanitized filetype: ''
1970-01-18 15:10:36.204465: Checking if file is valid [/the/path/to/project/root/]
1970-01-18 15:10:36.204640: Empty filename or type
1970-01-18 15:10:36.204796: Not a valid file, stopping processing
1970-01-18 15:10:36.229692: AutoUpdate called [term://.//6907:git ls-files |"/Users/maple-leaf/.fzf/bin/fzf" -m --prompt "GitFiles> " --expect=ctrl-v,ctrl-x,ctrl-t > /var/folders/g7/tmk5tm096kb6gdjrtpj3w11h0000gn/T/nvimygqEaR/1;#FZF]
1970-01-18 15:10:36.230325: Vim filetype: 'fzf', sanitized filetype: 'fzf'
1970-01-18 15:10:36.230662: Checking if file is valid [term://.//6907:git ls-files |"/Users/maple-leaf/.fzf/bin/fzf" -m --prompt "GitFiles> " --expect=ctrl-v,ctrl-x,ctrl-t > /var/folders/g7/tmk5tm096kb6gdjrtpj3w11h0000gn/T/nvimygqEaR/1;#FZF]
1970-01-18 15:10:36.231191: File not readable
1970-01-18 15:10:36.231431: Not a valid file, stopping processing
1970-01-18 15:10:37.530899: AutoUpdate called [/the/path/to/project/root/]
1970-01-18 15:10:37.531163: Vim filetype: '', sanitized filetype: ''
1970-01-18 15:10:37.531288: Checking if file is valid [/the/path/to/project/root/]
1970-01-18 15:10:37.531415: Empty filename or type
1970-01-18 15:10:37.531581: Not a valid file, stopping processing
1970-01-18 15:10:38.420497: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:38.420722: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:10:38.420852: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:38.421121: New file, processing [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:38.421258: ProcessFile called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:38.421398: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:38.421773: typeinfo for file to process: {'ctagstype': 'javascript', 'ftype': 'javascript', 'kinddict': {'f': 1, 'v': 0}, 'ctagsargs': '-f -', 'sro': '.', 'getKind': function('39'), 'createKinddict': function('40'), 'kind2scope': {'f': 'namespace', 'v': 'namespace'}, 'ctagsbin': 'jsctags', 'scope2kind': {'namespace': 'v'}, 'New': function('38'), 'kinds': [{'short': 'v', 'long': 'variables', 'fold': 0, 'stl': 0}, {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1}]}
1970-01-18 15:10:38.424603: ExecuteCtagsOnFile called [/var/folders/g7/tmk5tm096kb6gdjrtpj3w11h0000gn/T/nvimygqEaR/2.js]
1970-01-18 15:10:38.424889: EscapeCtagsCmd called
1970-01-18 15:10:38.425017: ctags_bin: jsctags
1970-01-18 15:10:38.425158: ctags_args (is a string):  -f - 
1970-01-18 15:10:38.425514: Escaped ctags command: 'jsctags'  -f -  '/var/folders/g7/tmk5tm096kb6gdjrtpj3w11h0000gn/T/nvimygqEaR/2.js'
1970-01-18 15:10:38.425684: Executing ctags command: 'jsctags'  -f -  '/var/folders/g7/tmk5tm096kb6gdjrtpj3w11h0000gn/T/nvimygqEaR/2.js'
1970-01-18 15:10:39.181833: "js_v5/material/show.js" 714L, 28949C
1970-01-18 15:10:39.344641: Ctags executed successfully
1970-01-18 15:10:39.345194: Filetype tag kinds: ['f', 'v']
1970-01-18 15:10:39.345398: Parsing ctags output
1970-01-18 15:10:39.345611: Processing scoped tags
1970-01-18 15:10:39.346204: Number of top-level tags: 0
1970-01-18 15:10:39.346429: Processing kind: v, number of tags: 0
1970-01-18 15:10:39.346863: Processing kind: f, number of tags: 0
1970-01-18 15:10:39.347346: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.347866: AutoUpdate finished successfully
1970-01-18 15:10:39.355380: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.355613: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:10:39.355730: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.356162: File data seems up to date [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.356517: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.356820: AutoUpdate finished successfully
1970-01-18 15:10:39.372884: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.373248: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:10:39.373418: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.373757: File data seems up to date [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.374027: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:39.374502: AutoUpdate finished successfully
1970-01-18 15:10:43.752755: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:43.753279: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:10:43.753463: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:43.753773: File data seems up to date [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:43.754126: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:10:43.754541: AutoUpdate finished successfully
1970-01-18 15:11:39.376006: ToggleWindow called
1970-01-18 15:11:39.384455: OpenWindow called with flags: ''
1970-01-18 15:11:39.384968: goto_win(): wincmd p, 1
1970-01-18 15:11:39.385224: goto_win(): wincmd p, 1
1970-01-18 15:11:39.587705: AutoUpdate called [/the/path/to/project/root/__Tagbar__.1]
1970-01-18 15:11:39.587952: Still opening window, stopping processing
1970-01-18 15:11:39.602194: InitWindow called with autoclose: 0
1970-01-18 15:11:39.610187: AutoUpdate called [/the/path/to/project/root/__Tagbar__.1]
1970-01-18 15:11:39.610451: In Tagbar window, stopping processing
1970-01-18 15:11:39.614171: Mapping keys
1970-01-18 15:11:39.615416: InitWindow finished
1970-01-18 15:11:39.615578: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:39.615749: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:11:39.615951: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:39.616340: File data seems up to date [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:39.616538: RenderContent called
1970-01-18 15:11:39.616737: Redisplaying file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:39.617106: No tags found, skipping printing.
1970-01-18 15:11:39.617455: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:39.620210: AutoUpdate finished successfully
1970-01-18 15:11:39.672376: goto_win(): 1wincmd w, 1
1970-01-18 15:11:39.672685: goto_win(): 1wincmd w, 0
1970-01-18 15:11:39.672832: OpenWindow finished
1970-01-18 15:11:39.672952: ToggleWindow finished
1970-01-18 15:11:43.772689: AutoUpdate called [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:43.773266: Vim filetype: 'javascript', sanitized filetype: 'javascript'
1970-01-18 15:11:43.773478: Checking if file is valid [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:43.773897: File data seems up to date [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:43.774204: Setting current file [/the/path/to/project/root/js_v5/material/show.js]
1970-01-18 15:11:43.774596: goto_win(): wincmd p, 1
1970-01-18 15:11:43.774811: goto_win(): 2wincmd w, 1
1970-01-18 15:11:43.778411: goto_win(): 2wincmd w, 1
1970-01-18 15:11:43.778578: goto_win(): 1wincmd w, 1
1970-01-18 15:11:43.778761: AutoUpdate finished successfully

The output of jsctags -f - show.js is empty.

@majutsushi
Copy link
Collaborator

As your last line says, this seems to be an issue with jsctags not being able to parse your files properly, resulting in it not outputting any tags. After looking at the vim-gutentags project and your configuration it seems to me that your tags file is being generated by plain ctags, not jsctags. Ctags is probably able to find various tags, hence allowing you to jump to them, but is maybe not that great with detecting the structure.

So the problem seems to be with jsctags. I would recommend opening an issue with that project.

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

No branches or pull requests

2 participants