DocumentProvider

Interface representing a provider for managing documents and their contents. It allows retrieval of documents, manipulation of text, and extraction of content fragments.

Parameters

Path

The type representing the path or identifier for locating documents.

Document

The type representing the document being operated on.

Inheritors

Types

Link copied to clipboard

Represents a range within a document, defined by a start and end position.

Link copied to clipboard
interface Edit<Path, Document>

Represents an interface for performing edit operations on a document.

Link copied to clipboard
data class Position(val line: Int, val column: Int) : Comparable<DocumentProvider.Position>

Represents a position in a text document identified by a specific line and column. Used for precise referencing of specific locations within multi-line text content.

Functions

Link copied to clipboard
abstract suspend fun document(path: Path): Document?

Retrieves a document corresponding to the specified path.

Link copied to clipboard
abstract suspend fun text(document: Document): CharSequence

Retrieves the full text content of the given document as a character sequence.

Link copied to clipboard
open suspend fun textFragment(document: Document, range: DocumentProvider.DocumentRange): String

Extracts a specified fragment of text from a given document based on a defined range.