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

使用unique case或者priority case时formatter问题 #115

Open
BrianLChen opened this issue Jan 22, 2025 · 0 comments
Open

使用unique case或者priority case时formatter问题 #115

BrianLChen opened this issue Jan 22, 2025 · 0 comments

Comments

@BrianLChen
Copy link

当使用unique case和priority case时,formatter会把缩进对齐case,而不是unique,并影响到后面其他行的缩进位置

测试和期望输出

module test();
  logic [7:0] var1;
  logic [7:0] value;

  always_comb
  begin
    unique case (var1)
      1:
      begin
        value= 1;
      end
      2:
      begin
        value = 2;
      end
      default:
      begin
        value = 0;
      end
    endcase
  end
endmodule

实际formatter输出

module test();
  logic [7:0] var1;
  logic [7:0] value;

  always_comb
  begin
    unique case (var1)
             1:
             begin
               value= 1;
             end
             2:
             begin
               value = 2;
             end
             default:
             begin
               value = 0;
             end
           endcase
         end
       endmodule

可以看到,因为对其了case,导致后面的endmodule也受到了影响,缩进到了不正确的位置

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

1 participant