A model that can track markers.

Hierarchy

Index

Methods

findMatches

  • findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]
  • findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[]
  • 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.

    • Optional limitResultCount: 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

      Limit the searching to only search inside this range.

    • 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.

    • Optional limitResultCount: number

      Limit the number of results

    Returns FindMatch[]

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

findNextMatch

  • findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch
  • 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.

findPreviousMatch

  • findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch
  • 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.

getAlternativeVersionId

  • getAlternativeVersionId(): number
  • 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

getEOL

  • getEOL(): string
  • Get the end of line sequence predominantly used in the text buffer.

    Returns string

    EOL char sequence (e.g.: '\n' or '\r\n').

getFullModelRange

  • getFullModelRange(): Range

getLineContent

  • getLineContent(lineNumber: number): string

getLineCount

  • getLineCount(): number

getLineFirstNonWhitespaceColumn

  • getLineFirstNonWhitespaceColumn(lineNumber: number): number

getLineLastNonWhitespaceColumn

  • getLineLastNonWhitespaceColumn(lineNumber: number): number

getLineMaxColumn

  • getLineMaxColumn(lineNumber: number): number

getLineMinColumn

  • getLineMinColumn(lineNumber: number): number

getLinesContent

  • getLinesContent(): string[]

getOffsetAt

getOptions

getPositionAt

  • getPositionAt(offset: number): Position

getValue

  • getValue(eol?: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF, preserveBOM?: boolean): string
  • Get the text stored in this model.

    Parameters

    • Optional eol: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF

      The end of line character preference. Defaults to EndOfLinePreference.TextDefined.

    • Optional preserveBOM: boolean

    Returns string

    The text.

getValueInRange

  • getValueInRange(range: IRange, eol?: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF): string
  • Get the text in a certain range.

    Parameters

    • range: IRange

      The range describing what text to get.

    • Optional eol: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF

      The end of line character preference. This will only be used for multiline ranges. Defaults to EndOfLinePreference.TextDefined.

    Returns string

    The text.

getValueLength

  • getValueLength(eol?: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF, preserveBOM?: boolean): number
  • Get the length of the text stored in this model.

    Parameters

    • Optional eol: EndOfLinePreference.TextDefined | EndOfLinePreference.LF | EndOfLinePreference.CRLF
    • Optional preserveBOM: boolean

    Returns number

getValueLengthInRange

  • getValueLengthInRange(range: IRange): number

getVersionId

  • getVersionId(): number
  • 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

isDisposed

  • isDisposed(): boolean

modifyPosition

  • Advances the given position by the given offest (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 ofsset is such that the new position would be in the middle of a multi-byte line terminator, throws an exception.

    Parameters

    Returns Position

setEOL

  • setEOL(eol: EndOfLineSequence.LF | EndOfLineSequence.CRLF): void
  • Change the end of line sequence used in the text buffer.

    Parameters

    • eol: EndOfLineSequence.LF | EndOfLineSequence.CRLF

    Returns void

setValue

  • setValue(newValue: string): void

validatePosition

validateRange