vim-polyglot/syntax/jasmine.vim

89 lines
2.5 KiB
VimL
Raw Normal View History

if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jasmine') != -1
finish
endif
2014-04-14 19:12:18 -04:00
" Syntax highlighting for jasmine specs (used by http://github.com/thomd/vim-jasmine).
" if b:current_syntax is defined, some other syntax files, earlier in 'runtimepath' was already loaded
if exists("b:current_syntax")
finish
endif
" match the case of syntax elements
syntax case match
" keywords
2016-12-20 14:57:20 -05:00
syntax keyword jasmineSuite describe it beforeEach afterEach beforeAll afterAll
2016-07-19 04:09:54 -04:00
syntax keyword jasmine jasmine
" special
syntax match jasmineSpecial /\.Ajax/
syntax match jasmineSpecial /\.addMatcher/
syntax match jasmineSpecial /\.getEnv/
syntax match jasmineSpecial /\.loadConfigFile/
syntax match jasmineSpecial /\.onComplete/
syntax match jasmineSpecial /\.QueryString/
syntax match jasmineSpecial /\.HtmlSpecFilter/
syntax match jasmineSpecial /\.addCustomEqualityTester/
syntax match jasmineSpecial /\.configureDefaultReporter/
syntax match jasmineSpecial /\.execute/
" clock
syntax match jasmineClock /\.Timer/
syntax match jasmineClock /\.clock/
syntax match jasmineClock /\.tick/
syntax match jasmineClock /\.mockDate/
" disabled
2014-04-14 19:12:18 -04:00
syntax keyword jasmineDisabled xdescribe xit
2016-07-19 04:09:54 -04:00
2016-12-20 14:57:20 -05:00
" focused
syntax keyword jasmineFocused fdescribe fit
2016-07-19 04:09:54 -04:00
" expectation
2014-04-14 19:12:18 -04:00
syntax keyword jasmineExpectation expect
2016-07-19 04:09:54 -04:00
" not
2014-04-14 19:12:18 -04:00
syntax region jasmineNot start=/not/ end=/\.to/me=s-1
2016-07-19 04:09:54 -04:00
" matchers
2014-04-14 19:12:18 -04:00
syntax match jasmineMatcher /\.to\h\+/
2016-07-19 04:09:54 -04:00
syntax match jasmineMatcher /\.objectContaining/
syntax match jasmineMatcher /\.arrayContaining/
syntax match jasmineMatcher /\.anything/
syntax match jasmineMatcher /\.any/
2014-04-14 19:12:18 -04:00
syntax keyword jasmineSpy spyOn
2016-07-19 04:09:54 -04:00
syntax match jasmineSpy /\.createSpy/
2014-04-14 19:12:18 -04:00
syntax match jasmineSpyMatcher /and\h\+/
" jasmine is a subset of the javascript language, thus we need to activate
" javascript syntax highlighting and add new jasmin group names to the
" JavaScriptAll cluster which is defined there
runtime! syntax/javascript.vim
2016-07-19 04:09:54 -04:00
syntax cluster JavaScriptAll add=
\ jasmine,
\ jasmineClock,
\ jasmineDisabled,
2016-12-20 14:57:20 -05:00
\ jasmineFocused,
2016-07-19 04:09:54 -04:00
\ jasmineExpectation,
\ jasmineMatcher,
\ jasmineNot,
\ jasmineSpecial,
\ jasmineSpy,
\ jasmineSpyMatcher,
\ jasmineSuite
2014-04-14 19:12:18 -04:00
let b:current_syntax = "jasmine"
2016-07-19 04:09:54 -04:00
hi def link jasmine Special
hi def link jasmineClock Special
2014-04-14 19:12:18 -04:00
hi def link jasmineDisabled Error
2016-12-20 14:57:20 -05:00
hi def link jasmineFocused Special
2014-04-14 19:12:18 -04:00
hi def link jasmineExpectation Statement
hi def link jasmineMatcher Statement
2016-07-19 04:09:54 -04:00
hi def link jasmineNot Special
hi def link jasmineSpecial Special
2014-04-14 19:12:18 -04:00
hi def link jasmineSpy Special
hi def link jasmineSpyMatcher Statement
2016-07-19 04:09:54 -04:00
hi def link jasmineSuite Statement