Skip to content

Braces break folding #781

@mneilly

Description

@mneilly

Describe the bug
Braces are included in the regular expression for folding start and end markers for system verilog. While it would be nice to be able to fold concatenations the current implementation breaks folding when braces are in certain positions. While one can try to format the code appropriately it is not always possible. E.g. when using a formatter or having long concatenations etc.

The result is folding that folds multiple blocks, partial blocks, everything following, etc.

To Reproduce

class my_driver extends uvm_driver;

task folds_everything_below_it();
    sig1 = {
        2'b10, 1'b1};
endtask;

task folds_itself_and_next_task();
    sig1 = {
        2'b10, 1'b1};
endtask

task folds_up_to_semicolon();
    sig1 = { 2'b10, 1'b1
}
;
endtask

endclass

Please complete the following information:

  • OS: windows, linux
  • VSCode version version: 1.102.1

Additional context
Removing brace folding until it works or adding an option to enable or disable brace folding would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions