import { Neovim } from "neovim" ; export class HighlightRepository { constructor ( protected readonly vim ) { } public async link ( from , to ) { await this . vim . command ( `highlight default link ${ from } ${ to }` ) ; } public async match ( name , pattern , contains = [ ] ) { if ( contains . length === 0 ) { await this . vim . command ( `syntax match ${ name } /${ pattern }/` ) ; return ; } const joinedContains = contains . join ( "," ) ; await this . vim . command ( `syntax match ${ name } /${ pattern }/ contains=${ joinedContains }` ) ; } }