Type alias Language

Language: {
    autoIndent?: [((selection, value, editor) => boolean)?, ((selection, value, editor) => boolean)?];
    comments?: CommentTokens;
    autoCloseTags?(selection, value, editor) => undefined | string;
    getComments?(editor, position, value) => CommentTokens;
}

Type declaration

  • Optional autoIndent?: [((selection, value, editor) => boolean)?, ((selection, value, editor) => boolean)?]

    Callbacks controlling the automatic indentation on new lines. First function should return whether indentation should be increased. Second function should return whether to add an extra line after the cursor.

  • Optional comments?: CommentTokens

    Comment tokens used by the language.

  • autoCloseTags?:function
    • Function called when the user types >. Intended to auto close tags.

      Parameters

      Returns undefined | string

      string which will get inserted behind the cursor.

  • getComments?:function
    • Method called when a user executes a comment toggling command.

      Parameters

      • editor: PrismEditor

        The editor the user is interacting with.

      • position: number

        Where in the code the comment is being toggled.

      • value: string

        Current code in the editor.

      Returns CommentTokens

      The comment tokens that should be used for this command.

Generated using TypeDoc