Auto-formatters
(Sorry for hijacking issues in ElasticNotepad but I consider this the official forum for elastic tabstops)
I just noticed something. Let's say in the future the whole ecosystem transitioned to elastic tabstops. We will eventually reach a point where there will be debates about coding style and where elastic tabstops should be inserted or not. From this debates projects like Prettier were born to "stop all the on-going debates over styles". So we also have to integrate elastic tabstops into auto-formatters. And there can be two outcomes:
1. The auto-formatter is smart enough to find ALL places to insert elastic tabstops automatically
like member declarations:
public↔ int↔ myint↔ = 123
protected↔ float↔ myfloat↔ = 0.5
private↔ string↔ mystr↔ = "abc"
This raises the question, why "insert elastic tabstops manually" in the first place and not just add as a "view code aligned" option in the editor?
2. The auto-formatter is not smart enough
like similar function calls:
myint↔ x↔ = foo↔ ("Alfa"↔ , 1↔ , a, b, c)
myfloat↔ yyy↔ = foobar↔ ("Bravo"↔ , 123↔ , a, b, c)
mystr↔ zzzzz↔ = foobarbaz↔ ("Charlie"↔ , 12345↔ , a, b, c)
or similar one-liners:
myarr↔ .map(a => a + 1)
anotherArray↔ .map(a => a + 1)
Then the team has to decide if any manually inserted tabstops should be automatically removed (to avoid style debates and edit wars) or ignored (at which point elastic tabstops are a design decision, like variable naming, function signatures, blank lines etc.).
My point is shouldn't it be possible to align a lot of code automatically already? And we should focus more on
- which language features can be automatically aligned
- how we want to style it in auto-formatters
- try to find "less disruptive" mitigations for the rest (if one can consider inserting tabs inline as disruptive)
...to make the transition more smoothly.