lmcarreiro / smart-column-indenter

A smart source code indenter that indent the code into columns
MIT License
18 stars 4 forks source link

Ignore comments and empty lines #2

Open zingmane opened 6 years ago

zingmane commented 6 years ago

Hi. I like your VS Code extension very much.

This is an Idea/improvement. It would be great if commented lines and lines with only whitespace characters would be ignored by the indention.

For example such code:

const foo = [
  // VIPs
  {name: "Hanspeter-Christian", age: 18, hidden: true},

  // normal
  {name: "Sabine", age: 36, hidden: true},
  {name: "Hans", age: 12, hidden: true}
]

should result in:

const foo = [
  // VIPs
  {name: "Hanspeter-Christian", age: 18, hidden: true},

  // normal
  {name: "Sabine",              age: 36, hidden: true},
  {name: "Hans"  ,              age: 12, hidden: true}
]
lmcarreiro commented 6 years ago

Sorry for not giving a reply earlier. I liked your idea, but unfortunately, I do not have time to spend in this project right now.

Feel free to make a pull request if you want. I would gladly merge it.

jonlepage commented 6 years ago

+1 please https://github.com/lmcarreiro/vscode-smart-column-indenter/issues/3