mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
27 lines
848 B
VimL
27 lines
848 B
VimL
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript-sql') == -1
|
|
|
|
" Vim plugin
|
|
" Language: JavaScript
|
|
" Maintainer: Ian Langworth <ian@langworth.com>
|
|
|
|
if exists('b:current_syntax')
|
|
let s:current_syntax = b:current_syntax
|
|
unlet b:current_syntax
|
|
endif
|
|
|
|
exec 'syntax include @SQLSyntax syntax/' . g:javascript_sql_dialect . '.vim'
|
|
if exists('s:current_syntax')
|
|
let b:current_syntax = s:current_syntax
|
|
endif
|
|
|
|
syntax region sqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@SQLSyntax,jsTemplateExpression,jsSpecial extend
|
|
exec 'syntax match sqlTaggedTemplate +\%(SQL\)\%(`\)\@=+ nextgroup=sqlTemplateString'
|
|
|
|
hi def link sqlTemplateString jsTemplateString
|
|
hi def link sqlTaggedTemplate jsTaggedTemplate
|
|
|
|
syn cluster jsExpression add=sqlTaggedTemplate
|
|
syn cluster sqlTaggedTemplate add=sqlTemplateString
|
|
|
|
endif
|