x4js - v2.2.49
    Preparing search index...

    A model.

    interface ITextModel {
        id: string;
        onDidChangeAttached: IEvent<void>;
        onDidChangeDecorations: IEvent<IModelDecorationsChangedEvent>;
        onDidChangeLanguage: IEvent<IModelLanguageChangedEvent>;
        onDidChangeLanguageConfiguration: IEvent<
            IModelLanguageConfigurationChangedEvent,
        >;
        onDidChangeOptions: IEvent<IModelOptionsChangedEvent>;
        onWillDispose: IEvent<void>;
        uri: Uri;
        applyEdits(operations: readonly IIdentifiedSingleEditOperation[]): void;
        applyEdits(
            operations: readonly IIdentifiedSingleEditOperation[],
            computeUndoEdits: false,
        ): void;
        applyEdits(
            operations: readonly IIdentifiedSingleEditOperation[],
            computeUndoEdits: true,
        ): IValidEditOperation[];
        canRedo(): boolean;
        canUndo(): boolean;
        createSnapshot(preserveBOM?: boolean): ITextSnapshot;
        deltaDecorations(
            oldDecorations: string[],
            newDecorations: IModelDeltaDecoration[],
            ownerId?: number,
        ): string[];
        detectIndentation(
            defaultInsertSpaces: boolean,
            defaultTabSize: number,
        ): void;
        dispose(): void;
        findMatches(
            searchString: string,
            searchOnlyEditableRange: boolean,
            isRegex: boolean,
            matchCase: boolean,
            wordSeparators: string,
            captureMatches: boolean,
            limitResultCount?: number,
        ): FindMatch[];
        findMatches(
            searchString: string,
            searchScope: IRange | IRange[],
            isRegex: boolean,
            matchCase: boolean,
            wordSeparators: string,
            captureMatches: boolean,
            limitResultCount?: number,
        ): FindMatch[];
        findNextMatch(
            searchString: string,
            searchStart: IPosition,
            isRegex: boolean,
            matchCase: boolean,
            wordSeparators: string,
            captureMatches: boolean,
        ): FindMatch;
        findPreviousMatch(
            searchString: string,
            searchStart: IPosition,
            isRegex: boolean,
            matchCase: boolean,
            wordSeparators: string,
            captureMatches: boolean,
        ): FindMatch;
        getAllDecorations(
            ownerId?: number,
            filterOutValidation?: boolean,
            filterFontDecorations?: boolean,
        ): IModelDecoration[];
        getAllMarginDecorations(ownerId?: number): IModelDecoration[];
        getAlternativeVersionId(): number;
        getCharacterCountInRange(range: IRange, eol?: EndOfLinePreference): number;
        getCustomLineHeightsDecorations(ownerId?: number): IModelDecoration[];
        getDecorationOptions(id: string): IModelDecorationOptions;
        getDecorationRange(id: string): Range;
        getDecorationsInRange(
            range: IRange,
            ownerId?: number,
            filterOutValidation?: boolean,
            filterFontDecorations?: boolean,
            onlyMinimapDecorations?: boolean,
            onlyMarginDecorations?: boolean,
        ): IModelDecoration[];
        getEndOfLineSequence(): EndOfLineSequence;
        getEOL(): string;
        getFullModelRange(): Range;
        getInjectedTextDecorations(ownerId?: number): IModelDecoration[];
        getLanguageId(): string;
        getLineContent(lineNumber: number): string;
        getLineCount(): number;
        getLineDecorations(
            lineNumber: number,
            ownerId?: number,
            filterOutValidation?: boolean,
            filterFontDecorations?: boolean,
        ): IModelDecoration[];
        getLineFirstNonWhitespaceColumn(lineNumber: number): number;
        getLineLastNonWhitespaceColumn(lineNumber: number): number;
        getLineLength(lineNumber: number): number;
        getLineMaxColumn(lineNumber: number): number;
        getLineMinColumn(lineNumber: number): number;
        getLinesContent(): string[];
        getLinesDecorations(
            startLineNumber: number,
            endLineNumber: number,
            ownerId?: number,
            filterOutValidation?: boolean,
            filterFontDecorations?: boolean,
        ): IModelDecoration[];
        getOffsetAt(position: IPosition): number;
        getOptions(): TextModelResolvedOptions;
        getOverviewRulerDecorations(
            ownerId?: number,
            filterOutValidation?: boolean,
            filterFontDecorations?: boolean,
        ): IModelDecoration[];
        getPositionAt(offset: number): Position;
        getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
        getValueInRange(range: IRange, eol?: EndOfLinePreference): string;
        getValueLength(eol?: EndOfLinePreference, preserveBOM?: boolean): number;
        getValueLengthInRange(range: IRange, eol?: EndOfLinePreference): number;
        getVersionId(): number;
        getWordAtPosition(position: IPosition): IWordAtPosition;
        getWordUntilPosition(position: IPosition): IWordAtPosition;
        isAttachedToEditor(): boolean;
        isDisposed(): boolean;
        isValidRange(range: IRange): boolean;
        modifyPosition(position: IPosition, offset: number): Position;
        normalizeIndentation(str: string): string;
        onDidChangeContent(
            listener: (e: IModelContentChangedEvent) => void,
        ): IDisposable;
        popStackElement(): void;
        pushEditOperations(
            beforeCursorState: Selection[],
            editOperations: IIdentifiedSingleEditOperation[],
            cursorStateComputer: ICursorStateComputer,
        ): Selection[];
        pushEOL(eol: EndOfLineSequence): void;
        pushStackElement(): void;
        redo(): void | Promise<void>;
        setEOL(eol: EndOfLineSequence): void;
        setValue(newValue: string | ITextSnapshot): void;
        undo(): void | Promise<void>;
        updateOptions(newOpts: ITextModelUpdateOptions): void;
        validatePosition(position: IPosition): Position;
        validateRange(range: IRange): Range;
    }
    Index
    id: string

    A unique identifier associated with this model.

    uri: Uri

    Gets the resource associated with this editor model.

    • Perform a minimum amount of operations, in order to transform the decorations identified by oldDecorations to the decorations described by newDecorations and returns the new identifiers associated with the resulting decorations.

      Parameters

      • oldDecorations: string[]

        Array containing previous decorations identifiers.

      • newDecorations: IModelDeltaDecoration[]

        Array describing what decorations should result after the call.

      • OptionalownerId: number

        Identifies the editor id in which these decorations should appear. If no ownerId is provided, the decorations will appear in all editors that attach this model.

      Returns string[]

      An array containing the new decorations identifiers.

    • Detect the indentation options for this model from its content.

      Parameters

      • defaultInsertSpaces: boolean
      • defaultTabSize: number

      Returns void

    • Search the model.

      Parameters

      • searchString: string

        The string used to search. If it is a regular expression, set isRegex to true.

      • searchOnlyEditableRange: boolean

        Limit the searching to only search inside the editable range of the model.

      • isRegex: boolean

        Used to indicate that searchString is a regular expression.

      • matchCase: boolean

        Force the matching to match lower/upper case exactly.

      • wordSeparators: string

        Force the matching to match entire words only. Pass null otherwise.

      • captureMatches: boolean

        The result will contain the captured groups.

      • OptionallimitResultCount: number

        Limit the number of results

      Returns FindMatch[]

      The ranges where the matches are. It is empty if not matches have been found.

    • Search the model.

      Parameters

      • searchString: string

        The string used to search. If it is a regular expression, set isRegex to true.

      • searchScope: IRange | IRange[]

        Limit the searching to only search inside these ranges.

      • isRegex: boolean

        Used to indicate that searchString is a regular expression.

      • matchCase: boolean

        Force the matching to match lower/upper case exactly.

      • wordSeparators: string

        Force the matching to match entire words only. Pass null otherwise.

      • captureMatches: boolean

        The result will contain the captured groups.

      • OptionallimitResultCount: number

        Limit the number of results

      Returns FindMatch[]

      The ranges where the matches are. It is empty if no matches have been found.

    • Search the model for the next match. Loops to the beginning of the model if needed.

      Parameters

      • searchString: string

        The string used to search. If it is a regular expression, set isRegex to true.

      • searchStart: IPosition

        Start the searching at the specified position.

      • isRegex: boolean

        Used to indicate that searchString is a regular expression.

      • matchCase: boolean

        Force the matching to match lower/upper case exactly.

      • wordSeparators: string

        Force the matching to match entire words only. Pass null otherwise.

      • captureMatches: boolean

        The result will contain the captured groups.

      Returns FindMatch

      The range where the next match is. It is null if no next match has been found.

    • Search the model for the previous match. Loops to the end of the model if needed.

      Parameters

      • searchString: string

        The string used to search. If it is a regular expression, set isRegex to true.

      • searchStart: IPosition

        Start the searching at the specified position.

      • isRegex: boolean

        Used to indicate that searchString is a regular expression.

      • matchCase: boolean

        Force the matching to match lower/upper case exactly.

      • wordSeparators: string

        Force the matching to match entire words only. Pass null otherwise.

      • captureMatches: boolean

        The result will contain the captured groups.

      Returns FindMatch

      The range where the previous match is. It is null if no previous match has been found.

    • Gets all the decorations as an array.

      Parameters

      • OptionalownerId: number

        If set, it will ignore decorations belonging to other owners.

      • OptionalfilterOutValidation: boolean

        If set, it will ignore decorations specific to validation (i.e. warnings, errors).

      • OptionalfilterFontDecorations: boolean

        If set, it will ignore font decorations.

      Returns IModelDecoration[]

    • Get the alternative version id of the model. This alternative version id is not always incremented, it will return the same values in the case of undo-redo.

      Returns number

    • Gets all the decorations in a range as an array. Only startLineNumber and endLineNumber from range are used for filtering. So for now it returns all the decorations on the same line as range.

      Parameters

      • range: IRange

        The range to search in

      • OptionalownerId: number

        If set, it will ignore decorations belonging to other owners.

      • OptionalfilterOutValidation: boolean

        If set, it will ignore decorations specific to validation (i.e. warnings, errors).

      • OptionalfilterFontDecorations: boolean

        If set, it will ignore font decorations.

      • OptionalonlyMinimapDecorations: boolean

        If set, it will return only decorations that render in the minimap.

      • OptionalonlyMarginDecorations: boolean

        If set, it will return only decorations that render in the glyph margin.

      Returns IModelDecoration[]

      An array with the decorations

    • Gets all the decorations for the line lineNumber as an array.

      Parameters

      • lineNumber: number

        The line number

      • OptionalownerId: number

        If set, it will ignore decorations belonging to other owners.

      • OptionalfilterOutValidation: boolean

        If set, it will ignore decorations specific to validation (i.e. warnings, errors).

      • OptionalfilterFontDecorations: boolean

        If set, it will ignore font decorations.

      Returns IModelDecoration[]

      An array with the decorations

    • Returns the column before the first non whitespace character for line at lineNumber. Returns 0 if line is empty or contains only whitespace.

      Parameters

      • lineNumber: number

      Returns number

    • Returns the column after the last non whitespace character for line at lineNumber. Returns 0 if line is empty or contains only whitespace.

      Parameters

      • lineNumber: number

      Returns number

    • Gets all the decorations for the lines between startLineNumber and endLineNumber as an array.

      Parameters

      • startLineNumber: number

        The start line number

      • endLineNumber: number

        The end line number

      • OptionalownerId: number

        If set, it will ignore decorations belonging to other owners.

      • OptionalfilterOutValidation: boolean

        If set, it will ignore decorations specific to validation (i.e. warnings, errors).

      • OptionalfilterFontDecorations: boolean

        If set, it will ignore font decorations.

      Returns IModelDecoration[]

      An array with the decorations

    • Gets all the decorations that should be rendered in the overview ruler as an array.

      Parameters

      • OptionalownerId: number

        If set, it will ignore decorations belonging to other owners.

      • OptionalfilterOutValidation: boolean

        If set, it will ignore decorations specific to validation (i.e. warnings, errors).

      • OptionalfilterFontDecorations: boolean

        If set, it will ignore font decorations.

      Returns IModelDecoration[]

    • Get the current version id of the model. Anytime a change happens to the model (even undo/redo), the version id is incremented.

      Returns number

    • Advances the given position by the given offset (negative offsets are also accepted) and returns it as a new valid position.

      If the offset and position are such that their combination goes beyond the beginning or end of the model, throws an exception.

      If the offset is such that the new position would be in the middle of a multi-byte line terminator, throws an exception.

      Parameters

      Returns Position

    • Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).

      Parameters

      • str: string

      Returns string

    • Redo edit operations until the next undo/redo point. The inverse edit operations will be pushed on the undo stack.

      Returns void | Promise<void>

    • Undo edit operations until the previous undo/redo point. The inverse edit operations will be pushed on the redo stack.

      Returns void | Promise<void>

    onDidChangeAttached: IEvent<void>

    An event emitted when the model has been attached to the first editor or detached from the last editor.

    onDidChangeDecorations: IEvent<IModelDecorationsChangedEvent>

    An event emitted when decorations of the model have changed.

    onDidChangeLanguage: IEvent<IModelLanguageChangedEvent>

    An event emitted when the language associated with the model has changed.

    onDidChangeLanguageConfiguration: IEvent<
        IModelLanguageConfigurationChangedEvent,
    >

    An event emitted when the language configuration associated with the model has changed.

    onDidChangeOptions: IEvent<IModelOptionsChangedEvent>

    An event emitted when the model options have changed.

    onWillDispose: IEvent<void>

    An event emitted right before disposing the model.