tlaplus / vscode-tlaplus

TLA+ language support for Visual Studio Code
MIT License
340 stars 29 forks source link

Change default indentation to 2 spaces #87

Closed alygin closed 4 years ago

alygin commented 4 years ago

At the moment, the default setting for the code formatter is 4 spaces. I'd like to change it to 2 spaces for TLA+, PlusCal and .cfg-files, but not sure yet.

4 spaces:

2 spaces:

Any input on the issue is welcomed.

suhr commented 4 years ago

Four spaces identation is more visible in the generated pdf. Also, it aligns nicely with LET:

ReplaceNode(table, id, new) ==
    LET bs  == table.buckets
        k   == CHOOSE k \in 0..Len(bs): id \in {n.id : n \in bs[k]}
        old == CHOOSE old \in bs[k]: old.id = id
    IN
        [table EXCEPT !.buckets[k] = (bs[k] \ {old}) \cup {new}]
alygin commented 4 years ago

One more opinion: https://github.com/alygin/vscode-tlaplus/issues/67#issuecomment-529672996

alygin commented 4 years ago

BTW, here's an instruction on how to change the formatting style: Formatting Preferences.

alygin commented 4 years ago

It looks like having 4 spaces by default + documentation on how to change preferences is safe choice.