3 ms·
The way it should work is that when loading a file, your editor formats the code the way you feel most comfortable working with it. This doesn't seem p
by al2o3cr 4y ago
The way it should work is that when loading a file,
your editor formats the code the way you feel most
comfortable working with it.
This doesn't seem practical if you have to reconcile external sources of information with the file - for instance, if you're looking at line numbers in a stack trace from production.
- wizofaus 4y agoIn principle even that could be solved with better tools (source map files and the like), but I agree, until such tools are universally adopted we're probably stuck with having to work with and store the same formatted code. As it is though correlating line numbers from production logs with current source is often an inexact science due to optimisations or difficulties retrieving the exact same version of the code that was used to produce the build (either because you can't find out the exact build number, or because the correlation between commit hash and build number got lost somewhere, etc.).
- kleiba 4y agoThat particular case (line numbers) is solvable quite easily in theory. But like I mentioned before, there are other problems - if the automatic reformatting includes more than just fiddling with whitespace.