Extracts the prompt text from the start of the document up to the cursor position.
The active text document.
The current cursor position.
The extracted prompt text including the programming language.
Extracts the prompt text from the start of the document up to the cursor position.