pgAdmin 4 uses CodeMirror to write/show SQL queries. It is not possible to plug an external formatter at the moment.
Can you please create a feature request so we will check the feasibility?
I can't imagine it would be that hard - the formatter is a 3rd party Python library anyway; we just feed the current contents of CodeMirror to it, and then replace it with the text that comes back.
Having pluggable formatters does seem like a nice idea. All we'd do is pass the text to an external process and then grab the results (presumably through stdin/out), through pretty much the same mechanism (just replacing the existing Python call to the formatter).