3

can anybody help me to add systemverilog language support in tagbar vim plugin.

I tried below things but its doesnt worked for me

1) Created ~/.ctags and copy code from https://github.com/shaohao/config.d/blob/master/ctags

2) mkdir ftplugin to ~/.vim and add systemverilog.vim from https://github.com/shaohao/vimfiles/blob/master/bundle/verilog_systemverilog/ftplugin/systemverilog.vim

3)cd to project directory and run ctags -R * Got below warning though

 ctags: Warning: Unknown language specified in "langmap" option

Below are some output of ctags

 ctags --list-languages
 ctags: Warning: Unknown language specified in "langmap" option
 .
 .
 systemverilog

 ctags --list-kinds=systemverilog

 ctags: Warning: Unknown language specified in "langmap" option
 e  clocking 
 i  constraint 
 l  covergroup 
 o  class 
 t  function 
 A  interface 
 G  module 
 J  package 
 M  program 
 W  task 

But still when i open SV file in gvim and use :TagbarToggle tagbar window is blank :(

Please help

vjain419
  • 243
  • 1
  • 3
  • 11

2 Answers2

2

I've introduced some improvements to the verilog_systemverilog vim plugin that I made available at Github. You should have proper Tagbar support if you use this development version of exuberante-ctags together with my vim plugin and the following Tagbar configuration:

let g:tagbar_type_verilog_systemverilog = {
        \ 'ctagstype'   : 'SystemVerilog',
        \ 'kinds'       : [
            \ 'b:blocks:1:1',
            \ 'c:constants:1:0',
            \ 'e:events:1:0',
            \ 'f:functions:1:1',
            \ 'm:modules:0:1',
            \ 'n:nets:1:0',
            \ 'p:ports:1:0',
            \ 'r:registers:1:0',
            \ 't:tasks:1:1',
            \ 'A:assertions:1:1',
            \ 'C:classes:0:1',
            \ 'V:covergroups:0:1',
            \ 'I:interfaces:0:1',
            \ 'M:modport:0:1',
            \ 'K:packages:0:1',
            \ 'P:programs:0:1',
            \ 'R:properties:0:1',
            \ 'T:typedefs:0:1'
        \ ],
        \ 'sro'         : '.',
        \ 'kind2scope'  : {
            \ 'm' : 'module',
            \ 'b' : 'block',
            \ 't' : 'task',
            \ 'f' : 'function',
            \ 'C' : 'class',
            \ 'V' : 'covergroup',
            \ 'I' : 'interface',
            \ 'K' : 'package',
            \ 'P' : 'program',
            \ 'R' : 'property'
        \ },
    \ }
Vitor
  • 1,936
  • 12
  • 20
1

Background: TagBar won't use your tags file, it queries ctags and read its output directly from stdout.

I believe the problem is how the --langmap is defined in your ~/.ctags. AFAIK, the coma is used to separate langmaps while different extensions are just put one after the other without separators:

--langmap=foo:.foo.fo.oo,bar:.bar.ba

I think line 2 of your ~/.ctags file should look like this:

--langmap=systemverilog:.sv.svh.svp
romainl
  • 186,200
  • 21
  • 280
  • 313
  • Thank you :) with above change warning is gone! but what about adding support in tagbar! – vjain419 Mar 07 '14 at 09:18
  • TagBar is supposed to honor the definitions in your `~/.ctags` when running `ctags` against your code. If you still have problems I suggest you try TagBar's issue tracker. – romainl Mar 07 '14 at 09:39
  • didnt get you? tagbar is not working for me with above changes even with warning fix. – vjain419 Mar 07 '14 at 16:56
  • Yes, I got you, but this is not tagbar's issue tracker. – romainl Mar 07 '14 at 17:40