Skip to content

LanguageMapProtocol.insertBefore method

LanguageMapProtocol › insertBefore

Unofficial

Inserts tokens before an existing token in a grammar.

Signature:

insertBefore(inside: string, before: string, insert: Record<string, GrammarValue>, root?: LanguageMap | undefined): Grammar

Parameters:

Parameter Type Description
inside string The language identifier.
before string The token name to insert before.
insert Record<string, GrammarValue> The tokens to insert.
root? LanguageMap | undefined Optional root language map.

Returns: GrammarThe modified grammar.