How to auto indent the tsql code?

tsql code’s match is ‘begin’ match ‘end’, how to custom an indent method?

I’m not sure what tsql is, but I guess it’s an SQL dialect. Indentation support in the SQL mode is rather rudimentary, and doesn’t know about begin/end blocks.