richjyoung / vscode-modern-vhdl

Modern VSCode VHDL Support
MIT License
30 stars 12 forks source link

Auto indent incorrectly indenting after type statement #23

Closed memchk closed 4 years ago

memchk commented 4 years ago

If a statement like type sample_buffer_t is array (0 to 7) of std_logic_vector(6 downto 0); or type state_t is (LOAD, FIND_COLLECT, FIND_XOR, ADJ, ADJ_PAUSE); is written, the indent is increased by one when it shouldn't be.

jacopobelli commented 4 years ago

Something similar happens during process definition. If i write a statement like

ProcessName: process(Clk)

If I write begin after newline, the indent is automatically decreased by one.

richjyoung commented 4 years ago

@memchk I have a fix for this I will push shortly

@jacopobelli This is much harder. The regex that defines the indent behaviour relies on the presence of certain keywords.I note you do not use is, which is why there is no initial indent, and subsequently begin ends up a tab position before the first line. I'm trying to find a pattern that removes reliance on keywords, but in the meantime feel free to contribute a pull request if you have an answer.

richjyoung commented 4 years ago

Closing this as the fix for the type statement has been released. @jacopobelli see https://github.com/richjyoung/vscode-modern-vhdl/issues/28