There is the Edit SQL Text button on the toolbar.
After click this button, the document Text view will be opened, and you will be able to edit the SQL text.
Also you can clik Edit Text or Design Query in the context menu of the root node in the Data Source window.