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

folding error when using extern function/task with argument #242

Open
dvtalk opened this issue May 12, 2024 · 1 comment
Open

folding error when using extern function/task with argument #242

dvtalk opened this issue May 12, 2024 · 1 comment

Comments

@dvtalk
Copy link

dvtalk commented May 12, 2024

Hi,
I has been using your vim plug for a while, and it the best so far.
However, when I have a class with extern functions/tasks, the folding will not work expecting from the extern methods with argument which has default value.
As in the picture.
Could you help to fix this.

Thanks a lot
image

My test class:

class test_syn extends uvm_component;
   `uvm_component_utils(test_syn)

   function new(string name = "test_syn", uvm_component parent);
     super.new(name, parent);
   endfunction : new

  extern virtual task    test_syn_task0();
  extern virtual task    test_syn_task1();
  extern virtual task    test_syn_task2();
  extern virtual task    test_syn_task3();
  extern virtual task    test_syn_task4(int b);
  extern virtual task    test_syn_task5(int a = 0);   //folding from here
 
endclass: test_syn

my vim cfg:

augroup filetype_verilog_systemverilog
  autocmd!
  autocmd FileType verilog_systemverilog setlocal foldmethod=syntax
  autocmd FileType verilog_systemverilog let g:verilog_indent_width = 3
  autocmd FileType verilog_systemverilog let g:verilog_efm_uvm_lst = "all"
  autocmd FileType verilog_systemverilog setlocal foldcolumn=2 "defines 2 col at window left, to indicate folding
  autocmd FileType verilog_systemverilog setlocal foldopen=block,insert,hor,search
  autocmd FileType verilog_systemverilog setlocal foldclose=all
  autocmd FileType verilog_systemverilog let g:verilog_efm_uvm_lst = "fatal,error,warning"
  autocmd FileType verilog_systemverilog let g:verilog_syntax_fold_lst = "class,function,task,interface,covergroup,sequence,property,block,instance,specify"
  autocmd FileType verilog_systemverilog setlocal foldlevelstart=1
  autocmd FileType verilog_systemverilog setlocal foldlevel=1
augroup END
@vhda
Copy link
Owner

vhda commented Jul 20, 2024

Hi @dvtalk,
Sorry for the long time to reply.
Vim does not allow folding of a single line.
If you had an empty line, I could try to fold the extern and the consecutive empty line, but not sure if this would even make sense.

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

2 participants