Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MonacoEditorModel

Hierarchy

  • MonacoEditorModel

Implements

  • IResolvedTextEditorModel
  • TextEditorDocument

Index

Constructors

Properties

_dirty: boolean = false
_languageId: undefined | string
_valid: boolean = false

Use valid to access it. Use setValid to mutate it.

autoSave: "off" | "afterDelay" | "onFocusChange" | "onWindowChange" = 'afterDelay'
autoSaveDelay: number = 500
bufferSavedVersionId: number
contentChanges: TextDocumentContentChangeEvent[] = []
contentEncoding: undefined | string
editorPreferences?: EditorPreferences
ignoreContentChanges: boolean = false
ignoreDirtyEdits: boolean = false
lineNumbersMinChars: number = 3
logger?: ILogger
model: ITextModel
onDidChangeContent: Event<MonacoModelContentChangedEvent> = ...
onDidChangeContentEmitter: Emitter<MonacoModelContentChangedEvent> = ...
onDidChangeEncoding: Event<string> = ...
onDidChangeEncodingEmitter: Emitter<string> = ...
onDidChangeValid: Event<void> = ...
onDidChangeValidEmitter: Emitter<void> = ...
onDidSaveModel: Event<ITextModel> = ...
onDidSaveModelEmitter: Emitter<ITextModel> = ...
onDirtyChangedEmitter: Emitter<void> = ...
onWillSaveLoopTimeOut: 1500 = 1500
onWillSaveModel: Event<WillSaveMonacoModelEvent> = ...
onWillSaveModelEmitter: Emitter<WillSaveMonacoModelEvent> = ...
pendingOperation: Promise<void> = ...
preferredEncoding: undefined | string
resolveModel: Promise<void>
resource: Resource
resourceVersion: undefined | ResourceVersion
saveCancellationTokenSource: CancellationTokenSource = ...
suppressOpenEditorWhenDirty: boolean = false
syncCancellationTokenSource: CancellationTokenSource = ...
toDispose: DisposableCollection = ...
toDisposeOnAutoSave: DisposableCollection = ...

Accessors

  • get dirty(): boolean
  • get languageId(): string
  • get lineCount(): number
  • get onDirtyChanged(): Event<void>
  • get onDispose(): IEvent<void>
  • get onWillDispose(): Event<void>
  • get readOnly(): boolean
  • get textEditorModel(): ITextModel & ITextModel
  • get uri(): string
  • get valid(): boolean
  • get version(): number

Methods

  • applySnapshot(snapshot: Snapshot): void
  • asTextDocumentContentChangeEvent(change: IModelContentChange): TextDocumentContentChangeEvent
  • cancelSave(): CancellationToken
  • cancelSync(): CancellationToken
  • createSnapshot(preserveBOM?: boolean): ITextSnapshot
  • dispose(): void
  • doAutoSave(): void
  • doSave(reason: TextDocumentSaveReason, token: CancellationToken, overwriteEncoding?: boolean, options?: SaveOptions): Promise<void>
  • doSync(token: CancellationToken): Promise<void>
  • findMatches(options: FindMatchesOptions): FindMatch[]
  • Find all matches in an editor for the given options.

    Parameters

    • options: FindMatchesOptions

      the options for finding matches.

    Returns FindMatch[]

    the list of matches.

  • fireDidChangeContent(event: IModelContentChangedEvent): void
  • fireDidSaveModel(): void
  • fireWillSaveModel(reason: TextDocumentSaveReason, token: CancellationToken, options?: SaveOptions): Promise<void>
  • getEncoding(): undefined | string
  • getLanguageId(): undefined | string
  • getLineContent(lineNumber: number): string
  • getLineMaxColumn(lineNumber: number): number
  • getText(range?: Range): string
  • initialize(value: string | ITextBufferFactory): void
  • isDisposed(): boolean
  • isReadonly(): boolean
  • isResolved(): boolean
  • markAsDirty(): void
  • offsetAt(position: Position): number
  • positionAt(offset: number): Position
  • pushContentChanges(contentChanges: TextDocumentContentChangeEvent[]): void
  • readContents(): Promise<undefined | string | ITextBufferFactory>
  • resolve(): Promise<void>
  • revert(options?: RevertOptions): Promise<void>
  • run(operation: (() => Promise<void>)): Promise<void>
  • save(options?: SaveOptions): Promise<void>
  • scheduleSave(reason: TextDocumentSaveReason, token?: CancellationToken, overwriteEncoding?: boolean, options?: SaveOptions): Promise<void>
  • setDirty(dirty: boolean): void
  • setEncoding(encoding: string, mode: EncodingMode): Promise<void>
  • setLanguageId(languageId: undefined | string): void
  • setPreferredEncoding(encoding: string): boolean
  • setValid(valid: boolean): void
  • sync(): Promise<void>
  • toValidPosition(position: Position): Position
  • toValidRange(range: Range): Range
  • trace(loggable: Loggable): void
  • updateContentEncoding(): void
  • updateSavedVersionId(): void