Visual Studio text editor is represented in ReSharper as an instance of
JetBrains.ReSharper.TextControl.ITextControl interface. This interface provides means to access caret, selection and scrolling positions, add various highlighters etc.
To obtain the text control your action have been invoked in, query data context for
DataConstants.TEXT_CONTROL data constant.
You may also open specific project file in text editor by using
EditorManager provides various API to work with opened editors: you can activate particulat text control, query for existing editor for a project file etc.
Samples and power toys