trixnz / lua-fmt

lua-fmt is pretty-printer for Lua code
MIT License
189 stars 25 forks source link

Option to use semicolons as delimiters in multi-line table literals #31

Open evaera opened 6 years ago

evaera commented 6 years ago

I use vscode-lua's format option, which uses this library. I'd like to have the option to use semicolons as delimiters at the end of every line within the literal instead of commas, but only for literals that encompass more than one line.

Current format behavior:

local t = {
  V1 = "Value 1",
  V2 = "Value 2",
  V3 = "Value 3"
}

Requested behavior: (Note the semicolon on the last line)

local t = {
  V1 = "Value 1";
  V2 = "Value 2";
  V3 = "Value 3";
}

Would really appreciate seeing this and a vscode-lua setting to accompany it. Thanks