atom-archive / text-document

MIT License
57 stars 10 forks source link

Code Formatting Transformations Hooks #13

Closed lee-dohm closed 6 years ago

lee-dohm commented 9 years ago

One idea that I've had for "the perfect editor" (which is now Atom in my mind) is the ability to decouple storage format from display format. Whether for just making code easier to read on screens of differing sizes (or for people with differing visual acuity) or finally getting us to the point where these decades-old debates over tabs vs. spaces and line length finally go away, I think this feature could make Atom really amazing:

https://discuss.atom.io/t/decoupling-display-format-from-storage-format/7245

If I'm understanding the approach correctly, I think this library is where these kinds of hooks would fit and I wanted to raise this idea while this subsystem is being designed/refactored.

thomasjo commented 9 years ago

While I really like the idea in theory, in practise it basically forces everyone to use Atom, lest they suffer ill-formatted code. Any thoughts on this?

dbkaplun commented 9 years ago

Also, please bear in mind that Atom isn't the only consumer of atom/text-buffer and probably won't be the only consumer of the new atom/text-document when it is ready.

lee-dohm commented 9 years ago

@thomasjo the idea wasn't to have the storage format be "utter crap" and the display format to be "amazingly pristine code". The idea is that different people have different preferences. The team might like spaces surrounding equals signs in default arguments and I might like the compressed look. This way I can read the code in the way that I prefer, but it will be formatted according to the team's standards when written to disk.

@secrettriangle I don't believe hooks being in place for additional tools to be plugged in is any risk to third-party use of the text-document library. I suspect that this kind of thing would logically fit in to the already-existing TransformLayer, so long as it is performant enough.

lee-dohm commented 6 years ago

All repositories in the atom-archive organization are unmaintained and deprecated. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!