Automatically choose one language server to format code when using multiple language servers

Right your own formatting function that calls

local client = function_that_gets_the_client_I_want_filtering_by_name
client.request("textDocument/formatting", {} , nil, vim.api.nvim_get_current_buf())

and put that in on_attach bound to a key.

You can iterate over clients attached to the buffer with

for client in vim.lsp.get_active_clients() do
   print(client.name)  
end