armhil / easy-code-formatter-styles

Open source styles repository for Easy Code Formatter
https://github.com/armhil/easy-code-formatter-styles
56 stars 14 forks source link

Automatic Tab #10

Open ilGobbo00 opened 3 years ago

ilGobbo00 commented 3 years ago

Hi, first of all thaks for what you have done, I really like it. My request is: is it possible to add a kind of automated indentation when I format some text with your tool? It would be great.

Have a nice day, regards :)

armhil commented 3 years ago

Hey @ilGobbo00 - can you give me a bit more details on this? What do you mean automated indentation? Are you formatting something like a json snippet?

ilGobbo00 commented 3 years ago

Sure! I mean, when I format some text, for example, if I write

void main(){ int a=0 if(a==0){ print("HelloWorld") } }

and I use your toll, I'd like to expect

void main(){
         int a=0
         if(a==0){
              print("HelloWorld")
         }
}

I don't remember what language I was using when I found this "issue", but maybe some common syntaxes could be recognised as tab needed

armhil commented 3 years ago

Oh I see now. Can you help me understand how often you encounter this issue? The reason why I'm asking is, this requires introducing something like a smart-tabbing (detect if the code is tabbed already / or perhaps re-tab it ignoring the existing tabs). I'd also need to consider that not everyone uses the same amount of tabbing, so adding an option of how many spaces do you want your tabs to be would be also needed.

There are quite a few people using the tool now, I'd rather see if we get any upvotes to this.