This is intentional.  setSelection works no matter which order you give it start and end, but leaves thntednte cursor positioned at whichever argument is second.  I want the cursor at the start of the selection, especially when large functions are selected.