Skip to content

shikiLanguageForDocument

const shikiLanguageForDocument: (options, languages) => string | null

The Shiki grammar a document uses: an explicit map entry, then its extension (.tsx, .jsx), then the default map. Hosts that choose grammars ahead of a document use the same answer.

Pick<HighlighterOperationContext, "documentId" | "languageId">

ShikiLanguageMap | undefined

string | null