VScode onEnterRules append two lines in action

Viewed 40

I tried a lot to use onEnterRules to add two lines after, but the result was not what I expected, can someone help me to do that.

"onEnterRules": [
    {
      "beforeText": "begin",
      "action": {
        "indent": "indent",
        "appendText": "\nend"
      }
    },
  ]

the intended result is:

module tb;
  initial begin
    repeat(5) begin
      
    end
  end
endmodule: tb

the actual result is:

module tb;
  initial begin
    repeat(5) begin
      
end
end
endmodule: tb

note how the end is always type in the start of the next line, any ideas to type it with the suitable indentation?

0 Answers
Related