Extracts the prompt text from the start of the document up to the cursor position.

  • Parameters

    • document: TextDocument

      The active text document.

    • position: Position

      The current cursor position.

    Returns string

    The extracted prompt text including the programming language.