TextDocument class

Represents a text document, such as a source file. Text documents have {@link TextLinelines} and knowledge about an underlying resource like a file.

Available extensions
Annotations
  • @JS()
  • @staticInterop
  • @anonymous

Constructors

TextDocument.new({Uri? uri, String? fileName, bool? isUntitled, String? languageId, num? version, bool? isDirty, bool? isClosed, EndOfLine? eol, num? lineCount, Future save()?, num offsetAt(Position)?, Position positionAt(num)?, String getText([Range?])?, Range? getWordRangeAtPosition(Position, [RegExp?])?, Range validateRange(Range)?, Position validatePosition(Position)?})
factory

Properties

eol EndOfLine

Available on TextDocument, provided by the TextDocument$Typings extension

The {@link EndOfLineend of line} sequence that is predominately used in this document.
no setter
fileName String

Available on TextDocument, provided by the TextDocument$Typings extension

The file system path of the associated resource. Shorthand notation for {@link TextDocument.uriTextDocument.uri.fsPath}. Independent of the uri scheme.
no setter
getText String Function([Range?])

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
getWordRangeAtPosition Range? Function(Position, [RegExp?])

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isClosed bool

Available on TextDocument, provided by the TextDocument$Typings extension

true if the document has been closed. A closed document isn't synchronized anymore and won't be re-used when the same resource is opened again.
no setter
isDirty bool

Available on TextDocument, provided by the TextDocument$Typings extension

true if there are unpersisted changes.
no setter
isUntitled bool

Available on TextDocument, provided by the TextDocument$Typings extension

Is this document representing an untitled file which has never been saved yet. Note that this does not mean the document will be saved to disk, use {@linkcode Uri.scheme} to figure out where a document will be {@link FileSystemProvidersaved}, e.g. file, ftp etc.
no setter
languageId String

Available on TextDocument, provided by the TextDocument$Typings extension

The identifier of the language associated with this document.
no setter
lineAt → ({TextLine Function(num line) $1, TextLine Function(Position position) $2})

Available on TextDocument, provided by the TextDocument$Typings extension

Overload accessor: $1, $2
no setter
lineCount num

Available on TextDocument, provided by the TextDocument$Typings extension

The number of lines in this document.
no setter
offsetAt num Function(Position)

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
positionAt Position Function(num)

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
save Future Function()

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
uri Uri

Available on TextDocument, provided by the TextDocument$Typings extension

The associated uri for this document.
no setter
validatePosition Position Function(Position)

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
validateRange Range Function(Range)

Available on TextDocument, provided by the TextDocument$Typings extension

getter/setter pair
version num

Available on TextDocument, provided by the TextDocument$Typings extension

The version number of this document (it will strictly increase after each change, including undo/redo).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited