It's impossible to switch the element direction in the 2017 wikitext editor.
Usually the initial direction of a plain-text textarea is inherited or set by the dir attribute. Browsers allow users to switch this direction by a keyboard shortcut (Ctrl-Shift-X/Cmd-Shift-X in Firefox, Ctrl-Shift/Cmd-Shift in other browsers) or by a command in a context menu (something like right-click -> Switch text direction).
None of the above works in the 2017 wikitext editor, which is technically understandable, because it's not really a textarea, but a contenteditable with a monospaced font. From the user perspective, however, this is a major problem, because when editing wiki syntax, switching the direction is often needed for handling URLs, pieces of CSS, filenames, etc.
If I inspect the (more or less) root element of the editor, <div class="ve-ce-branchNode ve-ce-documentNode" contenteditable="true" dir="rtl">, and I change the value of dir to "ltr", then it does what is needed. But this is accessible only to very advanced users who can use the browsers' developer tools. If making Ctrl-Shift(-X) and the context menu direction switching is not possible, then having a toolbar button that switches the direction would be enough.
@eranroz can probably make a gadget for this in ten minutes ;) But this should be available to all users (at least in RTL wikis) and not as a gadget.