insertCompletionText
fun insertCompletionText(state: EditorState, text: String, from: DocPos, to: DocPos): TransactionSpec
Insert completion text into the document (utility for custom apply functions).
The completion is applied at every selection range whose typed prefix matches the one being replaced at the primary range, mirroring upstream's multi-cursor apply. from/to describe the range replaced at the primary cursor; for each other range the same relative span is replaced only when the doc text there equals the primary span (i.e. the same token is being typed at that cursor). Ranges that don't match are left untouched. With a single selection this reduces to a plain insert.