mshr-h / vscode-verilog-hdl-support

HDL support for VS Code
MIT License
296 stars 78 forks source link

[BUG] Picking end statements (e.g., `endgenerate`) from autocomplete dialog doesn't auto-dedent (unindent) #467

Open DeflateAwning opened 9 months ago

DeflateAwning commented 9 months ago

Describe the bug Picking end-of-block statements (e.g., endgenerate) from autocomplete dialog doesn't auto-dedent (unindent)

Environment:

Steps to reproduce

  1. Begin typing this code:
generate
        for (i=0; i<4; i++) begin
            assign 1;
        end
        endgen
  1. You'll see the autocomplete popup suggest endgenerate as you get halfway through typing it (i.e., you're typing endgen per Step 1).
  2. Press enter to select completing the endgen partial text to endgenerate.
  3. See that endgenerate is filled, but does not return to the parent indent level.

This can be reproduced with many end-of-block keywords (e.g., end [albeit tough to do because it's so short], endmodule, endgenerate, etc.).

Note that typing the entire end-of-block keyword dedents as expected, so this isn't really an issue for the extremetly-short end keyword.