In Sublime, Paste and Indent (Shift-Cmd-V on Mac) does that fairly well. It's not based on an AST or anything like that, but it's rarely failed to do the right thing in my experience with these: Python, XML, HTML, CSS, SASS, PowerShell, YAML, Ruby
For me, it's a robust extension API, because then I can have any feature I want given enough time. Atom definitely has an edge there imo. Performance is also a plus (I have no complaints there with Atom). VSCode looks promising, though.
Well, I can do this in vim, so... yeah. If it can't do these things (more specifically be extended to do these things), it's a text editor I'd quickly put down for one which can.
There's a few other nice-to-haves, but those are the big ones.