Skip to content

Instantly share code, notes, and snippets.

@TrevorS
Created March 12, 2014 14:38
Show Gist options
  • Save TrevorS/9508252 to your computer and use it in GitHub Desktop.
Save TrevorS/9508252 to your computer and use it in GitHub Desktop.
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
Sourced 2 times
Total time: 0.000071
Self time: 0.000071
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_autoloclist") || !exists("g:loaded_syntastic_plugin")
1 0.000002 finish
endif
1 0.000003 let g:loaded_syntastic_notifier_autoloclist = 1
1 0.000002 let g:SyntasticAutoloclistNotifier = {}
" Public methods {{{1
"
1 0.000003 function! g:SyntasticAutoloclistNotifier.New() " {{{2
let newObj = copy(self)
return newObj
endfunction " }}}2
1 0.000002 function! g:SyntasticAutoloclistNotifier.refresh(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: refresh')
call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
endfunction " }}}2
1 0.000002 function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: toggle')
if !a:loclist.isEmpty()
if syntastic#util#var('auto_loc_list') == 1
call a:loclist.show()
endif
else
if syntastic#util#var('auto_loc_list') > 0
"TODO: this will close the loc list window if one was opened by
"something other than syntastic
lclose
endif
endif
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/balloons.vim
Sourced 2 times
Total time: 0.000334
Self time: 0.000334
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_balloons") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000017 let g:loaded_syntastic_notifier_balloons = 1
1 0.000015 if !has('balloon_eval')
1 0.000011 let g:syntastic_enable_balloons = 0
1 0.000009 endif
1 0.000009 let g:SyntasticBalloonsNotifier = {}
" Public methods {{{1
1 0.000007 function! g:SyntasticBalloonsNotifier.New() " {{{2
let newObj = copy(self)
return newObj
endfunction " }}}2
1 0.000005 function! g:SyntasticBalloonsNotifier.enabled() " {{{2
return has('balloon_eval') && syntastic#util#var('enable_balloons')
endfunction " }}}2
" Update the error balloons
1 0.000003 function! g:SyntasticBalloonsNotifier.refresh(loclist) " {{{2
let b:syntastic_balloons = {}
if self.enabled() && !a:loclist.isEmpty()
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: refresh')
let buf = bufnr('')
let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
if !empty(issues)
for i in issues
if has_key(b:syntastic_balloons, i['lnum'])
let b:syntastic_balloons[i['lnum']] .= "\n" . i['text']
else
let b:syntastic_balloons[i['lnum']] = i['text']
endif
endfor
set beval bexpr=SyntasticBalloonsExprNotifier()
endif
endif
endfunction " }}}2
" Reset the error balloons
" @vimlint(EVL103, 1, a:loclist)
1 0.000002 function! g:SyntasticBalloonsNotifier.reset(loclist) " {{{2
if has('balloon_eval')
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
set nobeval
endif
endfunction " }}}2
" @vimlint(EVL103, 0, a:loclist)
" }}}1
" Private functions {{{1
1 0.000002 function! SyntasticBalloonsExprNotifier() " {{{2
if !exists('b:syntastic_balloons')
return ''
endif
return get(b:syntastic_balloons, v:beval_lnum, '')
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/checker.vim
Sourced 2 times
Total time: 0.000153
Self time: 0.000153
count total (s) self (s)
if exists("g:loaded_syntastic_checker") || !exists("g:loaded_syntastic_plugin")
1 0.000002 finish
endif
1 0.000003 let g:loaded_syntastic_checker = 1
1 0.000002 let g:SyntasticChecker = {}
" Public methods {{{1
1 0.000002 function! g:SyntasticChecker.New(args) " {{{2
let newObj = copy(self)
let newObj._filetype = a:args['filetype']
let newObj._name = a:args['name']
let newObj._exec = get(a:args, 'exec', newObj._name)
if has_key(a:args, 'redirect')
let [filetype, name] = split(a:args['redirect'], '/')
let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_'
else
let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
endif
let newObj._locListFunc = function(prefix . 'GetLocList')
if exists('*' . prefix . 'IsAvailable')
let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
else
let newObj._isAvailableFunc = function('SyntasticCheckerIsAvailableDefault')
endif
if exists('*' . prefix . 'GetHighlightRegex')
let newObj._highlightRegexFunc = function(prefix . 'GetHighlightRegex')
endif
return newObj
endfunction " }}}2
1 0.000002 function! g:SyntasticChecker.getFiletype() " {{{2
return self._filetype
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.getName() " {{{2
return self._name
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.getExec() " {{{2
if exists('g:syntastic_' . self._filetype . '_' . self._name . '_exec')
return expand(g:syntastic_{self._filetype}_{self._name}_exec)
endif
return self._exec
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.getExecEscaped() " {{{2
return syntastic#util#shescape(self.getExec())
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.getLocListRaw() " {{{2
let name = self._filetype . '/' . self._name
try
let list = self._locListFunc()
call syntastic#log#debug(g:SyntasticDebugTrace, 'getLocList: checker ' . name . ' returned ' . v:shell_error)
catch /\m\C^Syntastic: checker error$/
let list = []
call syntastic#log#error('checker ' . name . ' returned abnormal status ' . v:shell_error)
endtry
call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
call self._quietMessages(list)
return list
endfunction " }}}2
1 0.000002 function! g:SyntasticChecker.getLocList() " {{{2
return g:SyntasticLoclist.New(self.getLocListRaw())
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
let basename = self._filetype . '_' . self._name . '_'
let parts = []
call extend(parts, self._getOpt(a:opts, basename, 'exe', self.getExecEscaped()))
call extend(parts, self._getOpt(a:opts, basename, 'args', ''))
call extend(parts, self._getOpt(a:opts, basename, 'fname', syntastic#util#shexpand('%')))
call extend(parts, self._getOpt(a:opts, basename, 'post_args', ''))
call extend(parts, self._getOpt(a:opts, basename, 'tail', ''))
return join(parts)
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker.isAvailable() " {{{2
return self._isAvailableFunc()
endfunction " }}}2
" }}}1
" Private methods {{{1
1 0.000001 function! g:SyntasticChecker._quietMessages(errors) " {{{2
" wildcard quiet_messages
let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
if type(quiet_filters) != type({})
call syntastic#log#warn('ignoring invalid syntastic_quiet_messages')
unlet quiet_filters
let quiet_filters = {}
endif
" per checker quiet_messages
let name = self._filetype . '_' . self._name
try
call extend( quiet_filters, copy(syntastic#util#var(name . '_quiet_messages', {})), 'force' )
catch /\m^Vim\%((\a\+)\)\=:E712/
call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages')
endtry
call syntastic#log#debug(g:SyntasticDebugLoclist, 'quiet_messages filter:', quiet_filters)
if !empty(quiet_filters)
call syntastic#util#dictFilter(a:errors, quiet_filters)
call syntastic#log#debug(g:SyntasticDebugLoclist, 'filtered by quiet_messages:', a:errors)
endif
endfunction " }}}2
1 0.000002 function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
if has_key(self, '_highlightRegexFunc')
for e in a:errors
if e['valid']
let term = self._highlightRegexFunc(e)
if len(term) > 0
let e['hl'] = term
endif
endif
endfor
endif
endfunction " }}}2
1 0.000003 function! g:SyntasticChecker._getOpt(opts, basename, name, default) " {{{2
let user_val = syntastic#util#var(a:basename . a:name)
let ret = []
call extend( ret, self._shescape(get(a:opts, a:name . '_before', '')) )
call extend( ret, self._shescape(user_val != '' ? user_val : get(a:opts, a:name, a:default)) )
call extend( ret, self._shescape(get(a:opts, a:name . '_after', '')) )
return ret
endfunction " }}}2
1 0.000001 function! g:SyntasticChecker._shescape(opt) " {{{2
if type(a:opt) == type('') && a:opt != ''
return [a:opt]
elseif type(a:opt) == type([])
return map(copy(a:opt), 'syntastic#util#shescape(v:val)')
endif
return []
endfunction " }}}2
" }}}1
" Non-method functions {{{1
1 0.000002 function! SyntasticCheckerIsAvailableDefault() dict " {{{2
return executable(self.getExec())
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/cursor.vim
Sourced 2 times
Total time: 0.000079
Self time: 0.000079
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_cursor") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000002 let g:loaded_syntastic_notifier_cursor = 1
1 0.000002 let g:SyntasticCursorNotifier = {}
" Public methods {{{1
1 0.000002 function! g:SyntasticCursorNotifier.New() " {{{2
let newObj = copy(self)
return newObj
endfunction " }}}2
1 0.000003 function! g:SyntasticCursorNotifier.enabled() " {{{2
return syntastic#util#var('echo_current_error')
endfunction " }}}2
1 0.000002 function! g:SyntasticCursorNotifier.refresh(loclist) " {{{2
if self.enabled() && !a:loclist.isEmpty()
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: refresh')
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
let b:oldLine = -1
autocmd! syntastic CursorMoved
autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
endif
endfunction " }}}2
" @vimlint(EVL103, 1, a:loclist)
1 0.000002 function! g:SyntasticCursorNotifier.reset(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
autocmd! syntastic CursorMoved
unlet! b:syntastic_messages
let b:oldLine = -1
endfunction " }}}2
" @vimlint(EVL103, 0, a:loclist)
" }}}1
" Private methods {{{1
" The following defensive nonsense is needed because of the nature of autocmd
1 0.000002 function! g:SyntasticRefreshCursor() " {{{2
if !exists('b:syntastic_messages') || empty(b:syntastic_messages)
" file not checked
return
endif
if !exists('b:oldLine')
let b:oldLine = -1
endif
let l = line('.')
if l == b:oldLine
return
endif
let b:oldLine = l
if has_key(b:syntastic_messages, l)
call syntastic#util#wideMsg(b:syntastic_messages[l])
else
echo
endif
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/highlighting.vim
Sourced 2 times
Total time: 0.000093
Self time: 0.000093
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_highlighting") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000003 let g:loaded_syntastic_notifier_highlighting = 1
" Highlighting requires getmatches introduced in 7.1.040
1 0.000006 let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040'))
1 0.000003 let g:SyntasticHighlightingNotifier = {}
1 0.000002 let s:setup_done = 0
" Public methods {{{1
1 0.000002 function! g:SyntasticHighlightingNotifier.New() " {{{2
let newObj = copy(self)
if !s:setup_done
call self._setup()
let s:setup_done = 1
endif
return newObj
endfunction " }}}2
1 0.000001 function! g:SyntasticHighlightingNotifier.enabled() " {{{2
return s:has_highlighting && syntastic#util#var('enable_highlighting')
endfunction " }}}2
" Sets error highlights in the cuirrent window
1 0.000002 function! g:SyntasticHighlightingNotifier.refresh(loclist) " {{{2
if self.enabled()
call self.reset(a:loclist)
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: refresh')
let buf = bufnr('')
let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
for item in issues
let group = item['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
" The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is
" used to override default highlighting.
if has_key(item, 'hl')
call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl'])
elseif get(item, 'col', 0)
if get(item, 'vcol', 0)
let lastcol = virtcol([item['lnum'], '$'])
let coltype = 'v'
else
let lastcol = col([item['lnum'], '$'])
let coltype = 'c'
endif
let lcol = min([lastcol, item['col']])
call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype)
endif
endfor
endif
endfunction " }}}2
" Remove all error highlights from the window
" @vimlint(EVL103, 1, a:loclist)
1 0.000002 function! g:SyntasticHighlightingNotifier.reset(loclist) " {{{2
if s:has_highlighting
call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
for match in getmatches()
if stridx(match['group'], 'Syntastic') == 0
call matchdelete(match['id'])
endif
endfor
endif
endfunction " }}}2
" @vimlint(EVL103, 0, a:loclist)
" }}}1
" Private methods {{{1
" One time setup: define our own highlighting
1 0.000001 function! g:SyntasticHighlightingNotifier._setup() " {{{2
if s:has_highlighting
if !hlexists('SyntasticError')
highlight link SyntasticError SpellBad
endif
if !hlexists('SyntasticWarning')
highlight link SyntasticWarning SpellCap
endif
endif
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/loclist.vim
Sourced 2 times
Total time: 0.000211
Self time: 0.000211
count total (s) self (s)
if exists("g:loaded_syntastic_loclist") || !exists("g:loaded_syntastic_plugin")
1 0.000002 finish
endif
1 0.000003 let g:loaded_syntastic_loclist = 1
1 0.000002 let g:SyntasticLoclist = {}
" Public methods {{{1
1 0.000002 function! g:SyntasticLoclist.New(rawLoclist) " {{{2
let newObj = copy(self)
let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
for e in llist
if get(e, 'type', '') == ''
let e['type'] = 'E'
endif
endfor
let newObj._rawLoclist = llist
let newObj._name = ''
return newObj
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.current() " {{{2
if !exists("b:syntastic_loclist")
let b:syntastic_loclist = g:SyntasticLoclist.New([])
endif
return b:syntastic_loclist
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.extend(other) " {{{2
let list = self.copyRaw()
call extend(list, a:other.copyRaw())
return g:SyntasticLoclist.New(list)
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.isEmpty() " {{{2
return empty(self._rawLoclist)
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.copyRaw() " {{{2
return copy(self._rawLoclist)
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.getRaw() " {{{2
return self._rawLoclist
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.getStatuslineFlag() " {{{2
if !exists("self._stl_format")
let self._stl_format = ''
endif
if !exists("self._stl_flag")
let self._stl_flag = ''
endif
if g:syntastic_stl_format !=# self._stl_format
let self._stl_format = g:syntastic_stl_format
if !empty(self._rawLoclist)
let errors = self.errors()
let warnings = self.warnings()
let num_errors = len(errors)
let num_warnings = len(warnings)
let num_issues = len(self._rawLoclist)
let output = self._stl_format
"hide stuff wrapped in %E(...) unless there are errors
let output = substitute(output, '\m\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
"hide stuff wrapped in %W(...) unless there are warnings
let output = substitute(output, '\m\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
"hide stuff wrapped in %B(...) unless there are both errors and warnings
let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
"sub in the total errors/warnings/both
let output = substitute(output, '\m\C%w', num_warnings, 'g')
let output = substitute(output, '\m\C%e', num_errors, 'g')
let output = substitute(output, '\m\C%t', num_issues, 'g')
"first error/warning line num
let output = substitute(output, '\m\C%F', num_issues ? self._rawLoclist[0]['lnum'] : '', 'g')
"first error line num
let output = substitute(output, '\m\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
"first warning line num
let output = substitute(output, '\m\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g')
let self._stl_flag = output
else
let self._stl_flag = ''
endif
endif
return self._stl_flag
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.getFirstIssue() " {{{2
return get(self._rawLoclist, 0, {})
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.getName() " {{{2
return len(self._name)
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.setName(name) " {{{2
let self._name = a:name
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.decorate(tag) " {{{2
for e in self._rawLoclist
let e['text'] .= ' [' . a:tag . ']'
endfor
endfunction " }}}2
1 0.000001 function! g:SyntasticLoclist.errors() " {{{2
if !exists("self._cachedErrors")
let self._cachedErrors = self.filter({'type': "E"})
endif
return self._cachedErrors
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.warnings() " {{{2
if !exists("self._cachedWarnings")
let self._cachedWarnings = self.filter({'type': "W"})
endif
return self._cachedWarnings
endfunction " }}}2
" Legacy function. Syntastic no longer calls it, but we keep it
" around because other plugins (f.i. powerline) depend on it.
1 0.000002 function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay() " {{{2
return !self.isEmpty()
endfunction " }}}2
" cache used by EchoCurrentError()
1 0.000002 function! g:SyntasticLoclist.messages(buf) " {{{2
if !exists("self._cachedMessages")
let self._cachedMessages = {}
let errors = self.errors() + self.warnings()
for e in errors
let b = e['bufnr']
let l = e['lnum']
if !has_key(self._cachedMessages, b)
let self._cachedMessages[b] = {}
endif
if !has_key(self._cachedMessages[b], l)
let self._cachedMessages[b][l] = e['text']
endif
endfor
endif
return get(self._cachedMessages, a:buf, {})
endfunction " }}}2
"Filter the list and return new native loclist
"e.g.
" .filter({'bufnr': 10, 'type': 'e'})
"
"would return all errors for buffer 10.
"
"Note that all comparisons are done with ==?
1 0.000002 function! g:SyntasticLoclist.filter(filters) " {{{2
let conditions = values(map(copy(a:filters), 's:translate(v:key, v:val)'))
let filter = len(conditions) == 1 ?
\ conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
return filter(copy(self._rawLoclist), filter)
endfunction " }}}2
1 0.000002 function! g:SyntasticLoclist.setloclist() " {{{2
if !exists('w:syntastic_loclist_set')
let w:syntastic_loclist_set = 0
endif
let replace = g:syntastic_reuse_loc_lists && w:syntastic_loclist_set
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
let w:syntastic_loclist_set = 1
endfunction " }}}2
"display the cached errors for this buf in the location list
1 0.000001 function! g:SyntasticLoclist.show() " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: show')
call self.setloclist()
if !self.isEmpty()
let num = winnr()
execute "lopen " . syntastic#util#var('loc_list_height')
if num != winnr()
wincmd p
endif
" try to find the loclist window and set w:quickfix_title
let errors = getloclist(0)
for buf in tabpagebuflist()
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
let win = bufwinnr(buf)
let title = getwinvar(win, 'quickfix_title')
" TODO: try to make sure we actually own this window; sadly,
" errors == getloclist(0) is the only somewhat safe way to
" achieve that
if strpart(title, 0, 16) ==# ':SyntasticCheck ' ||
\ ( (title == '' || title ==# ':setloclist()') && errors == getloclist(0) )
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
endif
endif
endfor
endif
endfunction " }}}2
" }}}1
" Non-method functions {{{1
1 0.000002 function! g:SyntasticLoclistHide() " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: hide')
silent! lclose
endfunction " }}}2
" }}}1
" Private functions {{{1
1 0.000003 function! s:translate(key, val) " {{{2
return 'get(v:val, ' . string(a:key) . ', "") ==? ' . string(a:val)
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/modemap.vim
Sourced 2 times
Total time: 0.000081
Self time: 0.000081
count total (s) self (s)
if exists("g:loaded_syntastic_modemap") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000002 let g:loaded_syntastic_modemap = 1
1 0.000001 let g:SyntasticModeMap = {}
" Public methods {{{1
1 0.000001 function! g:SyntasticModeMap.Instance() " {{{2
if !exists('s:SyntasticModeMapInstance')
let s:SyntasticModeMapInstance = copy(self)
call s:SyntasticModeMapInstance.synch()
endif
return s:SyntasticModeMapInstance
endfunction " }}}2
1 0.000002 function! g:SyntasticModeMap.synch() " {{{2
if exists('g:syntastic_mode_map')
let self._mode = get(g:syntastic_mode_map, 'mode', 'active')
let self._activeFiletypes = get(g:syntastic_mode_map, 'active_filetypes', [])
let self._passiveFiletypes = get(g:syntastic_mode_map, 'passive_filetypes', [])
else
let self._mode = 'active'
let self._activeFiletypes = []
let self._passiveFiletypes = []
endif
endfunction " }}}2
1 0.000002 function! g:SyntasticModeMap.allowsAutoChecking(filetype) " {{{2
let fts = split(a:filetype, '\m\.')
if self.isPassive()
return self._isOneFiletypeActive(fts)
else
return self._noFiletypesArePassive(fts)
endif
endfunction " }}}2
1 0.000001 function! g:SyntasticModeMap.isPassive() " {{{2
return self._mode ==# 'passive'
endfunction " }}}2
1 0.000001 function! g:SyntasticModeMap.toggleMode() " {{{2
call self.synch()
if self._mode ==# 'active'
let self._mode = 'passive'
else
let self._mode = 'active'
endif
"XXX Changing a global variable. Tsk, tsk...
if !exists('g:syntastic_mode_map')
let g:syntastic_mode_map = {}
endif
let g:syntastic_mode_map['mode'] = self._mode
endfunction " }}}2
1 0.000002 function! g:SyntasticModeMap.echoMode() " {{{2
echo "Syntastic: " . self._mode . " mode enabled"
endfunction " }}}2
" }}}1
" Private methods {{{1
1 0.000002 function! g:SyntasticModeMap._isOneFiletypeActive(filetypes) " {{{2
return !empty(filter(copy(a:filetypes), 'index(self._activeFiletypes, v:val) != -1'))
endfunction " }}}2
1 0.000002 function! g:SyntasticModeMap._noFiletypesArePassive(filetypes) " {{{2
return empty(filter(copy(a:filetypes), 'index(self._passiveFiletypes, v:val) != -1'))
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/notifiers.vim
Sourced 2 times
Total time: 0.000068
Self time: 0.000068
count total (s) self (s)
if exists("g:loaded_syntastic_notifiers") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000003 let g:loaded_syntastic_notifiers = 1
1 0.000002 let g:SyntasticNotifiers = {}
1 0.000004 let s:notifier_types = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist']
" Public methods {{{1
1 0.000001 function! g:SyntasticNotifiers.Instance() " {{{2
if !exists('s:SyntasticNotifiersInstance')
let s:SyntasticNotifiersInstance = copy(self)
call s:SyntasticNotifiersInstance._initNotifiers()
endif
return s:SyntasticNotifiersInstance
endfunction " }}}2
1 0.000002 function! g:SyntasticNotifiers.refresh(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: refresh')
for type in self._enabled_types
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
call self._notifier[type].refresh(a:loclist)
endif
endfor
endfunction " }}}2
1 0.000001 function! g:SyntasticNotifiers.reset(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: reset')
for type in self._enabled_types
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
" reset notifiers regardless if they are enabled or not, since
" the user might have disabled them since the last refresh();
" notifiers MUST be prepared to deal with reset() when disabled
if has_key(g:{class}, 'reset')
call self._notifier[type].reset(a:loclist)
endif
endfor
endfunction " }}}2
" }}}1
" Private methods {{{1
1 0.000002 function! g:SyntasticNotifiers._initNotifiers() " {{{2
let self._notifier = {}
for type in s:notifier_types
let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
let self._notifier[type] = g:{class}.New()
endfor
let self._enabled_types = copy(s:notifier_types)
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/registry.vim
Sourced 2 times
Total time: 0.000266
Self time: 0.000266
count total (s) self (s)
if exists("g:loaded_syntastic_registry") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000002 let g:loaded_syntastic_registry = 1
" Initialisation {{{1
1 0.000097 let s:defaultCheckers = {
\ 'actionscript':['mxmlc'],
\ 'ada': ['gcc'],
\ 'applescript': ['osacompile'],
\ 'asciidoc': ['asciidoc'],
\ 'asm': ['gcc'],
\ 'bemhtml': ['bemhtmllint'],
\ 'c': ['gcc'],
\ 'chef': ['foodcritic'],
\ 'co': ['coco'],
\ 'cobol': ['cobc'],
\ 'coffee': ['coffee', 'coffeelint'],
\ 'coq': ['coqtop'],
\ 'cpp': ['gcc'],
\ 'cs': ['mcs'],
\ 'css': ['csslint'],
\ 'cucumber': ['cucumber'],
\ 'cuda': ['nvcc'],
\ 'd': ['dmd'],
\ 'dart': ['dartanalyzer'],
\ 'docbk': ['xmllint'],
\ 'dustjs': ['swiffer'],
\ 'elixir': ['elixir'],
\ 'erlang': ['escript'],
\ 'eruby': ['ruby'],
\ 'fortran': ['gfortran'],
\ 'glsl': ['cgc'],
\ 'go': ['go'],
\ 'haml': ['haml'],
\ 'handlebars': ['handlebars'],
\ 'haskell': ['ghc_mod', 'hdevtools', 'hlint'],
\ 'haxe': ['haxe'],
\ 'hss': ['hss'],
\ 'html': ['tidy'],
\ 'java': ['javac'],
\ 'javascript': ['jshint', 'jslint'],
\ 'json': ['jsonlint', 'jsonval'],
\ 'less': ['lessc'],
\ 'lex': ['flex'],
\ 'limbo': ['limbo'],
\ 'lisp': ['clisp'],
\ 'llvm': ['llvm'],
\ 'lua': ['luac'],
\ 'matlab': ['mlint'],
\ 'nasm': ['nasm'],
\ 'nroff': ['mandoc'],
\ 'objc': ['gcc'],
\ 'objcpp': ['gcc'],
\ 'ocaml': ['camlp4o'],
\ 'perl': ['perlcritic'],
\ 'php': ['php', 'phpcs', 'phpmd'],
\ 'po': ['msgfmt'],
\ 'pod': ['podchecker'],
\ 'puppet': ['puppet', 'puppetlint'],
\ 'python': ['python', 'flake8', 'pylint'],
\ 'racket': ['racket'],
\ 'rst': ['rst2pseudoxml'],
\ 'ruby': ['mri'],
\ 'rust': ['rustc'],
\ 'sass': ['sass'],
\ 'scala': ['fsc', 'scalac'],
\ 'scss': ['sass', 'scss_lint'],
\ 'sh': ['sh', 'shellcheck'],
\ 'slim': ['slimrb'],
\ 'tcl': ['nagelfar'],
\ 'tex': ['lacheck', 'chktex'],
\ 'texinfo': ['makeinfo'],
\ 'text': ['atdtool'],
\ 'twig': ['twiglint'],
\ 'typescript': ['tsc'],
\ 'vala': ['valac'],
\ 'verilog': ['verilator'],
\ 'vhdl': ['ghdl'],
\ 'vim': ['vimlint'],
\ 'xhtml': ['tidy'],
\ 'xml': ['xmllint'],
\ 'xslt': ['xmllint'],
\ 'yacc': ['bison'],
\ 'yaml': ['jsyaml'],
\ 'z80': ['z80syntaxchecker'],
\ 'zpt': ['zptlint'],
\ 'zsh': ['zsh', 'shellcheck']
\ }
1 0.000006 let s:defaultFiletypeMap = {
\ 'gentoo-metadata': 'xml',
\ 'lhaskell': 'haskell',
\ 'litcoffee': 'coffee'
\ }
1 0.000002 let g:SyntasticRegistry = {}
" }}}1
" Public methods {{{1
" TODO: Handling of filetype aliases: all public methods take aliases as
" parameters, all private methods take normalized filetypes. Public methods
" are thus supposed to normalize filetypes before calling private methods.
1 0.000002 function! g:SyntasticRegistry.Instance() " {{{2
if !exists('s:SyntasticRegistryInstance')
let s:SyntasticRegistryInstance = copy(self)
let s:SyntasticRegistryInstance._checkerRaw = {}
let s:SyntasticRegistryInstance._checkerMap = {}
endif
return s:SyntasticRegistryInstance
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.CreateAndRegisterChecker(args) " {{{2
let checker = g:SyntasticChecker.New(a:args)
let registry = g:SyntasticRegistry.Instance()
call registry._registerChecker(checker)
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.isCheckable(ftalias) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckers(ft)
return !empty(self._checkerMap[ft])
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.getCheckersMap(ftalias) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckers(ft)
return self._checkerMap[ft]
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.getCheckers(ftalias, list) " {{{2
let checkers_map = self.getCheckersMap(a:ftalias)
if empty(checkers_map)
return []
endif
let ft = s:normaliseFiletype(a:ftalias)
call self._checkDeprecation(ft)
let names =
\ !empty(a:list) ? a:list :
\ exists('b:syntastic_checkers') ? b:syntastic_checkers :
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
\ get(s:defaultCheckers, ft, 0)
return type(names) == type([]) ?
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.getKnownFiletypes() " {{{2
let types = keys(s:defaultCheckers)
call extend(types, keys(s:defaultFiletypeMap))
if exists('g:syntastic_filetype_map')
call extend(types, keys(g:syntastic_filetype_map))
endif
if exists('g:syntastic_extra_filetypes') && type(g:syntastic_extra_filetypes) == type([])
call extend(types, g:syntastic_extra_filetypes)
endif
return syntastic#util#unique(types)
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry.echoInfoFor(ftalias_list) " {{{2
echomsg "Syntastic info for filetype: " . join(a:ftalias_list, '.')
let ft_list = syntastic#util#unique(map( copy(a:ftalias_list), 's:normaliseFiletype(v:val)' ))
if len(ft_list) != 1
let available = []
let active = []
for ft in ft_list
call extend(available, map( keys(self.getCheckersMap(ft)), 'ft . "/" . v:val' ))
call extend(active, map( self.getCheckers(ft, []), 'ft . "/" . v:val.getName()' ))
endfor
else
let ft = ft_list[0]
let available = keys(self.getCheckersMap(ft))
let active = map(self.getCheckers(ft, []), 'v:val.getName()')
endif
echomsg "Available checker(s): " . join(sort(available))
echomsg "Currently enabled checker(s): " . join(active)
endfunction " }}}2
" }}}1
" Private methods {{{1
1 0.000002 function! g:SyntasticRegistry._registerChecker(checker) abort " {{{2
let ft = a:checker.getFiletype()
if !has_key(self._checkerRaw, ft)
let self._checkerRaw[ft] = []
let self._checkerMap[ft] = {}
endif
call self._validateUniqueName(a:checker)
let name = a:checker.getName()
call add(self._checkerRaw[ft], name)
if a:checker.isAvailable()
let self._checkerMap[ft][name] = a:checker
endif
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry._filterCheckersByName(checkers_map, list) " {{{2
return filter( map(copy(a:list), 'get(a:checkers_map, v:val, {})'), '!empty(v:val)' )
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry._loadCheckers(filetype) " {{{2
if has_key(self._checkerRaw, a:filetype)
return
endif
execute "runtime! syntax_checkers/" . a:filetype . "/*.vim"
if !has_key(self._checkerRaw, a:filetype)
let self._checkerRaw[a:filetype] = []
let self._checkerMap[a:filetype] = {}
endif
endfunction " }}}2
1 0.000002 function! g:SyntasticRegistry._validateUniqueName(checker) abort " {{{2
let ft = a:checker.getFiletype()
let name = a:checker.getName()
if index(self._checkerRaw[ft], name) > -1
throw 'Syntastic: Duplicate syntax checker name: ' . ft . '/' . name
endif
endfunction " }}}2
" Check for obsolete variable g:syntastic_<filetype>_checker
1 0.000003 function! g:SyntasticRegistry._checkDeprecation(filetype) " {{{2
if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
call syntastic#log#deprecationWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
endif
endfunction " }}}2
" }}}1
" Private functions {{{1
"resolve filetype aliases, and replace - with _ otherwise we cant name
"syntax checker functions legally for filetypes like "gentoo-metadata"
1 0.000002 function! s:normaliseFiletype(ftalias) " {{{2
let ft = get(s:defaultFiletypeMap, a:ftalias, a:ftalias)
let ft = get(g:syntastic_filetype_map, ft, ft)
let ft = substitute(ft, '\m-', '_', 'g')
return ft
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/signs.vim
Sourced 2 times
Total time: 0.000107
Self time: 0.000107
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_signs") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000003 let g:loaded_syntastic_notifier_signs = 1
" Initialisation {{{1
" start counting sign ids at 5000, start here to hopefully avoid conflicting
" with any other code that places signs (not sure if this precaution is
" actually needed)
1 0.000002 let s:first_sign_id = 5000
1 0.000002 let s:next_sign_id = s:first_sign_id
1 0.000002 let g:SyntasticSignsNotifier = {}
1 0.000002 let s:setup_done = 0
" }}}1
" Public methods {{{1
1 0.000002 function! g:SyntasticSignsNotifier.New() " {{{2
let newObj = copy(self)
if !s:setup_done
call self._setup()
let s:setup_done = 1
endif
return newObj
endfunction " }}}2
1 0.000001 function! g:SyntasticSignsNotifier.enabled() " {{{2
return has('signs') && syntastic#util#var('enable_signs')
endfunction " }}}2
1 0.000001 function! g:SyntasticSignsNotifier.refresh(loclist) " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'signs: refresh')
let old_signs = copy(self._bufSignIds())
if self.enabled()
call self._signErrors(a:loclist)
endif
call self._removeSigns(old_signs)
let s:first_sign_id = s:next_sign_id
endfunction " }}}2
" }}}1
" Private methods {{{1
" One time setup: define our own sign types and highlighting
1 0.000002 function! g:SyntasticSignsNotifier._setup() " {{{2
if has('signs')
if !hlexists('SyntasticErrorSign')
highlight link SyntasticErrorSign error
endif
if !hlexists('SyntasticWarningSign')
highlight link SyntasticWarningSign todo
endif
if !hlexists('SyntasticStyleErrorSign')
highlight link SyntasticStyleErrorSign SyntasticErrorSign
endif
if !hlexists('SyntasticStyleWarningSign')
highlight link SyntasticStyleWarningSign SyntasticWarningSign
endif
if !hlexists('SyntasticStyleErrorLine')
highlight link SyntasticStyleErrorLine SyntasticErrorLine
endif
if !hlexists('SyntasticStyleWarningLine')
highlight link SyntasticStyleWarningLine SyntasticWarningLine
endif
" define the signs used to display syntax and style errors/warns
exe 'sign define SyntasticError text=' . g:syntastic_error_symbol .
\ ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine'
exe 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol .
\ ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine'
exe 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol .
\ ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine'
exe 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol .
\ ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine'
endif
endfunction " }}}2
" Place signs by all syntax errors in the buffer
1 0.000002 function! g:SyntasticSignsNotifier._signErrors(loclist) " {{{2
let loclist = a:loclist
if !loclist.isEmpty()
" errors some first, so that they are not masked by warnings
let buf = bufnr('')
let issues = copy(loclist.errors())
call extend(issues, loclist.warnings())
call filter(issues, 'v:val["bufnr"] == buf')
let seen = {}
for i in issues
if !has_key(seen, i['lnum'])
let seen[i['lnum']] = 1
let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
let sign_subtype = get(i, 'subtype', '')
let sign_type = 'Syntastic' . sign_subtype . sign_severity
execute "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr']
call add(self._bufSignIds(), s:next_sign_id)
let s:next_sign_id += 1
endif
endfor
endif
endfunction " }}}2
" Remove the signs with the given ids from this buffer
1 0.000002 function! g:SyntasticSignsNotifier._removeSigns(ids) " {{{2
if has('signs')
for i in a:ids
execute "sign unplace " . i
call remove(self._bufSignIds(), index(self._bufSignIds(), i))
endfor
endif
endfunction " }}}2
" Get all the ids of the SyntaxError signs in the buffer
1 0.000000 function! g:SyntasticSignsNotifier._bufSignIds() " {{{2
if !exists("b:syntastic_sign_ids")
let b:syntastic_sign_ids = []
endif
return b:syntastic_sign_ids
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic.vim
Sourced 1 time
Total time: 0.015093
Self time: 0.002411
count total (s) self (s)
"============================================================================
"File: syntastic.vim
"Description: Vim plugin for on the fly syntax checking.
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
1 0.000004 if exists("g:loaded_syntastic_plugin")
finish
endif
1 0.000003 let g:loaded_syntastic_plugin = 1
1 0.000003 if has('reltime')
1 0.000003 let g:syntastic_start = reltime()
1 0.000000 endif
1 0.000002 let g:syntastic_version = '3.4.0'
" Sanity checks {{{1
6 0.000011 for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands']
5 0.000013 if !has(s:feature)
call syntastic#log#error("need Vim compiled with feature " . s:feature)
finish
endif
5 0.000003 endfor
1 0.000074 let s:running_windows = syntastic#util#isRunningWindows()
1 0.000029 if !s:running_windows && executable('uname')
1 0.000002 try
1 0.010451 0.000081 let s:uname = system('uname')
1 0.000012 catch /\m^Vim\%((\a\+)\)\=:E484/
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
finish
endtry
1 0.000001 endif
" }}}1
" Defaults {{{1
1 0.000048 let g:syntastic_defaults = {
\ 'aggregate_errors': 0,
\ 'always_populate_loc_list': 0,
\ 'auto_jump': 0,
\ 'auto_loc_list': 2,
\ 'bash_hack': 1,
\ 'check_on_open': 0,
\ 'check_on_wq': 1,
\ 'debug': 0,
\ 'echo_current_error': 1,
\ 'enable_balloons': 1,
\ 'enable_highlighting': 1,
\ 'enable_signs': 1,
\ 'error_symbol': '>>',
\ 'filetype_map': {},
\ 'full_redraws': !(has('gui_running') || has('gui_macvim')),
\ 'id_checkers': 1,
\ 'ignore_files': [],
\ 'loc_list_height': 10,
\ 'quiet_messages': {},
\ 'reuse_loc_lists': (v:version >= 704),
\ 'stl_format': '[Syntax: line:%F (%t)]',
\ 'style_error_symbol': 'S>',
\ 'style_warning_symbol': 'S>',
\ 'warning_symbol': '>>'
\ }
25 0.000040 for s:key in keys(g:syntastic_defaults)
24 0.000071 if !exists('g:syntastic_' . s:key)
24 0.000112 let g:syntastic_{s:key} = g:syntastic_defaults[s:key]
24 0.000017 endif
24 0.000016 endfor
1 0.000005 if exists("g:syntastic_quiet_warnings")
call syntastic#log#deprecationWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
if g:syntastic_quiet_warnings
let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
if type(s:quiet_warnings) != type([])
let s:quiet_warnings = [s:quiet_warnings]
endif
call add(s:quiet_warnings, 'warnings')
let g:syntastic_quiet_messages['type'] = s:quiet_warnings
endif
endif
" }}}1
" Debug {{{1
1 0.000008 let s:debug_dump_options = [
\ 'shell',
\ 'shellcmdflag',
\ 'shellpipe',
\ 'shellquote',
\ 'shellredir',
\ 'shellslash',
\ 'shelltemp',
\ 'shellxquote'
\ ]
1 0.000004 if v:version > 703 || (v:version == 703 && has('patch446'))
1 0.000011 call add(s:debug_dump_options, 'shellxescape')
1 0.000001 endif
" debug constants
1 0.000003 let g:SyntasticDebugTrace = 1
1 0.000002 let g:SyntasticDebugLoclist = 2
1 0.000002 let g:SyntasticDebugNotifications = 4
1 0.000002 let g:SyntasticDebugAutocommands = 8
1 0.000002 let g:SyntasticDebugVariables = 16
" }}}1
1 0.000224 runtime! plugin/syntastic/*.vim
1 0.000061 0.000018 let s:registry = g:SyntasticRegistry.Instance()
1 0.000311 0.000006 let s:notifiers = g:SyntasticNotifiers.Instance()
1 0.000038 0.000005 let s:modemap = g:SyntasticModeMap.Instance()
" Commands {{{1
" @vimlint(EVL103, 1, a:cursorPos)
" @vimlint(EVL103, 1, a:cmdLine)
" @vimlint(EVL103, 1, a:argLead)
1 0.000004 function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) " {{{2
let checker_names = []
for ft in s:resolveFiletypes()
call extend(checker_names, keys(s:registry.getCheckersMap(ft)))
endfor
return join(checker_names, "\n")
endfunction " }}}2
" @vimlint(EVL103, 0, a:cursorPos)
" @vimlint(EVL103, 0, a:cmdLine)
" @vimlint(EVL103, 0, a:argLead)
" @vimlint(EVL103, 1, a:cursorPos)
" @vimlint(EVL103, 1, a:cmdLine)
" @vimlint(EVL103, 1, a:argLead)
1 0.000003 function! s:CompleteFiletypes(argLead, cmdLine, cursorPos) " {{{2
return join(s:registry.getKnownFiletypes(), "\n")
endfunction " }}}2
" @vimlint(EVL103, 0, a:cursorPos)
" @vimlint(EVL103, 0, a:cmdLine)
" @vimlint(EVL103, 0, a:argLead)
1 0.000013 command! SyntasticToggleMode call s:ToggleMode()
1 0.000023 command! -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck
\ call s:UpdateErrors(0, <f-args>) <bar>
\ call syntastic#util#redraw(g:syntastic_full_redraws)
1 0.000006 command! Errors call s:ShowLocList()
1 0.000017 command! -nargs=? -complete=custom,s:CompleteFiletypes SyntasticInfo
\ call s:modemap.echoMode() |
\ call s:registry.echoInfoFor(s:resolveFiletypes(<f-args>))
1 0.000015 command! SyntasticReset
\ call s:ClearCache() |
\ call s:notifiers.refresh(g:SyntasticLoclist.New([]))
1 0.000010 command! SyntasticSetLoclist call g:SyntasticLoclist.current().setloclist()
" }}}1
" Autocommands and hooks {{{1
1 0.000003 augroup syntastic
1 0.000017 autocmd BufReadPost * call s:BufReadPostHook()
1 0.000000 autocmd BufWritePost * call s:BufWritePostHook()
1 0.000000 autocmd BufWinEnter * call s:BufWinEnterHook()
" TODO: the next autocmd should be "autocmd BufWinLeave * if &buftype == '' | lclose | endif"
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
1 0.000000 autocmd BufEnter * call s:BufEnterHook()
1 0.000000 augroup END
1 0.000000 if v:version > 703 || (v:version == 703 && has('patch544'))
" QuitPre was added in Vim 7.3.544
1 0.000000 augroup syntastic
1 0.000000 autocmd QuitPre * call s:QuitPreHook()
1 0.000000 augroup END
1 0.000000 endif
1 0.000000 function! s:BufReadPostHook() " {{{2
if g:syntastic_check_on_open
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufReadPost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
call s:UpdateErrors(1)
endif
endfunction " }}}2
1 0.000003 function! s:BufWritePostHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufWritePost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
call s:UpdateErrors(1)
endfunction " }}}2
1 0.000002 function! s:BufWinEnterHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype))
if &buftype == ''
call s:notifiers.refresh(g:SyntasticLoclist.current())
endif
endfunction " }}}2
1 0.000002 function! s:BufEnterHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype))
" TODO: at this point there is no b:syntastic_loclist
let loclist = filter(getloclist(0), 'v:val["valid"] == 1')
let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' ))
if &buftype == 'quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
call g:SyntasticLoclistHide()
endif
endfunction " }}}2
1 0.000002 function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
call g:SyntasticLoclistHide()
endfunction " }}}2
" }}}1
" Main {{{1
"refresh and redraw all the error info for this buf when saving or reading
1 0.000002 function! s:UpdateErrors(auto_invoked, ...) " {{{2
if s:skipFile()
return
endif
call s:modemap.synch()
let run_checks = !a:auto_invoked || s:modemap.allowsAutoChecking(&filetype)
if run_checks
call s:CacheErrors(a:000)
endif
let loclist = g:SyntasticLoclist.current()
" populate loclist and jump {{{3
let do_jump = syntastic#util#var('auto_jump')
if do_jump == 2
let first = loclist.getFirstIssue()
let type = get(first, 'type', '')
let do_jump = type ==? 'E'
endif
let w:syntastic_loclist_set = 0
if syntastic#util#var('always_populate_loc_list') || do_jump
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: setloclist (new)')
call setloclist(0, loclist.getRaw())
let w:syntastic_loclist_set = 1
if run_checks && do_jump && !loclist.isEmpty()
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: jump')
silent! lrewind
" XXX: Vim doesn't call autocmd commands in a predictible
" order, which can lead to missing filetype when jumping
" to a new file; the following is a workaround for the
" resulting brain damage
if &filetype == ''
silent! filetype detect
endif
endif
endif
" }}}3
call s:notifiers.refresh(loclist)
endfunction " }}}2
"clear the loc list for the buffer
1 0.000002 function! s:ClearCache() " {{{2
call s:notifiers.reset(g:SyntasticLoclist.current())
unlet! b:syntastic_loclist
endfunction " }}}2
"detect and cache all syntax errors in this buffer
1 0.000002 function! s:CacheErrors(checker_names) " {{{2
call s:ClearCache()
let newLoclist = g:SyntasticLoclist.New([])
if !s:skipFile()
" debug logging {{{3
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'version')
call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options)
call syntastic#log#debugDump(g:SyntasticDebugVariables)
call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'aggregate_errors')
call syntastic#log#debug(g:SyntasticDebugTrace, 'getcwd() = ' . getcwd())
" }}}3
let filetypes = s:resolveFiletypes()
let aggregate_errors = syntastic#util#var('aggregate_errors')
let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
let clist = []
for type in filetypes
call extend(clist, s:registry.getCheckers(type, a:checker_names))
endfor
let names = []
for checker in clist
let cname = checker.getFiletype() . '/' . checker.getName()
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
let loclist = checker.getLocList()
if !loclist.isEmpty()
if decorate_errors
call loclist.decorate(cname)
endif
call add(names, cname)
let newLoclist = newLoclist.extend(loclist)
if !aggregate_errors
break
endif
endif
endfor
" set names {{{3
if !empty(names)
if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
let type = substitute(names[0], '\m/.*', '', '')
let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
call newLoclist.setName( name . ' ('. type . ')' )
else
" checkers from mixed types
call newLoclist.setName(join(names, ', '))
endif
endif
" }}}3
" issue warning about no active checkers {{{3
if empty(clist)
if !empty(a:checker_names)
if len(a:checker_names) == 1
call syntastic#log#warn('checker ' . a:checker_names[0] . ' is not available')
else
call syntastic#log#warn('checkers ' . join(a:checker_names, ', ') . ' are not available')
endif
else
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: no checkers available for ' . &filetype)
endif
endif
" }}}3
call syntastic#log#debug(g:SyntasticDebugLoclist, 'aggregated:', newLoclist)
endif
let b:syntastic_loclist = newLoclist
endfunction " }}}2
1 0.000002 function! s:ToggleMode() " {{{2
call s:modemap.toggleMode()
call s:ClearCache()
call s:UpdateErrors(1)
call s:modemap.echoMode()
endfunction " }}}2
"display the cached errors for this buf in the location list
1 0.000002 function! s:ShowLocList() " {{{2
call g:SyntasticLoclist.current().show()
endfunction " }}}2
"Emulates the :lmake command. Sets up the make environment according to the
"options given, runs make, resets the environment, returns the location list
"
"a:options can contain the following keys:
" 'makeprg'
" 'errorformat'
"
"The corresponding options are set for the duration of the function call. They
"are set with :let, so dont escape spaces.
"
"a:options may also contain:
" 'defaults' - a dict containing default values for the returned errors
" 'subtype' - all errors will be assigned the given subtype
" 'preprocess' - a function to be applied to the error file before parsing errors
" 'postprocess' - a list of functions to be applied to the error list
" 'cwd' - change directory to the given path before running the checker
" 'returns' - a list of valid exit codes for the checker
1 0.000002 function! SyntasticMake(options) " {{{2
call syntastic#log#debug(g:SyntasticDebugTrace, 'SyntasticMake: called with options:', a:options)
" save options and locale env variables {{{3
let old_shell = &shell
let old_shellredir = &shellredir
let old_local_errorformat = &l:errorformat
let old_errorformat = &errorformat
let old_cwd = getcwd()
let old_lc_messages = $LC_MESSAGES
let old_lc_all = $LC_ALL
" }}}3
call s:bashHack()
if has_key(a:options, 'errorformat')
let &errorformat = a:options['errorformat']
endif
if has_key(a:options, 'cwd')
execute 'lcd ' . fnameescape(a:options['cwd'])
endif
let $LC_MESSAGES = 'C'
let $LC_ALL = ''
let err_lines = split(system(a:options['makeprg']), "\n", 1)
let $LC_ALL = old_lc_all
let $LC_MESSAGES = old_lc_messages
call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines)
if has_key(a:options, 'Preprocess')
let err_lines = call(a:options['Preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess (external):', err_lines)
elseif has_key(a:options, 'preprocess')
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines)
endif
lgetexpr err_lines
let errors = deepcopy(getloclist(0))
if has_key(a:options, 'cwd')
execute 'lcd ' . fnameescape(old_cwd)
endif
silent! lolder
" restore options {{{3
let &errorformat = old_errorformat
let &l:errorformat = old_local_errorformat
let &shellredir = old_shellredir
let &shell = old_shell
" }}}3
if !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
call syntastic#util#redraw(g:syntastic_full_redraws)
endif
call syntastic#log#debug(g:SyntasticDebugLoclist, 'raw loclist:', errors)
if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
throw 'Syntastic: checker error'
endif
if has_key(a:options, 'defaults')
call s:addToErrors(errors, a:options['defaults'])
endif
" Add subtype info if present.
if has_key(a:options, 'subtype')
call s:addToErrors(errors, { 'subtype': a:options['subtype'] })
endif
if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess'])
for rule in a:options['Postprocess']
let errors = call(rule, [errors])
endfor
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess (external):', errors)
elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
for rule in a:options['postprocess']
let errors = call('syntastic#postprocess#' . rule, [errors])
endfor
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess:', errors)
endif
return errors
endfunction " }}}2
"return a string representing the state of buffer according to
"g:syntastic_stl_format
"
"return '' if no errors are cached for the buffer
1 0.000003 function! SyntasticStatuslineFlag() " {{{2
return g:SyntasticLoclist.current().getStatuslineFlag()
endfunction " }}}2
" }}}1
" Utilities {{{1
1 0.000002 function! s:resolveFiletypes(...) " {{{2
let type = a:0 ? a:1 : &filetype
return split( get(g:syntastic_filetype_map, type, type), '\m\.' )
endfunction " }}}2
1 0.000003 function! s:ignoreFile(filename) " {{{2
let fname = fnamemodify(a:filename, ':p')
for pattern in g:syntastic_ignore_files
if fname =~# pattern
return 1
endif
endfor
return 0
endfunction " }}}2
" Skip running in special buffers
1 0.000002 function! s:skipFile() " {{{2
let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
let fname = expand('%')
return force_skip || (&buftype != '') || !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname)
endfunction " }}}2
" Take a list of errors and add default values to them from a:options
1 0.000002 function! s:addToErrors(errors, options) " {{{2
for err in a:errors
for key in keys(a:options)
if !has_key(err, key) || empty(err[key])
let err[key] = a:options[key]
endif
endfor
endfor
return a:errors
endfunction " }}}2
" The script changes &shellredir and &shell to stop the screen flicking when
" shelling out to syntax checkers. Not all OSs support the hacks though.
1 0.000002 function! s:bashHack() " {{{2
if !exists('s:bash')
if !s:running_windows && (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD")
let s:bash =
\ executable('/usr/local/bin/bash') ? '/usr/local/bin/bash' :
\ executable('/bin/bash') ? '/bin/bash' : ''
else
let s:bash = ''
endif
endif
if g:syntastic_bash_hack && s:bash != ''
let &shell = s:bash
let &shellredir = '&>'
endif
endfunction " }}}2
1 0.000002 function! s:uname() " {{{2
if !exists('s:uname')
let s:uname = system('uname')
endif
return s:uname
endfunction " }}}2
" }}}1
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/autoload/syntastic/log.vim
Sourced 1 time
Total time: 0.000205
Self time: 0.000205
count total (s) self (s)
if exists("g:loaded_syntastic_log_autoload") || !exists("g:loaded_syntastic_plugin")
finish
endif
1 0.000003 let g:loaded_syntastic_log_autoload = 1
1 0.000008 let s:save_cpo = &cpo
1 0.000013 set cpo&vim
1 0.000002 let s:deprecation_notices_issued = []
" Public functions {{{1
1 0.000004 function! syntastic#log#info(msg) " {{{2
echomsg "syntastic: info: " . a:msg
endfunction " }}}2
1 0.000003 function! syntastic#log#warn(msg) " {{{2
echohl WarningMsg
echomsg "syntastic: warning: " . a:msg
echohl None
endfunction " }}}2
1 0.000002 function! syntastic#log#error(msg) " {{{2
execute "normal \<Esc>"
echohl ErrorMsg
echomsg "syntastic: error: " . a:msg
echohl None
endfunction " }}}2
1 0.000003 function! syntastic#log#deprecationWarn(msg) " {{{2
if index(s:deprecation_notices_issued, a:msg) >= 0
return
endif
call add(s:deprecation_notices_issued, a:msg)
call syntastic#log#warn(a:msg)
endfunction " }}}2
1 0.000004 function! syntastic#log#debug(level, msg, ...) " {{{2
if !s:isDebugEnabled(a:level)
return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
if a:0 > 0
" filter out dictionary functions
echomsg leader . a:msg . ' ' .
\ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?
\ filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1))
else
echomsg leader . a:msg
endif
call s:logRedirect(0)
endfunction " }}}2
1 0.000003 function! syntastic#log#debugShowOptions(level, names) " {{{2
if !s:isDebugEnabled(a:level)
return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
let vlist = copy(type(a:names) == type("") ? [a:names] : a:names)
if !empty(vlist)
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
echomsg leader . join(vlist, ', ')
endif
call s:logRedirect(0)
endfunction " }}}2
1 0.000003 function! syntastic#log#debugShowVariables(level, names) " {{{2
if !s:isDebugEnabled(a:level)
return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
let vlist = type(a:names) == type("") ? [a:names] : a:names
for name in vlist
let msg = s:formatVariable(name)
if msg != ''
echomsg leader . msg
endif
endfor
call s:logRedirect(0)
endfunction " }}}2
1 0.000002 function! syntastic#log#debugDump(level) " {{{2
if !s:isDebugEnabled(a:level)
return
endif
call syntastic#log#debugShowVariables( a:level, sort(keys(g:syntastic_defaults)) )
endfunction " }}}2
" }}}1
" Private functions {{{1
1 0.000003 function! s:isDebugEnabled_smart(level) " {{{2
return and(g:syntastic_debug, a:level)
endfunction " }}}2
1 0.000002 function! s:isDebugEnabled_dumb(level) " {{{2
" poor man's bit test for bit N, assuming a:level == 2**N
return (g:syntastic_debug / a:level) % 2
endfunction " }}}2
1 0.000010 let s:isDebugEnabled = function(exists('*and') ? 's:isDebugEnabled_smart' : 's:isDebugEnabled_dumb')
1 0.000002 function! s:logRedirect(on) " {{{2
if exists("g:syntastic_debug_file")
if a:on
try
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file))
catch /\m^Vim\%((\a\+)\)\=:/
silent! redir END
unlet g:syntastic_debug_file
endtry
else
silent! redir END
endif
endif
endfunction " }}}2
1 0.000002 function! s:logTimestamp_smart() " {{{2
return 'syntastic: ' . split(reltimestr(reltime(g:syntastic_start)))[0] . ': '
endfunction " }}}2
1 0.000002 function! s:logTimestamp_dumb() " {{{2
return 'syntastic: debug: '
endfunction " }}}2
1 0.000008 let s:logTimestamp = function(has('reltime') ? 's:logTimestamp_smart' : 's:logTimestamp_dumb')
1 0.000002 function! s:formatVariable(name) " {{{2
let vals = []
if exists('g:syntastic_' . a:name)
call add(vals, 'g:syntastic_' . a:name . ' = ' . strtrans(string(g:syntastic_{a:name})))
endif
if exists('b:syntastic_' . a:name)
call add(vals, 'b:syntastic_' . a:name . ' = ' . strtrans(string(b:syntastic_{a:name})))
endif
return join(vals, ', ')
endfunction " }}}2
" }}}1
1 0.000013 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/autoload/syntastic/util.vim
Sourced 1 time
Total time: 0.000281
Self time: 0.000281
count total (s) self (s)
if exists('g:loaded_syntastic_util_autoload') || !exists("g:loaded_syntastic_plugin")
finish
endif
1 0.000003 let g:loaded_syntastic_util_autoload = 1
1 0.000007 let s:save_cpo = &cpo
1 0.000012 set cpo&vim
" Public functions {{{1
1 0.000004 function! syntastic#util#isRunningWindows() " {{{2
return has('win16') || has('win32') || has('win64')
endfunction " }}}2
1 0.000002 function! syntastic#util#DevNull() " {{{2
if syntastic#util#isRunningWindows()
return 'NUL'
endif
return '/dev/null'
endfunction " }}}2
" Get directory separator
1 0.000002 function! syntastic#util#Slash() abort " {{{2
return (!exists("+shellslash") || &shellslash) ? '/' : '\'
endfunction " }}}2
"search the first 5 lines of the file for a magic number and return a map
"containing the args and the executable
"
"e.g.
"
"#!/usr/bin/perl -f -bar
"
"returns
"
"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
1 0.000002 function! syntastic#util#parseShebang() " {{{2
for lnum in range(1,5)
let line = getline(lnum)
if line =~ '^#!'
let exe = matchstr(line, '\m^#!\s*\zs[^ \t]*')
let args = split(matchstr(line, '\m^#!\s*[^ \t]*\zs.*'))
return { 'exe': exe, 'args': args }
endif
endfor
return { 'exe': '', 'args': [] }
endfunction " }}}2
" Get the value of a variable. Allow local variables to override global ones.
1 0.000003 function! syntastic#util#var(name, ...) " {{{2
return
\ exists('b:syntastic_' . a:name) ? b:syntastic_{a:name} :
\ exists('g:syntastic_' . a:name) ? g:syntastic_{a:name} :
\ a:0 > 0 ? a:1 : ''
endfunction " }}}2
" Parse a version string. Return an array of version components.
1 0.000003 function! syntastic#util#parseVersion(version) " {{{2
return split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.')
endfunction " }}}2
" Run 'command' in a shell and parse output as a version string.
" Returns an array of version components.
1 0.000003 function! syntastic#util#getVersion(command) " {{{2
return syntastic#util#parseVersion(system(a:command))
endfunction " }}}2
" Verify that the 'installed' version is at least the 'required' version.
"
" 'installed' and 'required' must be arrays. If they have different lengths,
" the "missing" elements will be assumed to be 0 for the purposes of checking.
"
" See http://semver.org for info about version numbers.
1 0.000003 function! syntastic#util#versionIsAtLeast(installed, required) " {{{2
for idx in range(max([len(a:installed), len(a:required)]))
let installed_element = get(a:installed, idx, 0)
let required_element = get(a:required, idx, 0)
if installed_element != required_element
return installed_element > required_element
endif
endfor
" Everything matched, so it is at least the required version.
return 1
endfunction " }}}2
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
" and hope for the best :)
1 0.000007 let s:width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
"print as much of a:msg as possible without "Press Enter" prompt appearing
1 0.000002 function! syntastic#util#wideMsg(msg) " {{{2
let old_ruler = &ruler
let old_showcmd = &showcmd
"This is here because it is possible for some error messages to
"begin with \n which will cause a "press enter" prompt.
let msg = substitute(a:msg, "\n", "", "g")
"convert tabs to spaces so that the tabs count towards the window
"width as the proper amount of characters
let chunks = split(msg, "\t", 1)
let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1]
let msg = strpart(msg, 0, &columns - 1)
set noruler noshowcmd
call syntastic#util#redraw(0)
echo msg
let &ruler = old_ruler
let &showcmd = old_showcmd
endfunction " }}}2
" Check whether a buffer is loaded, listed, and not hidden
1 0.000003 function! syntastic#util#bufIsActive(buffer) " {{{2
" convert to number, or hell breaks loose
let buf = str2nr(a:buffer)
if !bufloaded(buf) || !buflisted(buf)
return 0
endif
" get rid of hidden buffers
for tab in range(1, tabpagenr('$'))
if index(tabpagebuflist(tab), buf) >= 0
return 1
endif
endfor
return 0
endfunction " }}}2
" start in directory a:where and walk up the parent folders until it
" finds a file matching a:what; return path to that file
1 0.000003 function! syntastic#util#findInParent(what, where) " {{{2
let here = fnamemodify(a:where, ':p')
let root = syntastic#util#Slash()
if syntastic#util#isRunningWindows() && here[1] == ':'
" The drive letter is an ever-green source of fun. That's because
" we don't care about running syntastic on Amiga these days. ;)
let root = fnamemodify(root, ':p')
let root = here[0] . root[1:]
endif
let old = ''
while here != ''
let p = split(globpath(here, a:what), '\n')
if !empty(p)
return fnamemodify(p[0], ':p')
elseif here ==? root || here ==? old
break
endif
let old = here
" we use ':h:h' rather than ':h' since ':p' adds a trailing '/'
" if 'here' is a directory
let here = fnamemodify(here, ':p:h:h')
endwhile
return ''
endfunction " }}}2
" Returns unique elements in a list
1 0.000002 function! syntastic#util#unique(list) " {{{2
let seen = {}
let uniques = []
for e in a:list
if !has_key(seen, e)
let seen[e] = 1
call add(uniques, e)
endif
endfor
return uniques
endfunction " }}}2
" A less noisy shellescape()
1 0.000003 function! syntastic#util#shescape(string) " {{{2
return a:string =~ '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string)
endfunction " }}}2
" A less noisy shellescape(expand())
1 0.000002 function! syntastic#util#shexpand(string) " {{{2
return syntastic#util#shescape(expand(a:string))
endfunction " }}}2
" decode XML entities
1 0.000003 function! syntastic#util#decodeXMLEntities(string) " {{{2
let str = a:string
let str = substitute(str, '\m&lt;', '<', 'g')
let str = substitute(str, '\m&gt;', '>', 'g')
let str = substitute(str, '\m&quot;', '"', 'g')
let str = substitute(str, '\m&apos;', "'", 'g')
let str = substitute(str, '\m&amp;', '\&', 'g')
return str
endfunction " }}}2
1 0.000003 function! syntastic#util#redraw(full) " {{{2
if a:full
redraw!
else
redraw
endif
endfunction " }}}2
1 0.000003 function! syntastic#util#dictFilter(errors, filter) " {{{2
let rules = s:translateFilter(a:filter)
" call syntastic#log#debug(g:SyntasticDebugFilters, "applying filter:", rules)
try
call filter(a:errors, rules)
catch /\m^Vim\%((\a\+)\)\=:E/
let msg = matchstr(v:exception, '\m^Vim\%((\a\+)\)\=:\zs.*')
call syntastic#log#error('quiet_messages: ' . msg)
endtry
endfunction " }}}2
" }}}1
" Private functions {{{1
1 0.000004 function! s:translateFilter(filters) " {{{2
let conditions = []
for k in keys(a:filters)
if type(a:filters[k]) == type([])
call extend(conditions, map(copy(a:filters[k]), 's:translateElement(k, v:val)'))
else
call add(conditions, s:translateElement(k, a:filters[k]))
endif
endfor
if conditions == []
let conditions = ["1"]
endif
return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
endfunction " }}}2
1 0.000002 function! s:translateElement(key, term) " {{{2
if a:key ==? 'level'
let ret = 'v:val["type"] !=? ' . string(a:term[0])
elseif a:key ==? 'type'
let ret = a:term ==? 'style' ? 'get(v:val, "subtype", "") !=? "style"' : 'has_key(v:val, "subtype")'
elseif a:key ==? 'regex'
let ret = 'v:val["text"] !~? ' . string(a:term)
elseif a:key ==? 'file'
let ret = 'bufname(str2nr(v:val["bufnr"])) !~# ' . string(a:term)
else
call syntastic#log#warn('quiet_messages: ignoring invalid key ' . strtrans(string(a:key)))
let ret = "1"
endif
return ret
endfunction " }}}2
" }}}1
1 0.000014 let &cpo = s:save_cpo
1 0.000002 unlet s:save_cpo
" vim: set sw=4 sts=4 et fdm=marker:
SCRIPT /home/vagrant/.vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim
Sourced 1 time
Total time: 0.001306
Self time: 0.000560
count total (s) self (s)
"============================================================================
"File: jruby.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Leonid Shevtsov <leonid at shevtsov dot me>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
1 0.000025 if exists("g:loaded_syntastic_ruby_jruby_checker")
finish
endif
1 0.000017 let g:loaded_syntastic_ruby_jruby_checker = 1
1 0.000140 let s:save_cpo = &cpo
1 0.000058 set cpo&vim
1 0.000014 function! SyntaxCheckers_ruby_jruby_GetLocList() dict
if syntastic#util#isRunningWindows()
let exe = self.getExecEscaped()
let args = '-T1'
else
let exe = 'RUBYOPT= ' . self.getExecEscaped()
let args = ''
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args': args,
\ 'args_after': '-W1 -c' })
let errorformat =
\ '%-GSyntax OK for %f,'.
\ '%ESyntaxError in %f:%l: syntax error\, %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: warning: %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: %m,'.
\ '%-C%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
1 0.000828 0.000082 call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'jruby'})
1 0.000046 let &cpo = s:save_cpo
1 0.000010 unlet s:save_cpo
" vim: set et sts=4 sw=4:
SCRIPT /home/vagrant/.vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim
Sourced 1 time
Total time: 0.002302
Self time: 0.001513
count total (s) self (s)
"============================================================================
"File: macruby.vim
"Description: Syntax checking plugin for syntastic.vim
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
1 0.000022 if exists("g:loaded_syntastic_ruby_macruby_checker")
finish
endif
1 0.000012 let g:loaded_syntastic_ruby_macruby_checker = 1
1 0.000027 let s:save_cpo = &cpo
1 0.000973 set cpo&vim
1 0.000044 function! SyntaxCheckers_ruby_macruby_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': 'RUBYOPT= ' . self.getExecEscaped(),
\ 'args_after': '-W1 -c' })
let errorformat =
\ '%-GSyntax OK,'.
\ '%E%f:%l: syntax error\, %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: warning: %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: %m,'.
\ '%-C%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
1 0.000835 0.000046 call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'macruby'})
1 0.000036 let &cpo = s:save_cpo
1 0.000008 unlet s:save_cpo
" vim: set et sts=4 sw=4:
SCRIPT /home/vagrant/.vim/bundle/syntastic/syntax_checkers/ruby/mri.vim
Sourced 1 time
Total time: 0.001268
Self time: 0.000520
count total (s) self (s)
"============================================================================
"File: mri.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
1 0.000016 if exists("g:loaded_syntastic_ruby_mri_checker")
finish
endif
1 0.000012 let g:loaded_syntastic_ruby_mri_checker = 1
1 0.000027 let s:save_cpo = &cpo
1 0.000046 set cpo&vim
1 0.000014 function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
if stridx(a:i['text'], 'assigned but unused variable') >= 0
let term = split(a:i['text'], ' - ')[1]
return '\V\<' . escape(term, '\') . '\>'
endif
return ''
endfunction
1 0.000012 function! SyntaxCheckers_ruby_mri_GetLocList() dict
if !exists('g:syntastic_ruby_exec')
let g:syntastic_ruby_exec = self.getExec()
endif
let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
if !syntastic#util#isRunningWindows()
let exe = 'RUBYOPT= ' . exe
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args_after': '-w -T1 -c' })
"this is a hack to filter out a repeated useless warning in rspec files
"containing lines like
"
" foo.should == 'bar'
"
"Which always generate the warning below. Note that ruby >= 1.9.3 includes
"the word "possibly" in the warning
let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,'
" filter out lines starting with ...
" long lines are truncated and wrapped in ... %p then returns the wrong
" column offset
let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
let errorformat .=
\ '%-GSyntax OK,'.
\ '%E%f:%l: syntax error\, %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: warning: %m,'.
\ '%Z%p^,'.
\ '%W%f:%l: %m,'.
\ '%-C%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
1 0.000781 0.000033 call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'mri',
\ 'exec': 'ruby'})
1 0.000049 let &cpo = s:save_cpo
1 0.000007 unlet s:save_cpo
" vim: set et sts=4 sw=4:
SCRIPT /home/vagrant/.vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim
Sourced 1 time
Total time: 0.002070
Self time: 0.000361
count total (s) self (s)
"============================================================================
"File: rubocop.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Recai Oktaş <[email protected]>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"
" In order to use rubocop with the default ruby checker (mri):
" let g:syntastic_ruby_checkers = ['mri', 'rubocop']
1 0.000021 if exists("g:loaded_syntastic_ruby_rubocop_checker")
finish
endif
1 0.000012 let g:loaded_syntastic_ruby_rubocop_checker = 1
1 0.000040 let s:save_cpo = &cpo
1 0.000044 set cpo&vim
1 0.000010 function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
return
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 9, 0])
endfunction
1 0.000009 function! SyntaxCheckers_ruby_rubocop_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--format emacs --silent' })
let errorformat = '%f:%l:%c: %t: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style'})
" convert rubocop severities to error types recognized by syntastic
for e in loclist
if e['type'] ==# 'F'
let e['type'] = 'E'
elseif e['type'] !=# 'W' && e['type'] !=# 'E'
let e['type'] = 'W'
endif
endfor
return loclist
endfunction
1 0.001744 0.000035 call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'rubocop'})
1 0.000034 let &cpo = s:save_cpo
1 0.000008 unlet s:save_cpo
" vim: set et sts=4 sw=4:
SCRIPT /home/vagrant/.vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim
Sourced 1 time
Total time: 0.001040
Self time: 0.000284
count total (s) self (s)
"============================================================================
"File: rubylint.vim
"Description: Checks Ruby source code using ruby-lint
"Maintainer: Yorick Peterse <[email protected]>
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
1 0.000020 if exists("g:loaded_syntastic_ruby_rubylint_checker")
finish
endif
1 0.000017 let g:loaded_syntastic_ruby_rubylint_checker = 1
1 0.000039 let s:save_cpo = &cpo
1 0.000030 set cpo&vim
1 0.000011 function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': 'analyze --presenter=syntastic' })
let errorformat = '%f:%t:%l:%c: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
1 0.000809 0.000053 call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'rubylint',
\ 'exec': 'ruby-lint'})
1 0.000038 let &cpo = s:save_cpo
1 0.000008 unlet s:save_cpo
" vim: set et sts=4 sw=4:
FUNCTION syntastic#log#debug()
Called 38 times
Total time: 0.000581
Self time: 0.000384
count total (s) self (s)
38 0.000484 0.000287 if !s:isDebugEnabled(a:level)
38 0.000051 return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
if a:0 > 0
" filter out dictionary functions
echomsg leader . a:msg . ' ' . strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ? filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1))
else
echomsg leader . a:msg
endif
call s:logRedirect(0)
FUNCTION <SNR>43_addToErrors()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
for err in a:errors
for key in keys(a:options)
if !has_key(err, key) || empty(err[key])
let err[key] = a:options[key]
endif
endfor
endfor
return a:errors
FUNCTION 250()
Called 5 times
Total time: 0.001942
Self time: 0.000703
count total (s) self (s)
5 0.000113 0.000076 let ft = a:checker.getFiletype()
5 0.000046 if !has_key(self._checkerRaw, ft)
1 0.000010 let self._checkerRaw[ft] = []
1 0.000008 let self._checkerMap[ft] = {}
1 0.000003 endif
5 0.000401 0.000070 call self._validateUniqueName(a:checker)
5 0.000159 0.000119 let name = a:checker.getName()
5 0.000111 call add(self._checkerRaw[ft], name)
5 0.000905 0.000074 if a:checker.isAvailable()
1 0.000016 let self._checkerMap[ft][name] = a:checker
1 0.000003 endif
FUNCTION syntastic#log#debugShowOptions()
Called 1 time
Total time: 0.000082
Self time: 0.000070
count total (s) self (s)
1 0.000036 0.000024 if !s:isDebugEnabled(a:level)
1 0.000003 return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
let vlist = copy(type(a:names) == type("") ? [a:names] : a:names)
if !empty(vlist)
call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))")
echomsg leader . join(vlist, ', ')
endif
call s:logRedirect(0)
FUNCTION syntastic#log#error()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
execute "normal \<Esc>"
echohl ErrorMsg
echomsg "syntastic: error: " . a:msg
echohl None
FUNCTION syntastic#util#shescape()
Called 3 times
Total time: 0.000130
Self time: 0.000130
count total (s) self (s)
3 0.000123 return a:string =~ '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string)
FUNCTION syntastic#util#decodeXMLEntities()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let str = a:string
let str = substitute(str, '\m&lt;', '<', 'g')
let str = substitute(str, '\m&gt;', '>', 'g')
let str = substitute(str, '\m&quot;', '"', 'g')
let str = substitute(str, '\m&apos;', "'", 'g')
let str = substitute(str, '\m&amp;', '\&', 'g')
return str
FUNCTION <SNR>45_translateFilter()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let conditions = []
for k in keys(a:filters)
if type(a:filters[k]) == type([])
call extend(conditions, map(copy(a:filters[k]), 's:translateElement(k, v:val)'))
else
call add(conditions, s:translateElement(k, a:filters[k]))
endif
endfor
if conditions == []
let conditions = ["1"]
endif
return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
FUNCTION syntastic#util#versionIsAtLeast()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
for idx in range(max([len(a:installed), len(a:required)]))
let installed_element = get(a:installed, idx, 0)
let required_element = get(a:required, idx, 0)
if installed_element != required_element
return installed_element > required_element
endif
endfor
" Everything matched, so it is at least the required version.
return 1
FUNCTION <SNR>38_translate()
Called 2 times
Total time: 0.000012
Self time: 0.000012
count total (s) self (s)
2 0.000010 return 'get(v:val, ' . string(a:key) . ', "") ==? ' . string(a:val)
FUNCTION syntastic#util#Slash()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return (!exists("+shellslash") || &shellslash) ? '/' : '\'
FUNCTION <SNR>43_skipFile()
Called 2 times
Total time: 0.000427
Self time: 0.000259
count total (s) self (s)
2 0.000038 let force_skip = exists('b:syntastic_skip_checks') ? b:syntastic_skip_checks : 0
2 0.000023 let fname = expand('%')
2 0.000358 0.000190 return force_skip || (&buftype != '') || !filereadable(fname) || getwinvar(0, '&diff') || s:ignoreFile(fname)
FUNCTION SyntaxCheckers_ruby_macruby_GetLocList()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let makeprg = self.makeprgBuild({ 'exe': 'RUBYOPT= ' . self.getExecEscaped(), 'args_after': '-W1 -c' })
let errorformat = '%-GSyntax OK,'. '%E%f:%l: syntax error\, %m,'. '%Z%p^,'. '%W%f:%l: warning: %m,'. '%Z%p^,'. '%W%f:%l: %m,'. '%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
FUNCTION SyntaxCheckers_ruby_rubylint_GetLocList()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let makeprg = self.makeprgBuild({ 'args': 'analyze --presenter=syntastic' })
let errorformat = '%f:%t:%l:%c: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
FUNCTION SyntaxCheckers_ruby_mri_GetLocList()
Called 1 time
Total time: 0.077248
Self time: 0.000293
count total (s) self (s)
1 0.000010 if !exists('g:syntastic_ruby_exec')
1 0.000055 0.000022 let g:syntastic_ruby_exec = self.getExec()
1 0.000002 endif
1 0.000255 0.000097 let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
1 0.000054 0.000017 if !syntastic#util#isRunningWindows()
1 0.000011 let exe = 'RUBYOPT= ' . exe
1 0.000003 endif
1 0.001949 0.000028 let makeprg = self.makeprgBuild({ 'exe': exe, 'args_after': '-w -T1 -c' })
"this is a hack to filter out a repeated useless warning in rspec files
"containing lines like
"
" foo.should == 'bar'
"
"Which always generate the warning below. Note that ruby >= 1.9.3 includes
"the word "possibly" in the warning
1 0.000010 let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,'
" filter out lines starting with ...
" long lines are truncated and wrapped in ... %p then returns the wrong
" column offset
1 0.000011 let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
1 0.000020 let errorformat .= '%-GSyntax OK,'. '%E%f:%l: syntax error\, %m,'. '%Z%p^,'. '%W%f:%l: warning: %m,'. '%Z%p^,'. '%W%f:%l: %m,'. '%-C%.%#'
1 0.074842 0.000036 return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
FUNCTION syntastic#util#parseShebang()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
for lnum in range(1,5)
let line = getline(lnum)
if line =~ '^#!'
let exe = matchstr(line, '\m^#!\s*\zs[^ \t]*')
let args = split(matchstr(line, '\m^#!\s*[^ \t]*\zs.*'))
return { 'exe': exe, 'args': args }
endif
endfor
return { 'exe': '', 'args': [] }
FUNCTION <SNR>44_logTimestamp_dumb()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return 'syntastic: debug: '
FUNCTION <SNR>43_CompleteCheckerName()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let checker_names = []
for ft in s:resolveFiletypes()
call extend(checker_names, keys(s:registry.getCheckersMap(ft)))
endfor
return join(checker_names, "\n")
FUNCTION syntastic#util#getVersion()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return syntastic#util#parseVersion(system(a:command))
FUNCTION syntastic#util#redraw()
Called 1 time
Total time: 0.007462
Self time: 0.007462
count total (s) self (s)
1 0.000007 if a:full
redraw!
else
1 0.007441 redraw
1 0.000004 endif
FUNCTION g:SyntasticLoclistHide()
Called 1 time
Total time: 0.000022
Self time: 0.000010
count total (s) self (s)
1 0.000018 0.000006 call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: hide')
1 0.000002 silent! lclose
FUNCTION <SNR>43_ToggleMode()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
call s:modemap.toggleMode()
call s:ClearCache()
call s:UpdateErrors(1)
call s:modemap.echoMode()
FUNCTION SyntaxCheckers_ruby_mri_GetHighlightRegex()
Called 1 time
Total time: 0.000011
Self time: 0.000011
count total (s) self (s)
1 0.000004 if stridx(a:i['text'], 'assigned but unused variable') >= 0
let term = split(a:i['text'], ' - ')[1]
return '\V\<' . escape(term, '\') . '\>'
endif
1 0.000000 return ''
FUNCTION <SNR>43_BufEnterHook()
Called 2 times
Total time: 0.000247
Self time: 0.000182
count total (s) self (s)
2 0.000116 0.000080 call syntastic#log#debug(g:SyntasticDebugAutocommands, 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) . ', &buftype = ' . string(&buftype))
" TODO: at this point there is no b:syntastic_loclist
2 0.000015 let loclist = filter(getloclist(0), 'v:val["valid"] == 1')
2 0.000047 0.000018 let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' ))
2 0.000008 if &buftype == 'quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
call g:SyntasticLoclistHide()
endif
FUNCTION syntastic#log#deprecationWarn()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if index(s:deprecation_notices_issued, a:msg) >= 0
return
endif
call add(s:deprecation_notices_issued, a:msg)
call syntastic#log#warn(a:msg)
FUNCTION <SNR>44_logTimestamp_smart()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return 'syntastic: ' . split(reltimestr(reltime(g:syntastic_start)))[0] . ': '
FUNCTION SyntaxCheckers_ruby_rubocop_GetLocList()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let makeprg = self.makeprgBuild({ 'args_after': '--format emacs --silent' })
let errorformat = '%f:%l:%c: %t: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style'})
" convert rubocop severities to error types recognized by syntastic
for e in loclist
if e['type'] ==# 'F'
let e['type'] = 'E'
elseif e['type'] !=# 'W' && e['type'] !=# 'E'
let e['type'] = 'W'
endif
endfor
return loclist
FUNCTION syntastic#log#warn()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
echohl WarningMsg
echomsg "syntastic: warning: " . a:msg
echohl None
FUNCTION syntastic#log#debugShowVariables()
Called 2 times
Total time: 0.000059
Self time: 0.000039
count total (s) self (s)
2 0.000050 0.000030 if !s:isDebugEnabled(a:level)
2 0.000005 return
endif
let leader = s:logTimestamp()
call s:logRedirect(1)
let vlist = type(a:names) == type("") ? [a:names] : a:names
for name in vlist
let msg = s:formatVariable(name)
if msg != ''
echomsg leader . msg
endif
endfor
call s:logRedirect(0)
FUNCTION <SNR>43_bashHack()
Called 1 time
Total time: 0.000962
Self time: 0.000916
count total (s) self (s)
1 0.000009 if !exists('s:bash')
1 0.000093 0.000047 if !s:running_windows && (s:uname() !~# "FreeBSD") && (s:uname() !~# "OpenBSD")
1 0.000566 let s:bash = executable('/usr/local/bin/bash') ? '/usr/local/bin/bash' : executable('/bin/bash') ? '/bin/bash' : ''
1 0.000039 else
let s:bash = ''
endif
1 0.000003 endif
1 0.000012 if g:syntastic_bash_hack && s:bash != ''
1 0.000014 let &shell = s:bash
1 0.000009 let &shellredir = '&>'
1 0.000002 endif
FUNCTION SyntaxCheckers_ruby_jruby_GetLocList()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if syntastic#util#isRunningWindows()
let exe = self.getExecEscaped()
let args = '-T1'
else
let exe = 'RUBYOPT= ' . self.getExecEscaped()
let args = ''
endif
let makeprg = self.makeprgBuild({ 'exe': exe, 'args': args, 'args_after': '-W1 -c' })
let errorformat = '%-GSyntax OK for %f,'. '%ESyntaxError in %f:%l: syntax error\, %m,'. '%Z%p^,'. '%W%f:%l: warning: %m,'. '%Z%p^,'. '%W%f:%l: %m,'. '%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
FUNCTION <SNR>43_ShowLocList()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
call g:SyntasticLoclist.current().show()
FUNCTION 184()
Called 1 time
Total time: 0.000005
Self time: 0.000005
count total (s) self (s)
1 0.000003 let newObj = copy(self)
1 0.000001 return newObj
FUNCTION 185()
Called 3 times
Total time: 0.000165
Self time: 0.000029
count total (s) self (s)
3 0.000038 0.000015 call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: refresh')
3 0.000126 0.000013 call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
FUNCTION 186()
Called 3 times
Total time: 0.000113
Self time: 0.000060
count total (s) self (s)
3 0.000032 0.000009 call syntastic#log#debug(g:SyntasticDebugNotifications, 'autoloclist: toggle')
3 0.000017 0.000010 if !a:loclist.isEmpty()
1 0.000012 0.000004 if syntastic#util#var('auto_loc_list') == 1
call a:loclist.show()
endif
1 0.000001 else
2 0.000023 0.000008 if syntastic#util#var('auto_loc_list') > 0
"TODO: this will close the loc list window if one was opened by
"something other than syntastic
2 0.000004 lclose
2 0.000001 endif
2 0.000000 endif
FUNCTION 187()
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000005 let newObj = copy(self)
1 0.000001 return newObj
FUNCTION 188()
Called 3 times
Total time: 0.000016
Self time: 0.000016
count total (s) self (s)
3 0.000014 return has('balloon_eval') && syntastic#util#var('enable_balloons')
FUNCTION 189()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let b:syntastic_balloons = {}
if self.enabled() && !a:loclist.isEmpty()
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: refresh')
let buf = bufnr('')
let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
if !empty(issues)
for i in issues
if has_key(b:syntastic_balloons, i['lnum'])
let b:syntastic_balloons[i['lnum']] .= "\n" . i['text']
else
let b:syntastic_balloons[i['lnum']] = i['text']
endif
endfor
set beval bexpr=SyntasticBalloonsExprNotifier()
endif
endif
FUNCTION <SNR>43_UpdateErrors()
Called 1 time
Total time: 0.095763
Self time: 0.000197
count total (s) self (s)
1 0.000269 0.000022 if s:skipFile()
return
endif
1 0.000086 0.000019 call s:modemap.synch()
1 0.000155 0.000027 let run_checks = !a:auto_invoked || s:modemap.allowsAutoChecking(&filetype)
1 0.000005 if run_checks
1 0.093535 0.000031 call s:CacheErrors(a:000)
1 0.000001 endif
1 0.000015 0.000007 let loclist = g:SyntasticLoclist.current()
" populate loclist and jump {{{3
1 0.000014 0.000005 let do_jump = syntastic#util#var('auto_jump')
1 0.000001 if do_jump == 2
let first = loclist.getFirstIssue()
let type = get(first, 'type', '')
let do_jump = type ==? 'E'
endif
1 0.000003 let w:syntastic_loclist_set = 0
1 0.000012 0.000004 if syntastic#util#var('always_populate_loc_list') || do_jump
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: setloclist (new)')
call setloclist(0, loclist.getRaw())
let w:syntastic_loclist_set = 1
if run_checks && do_jump && !loclist.isEmpty()
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: jump')
silent! lrewind
" XXX: Vim doesn't call autocmd commands in a predictible
" order, which can lead to missing filetype when jumping
" to a new file; the following is a workaround for the
" resulting brain damage
if &filetype == ''
silent! filetype detect
endif
endif
endif
" }}}3
1 0.001625 0.000030 call s:notifiers.refresh(loclist)
FUNCTION 190()
Called 1 time
Total time: 0.000043
Self time: 0.000043
count total (s) self (s)
1 0.000023 if has('balloon_eval')
call syntastic#log#debug(g:SyntasticDebugNotifications, 'balloons: reset')
set nobeval
endif
FUNCTION 191()
Called 5 times
Total time: 0.002120
Self time: 0.002120
count total (s) self (s)
5 0.000132 let newObj = copy(self)
5 0.000112 let newObj._filetype = a:args['filetype']
5 0.000060 let newObj._name = a:args['name']
5 0.000069 let newObj._exec = get(a:args, 'exec', newObj._name)
5 0.000042 if has_key(a:args, 'redirect')
let [filetype, name] = split(a:args['redirect'], '/')
let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_'
else
5 0.000072 let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
5 0.000014 endif
5 0.000089 let newObj._locListFunc = function(prefix . 'GetLocList')
5 0.000065 if exists('*' . prefix . 'IsAvailable')
1 0.000649 let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
1 0.000038 else
4 0.000067 let newObj._isAvailableFunc = function('SyntasticCheckerIsAvailableDefault')
4 0.000009 endif
5 0.000125 if exists('*' . prefix . 'GetHighlightRegex')
1 0.000022 let newObj._highlightRegexFunc = function(prefix . 'GetHighlightRegex')
1 0.000004 endif
5 0.000024 return newObj
FUNCTION 192()
Called 11 times
Total time: 0.000077
Self time: 0.000077
count total (s) self (s)
11 0.000056 return self._filetype
FUNCTION 193()
Called 11 times
Total time: 0.000079
Self time: 0.000079
count total (s) self (s)
11 0.000056 return self._name
FUNCTION 194()
Called 7 times
Total time: 0.000250
Self time: 0.000250
count total (s) self (s)
7 0.000124 if exists('g:syntastic_' . self._filetype . '_' . self._name . '_exec')
return expand(g:syntastic_{self._filetype}_{self._name}_exec)
endif
7 0.000026 return self._exec
FUNCTION 195()
Called 1 time
Total time: 0.000092
Self time: 0.000023
count total (s) self (s)
1 0.000090 0.000021 return syntastic#util#shescape(self.getExec())
FUNCTION 196()
Called 1 time
Total time: 0.077463
Self time: 0.000075
count total (s) self (s)
1 0.000013 let name = self._filetype . '/' . self._name
1 0.000005 try
1 0.077269 0.000021 let list = self._locListFunc()
1 0.000018 0.000010 call syntastic#log#debug(g:SyntasticDebugTrace, 'getLocList: checker ' . name . ' returned ' . v:shell_error)
1 0.000002 catch /\m\C^Syntastic: checker error$/
let list = []
call syntastic#log#error('checker ' . name . ' returned abnormal status ' . v:shell_error)
endtry
1 0.000047 0.000005 call self._populateHighlightRegexes(list)
1 0.000015 0.000007 call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
1 0.000086 0.000004 call self._quietMessages(list)
1 0.000002 return list
FUNCTION 197()
Called 1 time
Total time: 0.077551
Self time: 0.000025
count total (s) self (s)
1 0.077550 0.000024 return g:SyntasticLoclist.New(self.getLocListRaw())
FUNCTION 198()
Called 1 time
Total time: 0.001921
Self time: 0.000204
count total (s) self (s)
1 0.000013 let basename = self._filetype . '_' . self._name . '_'
1 0.000007 let parts = []
1 0.000454 0.000036 call extend(parts, self._getOpt(a:opts, basename, 'exe', self.getExecEscaped()))
1 0.000268 0.000030 call extend(parts, self._getOpt(a:opts, basename, 'args', ''))
1 0.000516 0.000037 call extend(parts, self._getOpt(a:opts, basename, 'fname', syntastic#util#shexpand('%')))
1 0.000325 0.000025 call extend(parts, self._getOpt(a:opts, basename, 'post_args', ''))
1 0.000317 0.000035 call extend(parts, self._getOpt(a:opts, basename, 'tail', ''))
1 0.000011 return join(parts)
FUNCTION 199()
Called 5 times
Total time: 0.000831
Self time: 0.000077
count total (s) self (s)
5 0.000821 0.000067 return self._isAvailableFunc()
FUNCTION syntastic#util#isRunningWindows()
Called 2 times
Total time: 0.000047
Self time: 0.000047
count total (s) self (s)
2 0.000038 return has('win16') || has('win32') || has('win64')
FUNCTION <SNR>43_ignoreFile()
Called 2 times
Total time: 0.000168
Self time: 0.000168
count total (s) self (s)
2 0.000087 let fname = fnamemodify(a:filename, ':p')
2 0.000029 for pattern in g:syntastic_ignore_files
if fname =~# pattern
return 1
endif
endfor
2 0.000006 return 0
FUNCTION <SNR>44_logRedirect()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if exists("g:syntastic_debug_file")
if a:on
try
execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file))
catch /\m^Vim\%((\a\+)\)\=:/
silent! redir END
unlet g:syntastic_debug_file
endtry
else
silent! redir END
endif
endif
FUNCTION <SNR>43_ClearCache()
Called 1 time
Total time: 0.001406
Self time: 0.000479
count total (s) self (s)
1 0.001382 0.000455 call s:notifiers.reset(g:SyntasticLoclist.current())
1 0.000020 unlet! b:syntastic_loclist
FUNCTION <SNR>43_CompleteFiletypes()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return join(s:registry.getKnownFiletypes(), "\n")
FUNCTION <SNR>43_BufReadPostHook()
Called 1 time
Total time: 0.000018
Self time: 0.000018
count total (s) self (s)
1 0.000004 if g:syntastic_check_on_open
call syntastic#log#debug(g:SyntasticDebugAutocommands, 'autocmd: BufReadPost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
call s:UpdateErrors(1)
endif
FUNCTION syntastic#util#DevNull()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if syntastic#util#isRunningWindows()
return 'NUL'
endif
return '/dev/null'
FUNCTION <SNR>45_translateElement()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if a:key ==? 'level'
let ret = 'v:val["type"] !=? ' . string(a:term[0])
elseif a:key ==? 'type'
let ret = a:term ==? 'style' ? 'get(v:val, "subtype", "") !=? "style"' : 'has_key(v:val, "subtype")'
elseif a:key ==? 'regex'
let ret = 'v:val["text"] !~? ' . string(a:term)
elseif a:key ==? 'file'
let ret = 'bufname(str2nr(v:val["bufnr"])) !~# ' . string(a:term)
else
call syntastic#log#warn('quiet_messages: ignoring invalid key ' . strtrans(string(a:key)))
let ret = "1"
endif
return ret
FUNCTION syntastic#util#bufIsActive()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
" convert to number, or hell breaks loose
let buf = str2nr(a:buffer)
if !bufloaded(buf) || !buflisted(buf)
return 0
endif
" get rid of hidden buffers
for tab in range(1, tabpagenr('$'))
if index(tabpagebuflist(tab), buf) >= 0
return 1
endif
endfor
return 0
FUNCTION <SNR>43_uname()
Called 4 times
Total time: 0.000060
Self time: 0.000060
count total (s) self (s)
4 0.000021 if !exists('s:uname')
let s:uname = system('uname')
endif
4 0.000009 return s:uname
FUNCTION SyntaxCheckers_ruby_rubocop_IsAvailable()
Called 1 time
Total time: 0.000257
Self time: 0.000222
count total (s) self (s)
1 0.000255 0.000220 return executable(self.getExec()) && syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 9, 0])
FUNCTION <SNR>43_QuitPreHook()
Called 1 time
Total time: 0.000095
Self time: 0.000048
count total (s) self (s)
1 0.000054 0.000029 call syntastic#log#debug(g:SyntasticDebugAutocommands, 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
1 0.000007 let b:syntastic_skip_checks = !g:syntastic_check_on_wq
1 0.000030 0.000008 call g:SyntasticLoclistHide()
FUNCTION SyntasticBalloonsExprNotifier()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if !exists('b:syntastic_balloons')
return ''
endif
return get(b:syntastic_balloons, v:beval_lnum, '')
FUNCTION 200()
Called 1 time
Total time: 0.000082
Self time: 0.000054
count total (s) self (s)
" wildcard quiet_messages
1 0.000021 0.000009 let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
1 0.000003 if type(quiet_filters) != type({})
call syntastic#log#warn('ignoring invalid syntastic_quiet_messages')
unlet quiet_filters
let quiet_filters = {}
endif
" per checker quiet_messages
1 0.000004 let name = self._filetype . '_' . self._name
1 0.000001 try
1 0.000018 0.000010 call extend( quiet_filters, copy(syntastic#util#var(name . '_quiet_messages', {})), 'force' )
1 0.000001 catch /\m^Vim\%((\a\+)\)\=:E712/
call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages')
endtry
1 0.000013 0.000005 call syntastic#log#debug(g:SyntasticDebugLoclist, 'quiet_messages filter:', quiet_filters)
1 0.000002 if !empty(quiet_filters)
call syntastic#util#dictFilter(a:errors, quiet_filters)
call syntastic#log#debug(g:SyntasticDebugLoclist, 'filtered by quiet_messages:', a:errors)
endif
FUNCTION 201()
Called 1 time
Total time: 0.000042
Self time: 0.000031
count total (s) self (s)
1 0.000004 if has_key(self, '_highlightRegexFunc')
2 0.000004 for e in a:errors
1 0.000002 if e['valid']
1 0.000017 0.000006 let term = self._highlightRegexFunc(e)
1 0.000003 if len(term) > 0
let e['hl'] = term
endif
1 0.000001 endif
1 0.000001 endfor
1 0.000001 endif
FUNCTION 202()
Called 5 times
Total time: 0.001559
Self time: 0.000788
count total (s) self (s)
5 0.000269 0.000104 let user_val = syntastic#util#var(a:basename . a:name)
5 0.000193 let ret = []
5 0.000365 0.000161 call extend( ret, self._shescape(get(a:opts, a:name . '_before', '')) )
5 0.000299 0.000150 call extend( ret, self._shescape(user_val != '' ? user_val : get(a:opts, a:name, a:default)) )
5 0.000385 0.000132 call extend( ret, self._shescape(get(a:opts, a:name . '_after', '')) )
5 0.000018 return ret
FUNCTION 203()
Called 15 times
Total time: 0.000606
Self time: 0.000606
count total (s) self (s)
15 0.000192 if type(a:opt) == type('') && a:opt != ''
3 0.000016 return [a:opt]
elseif type(a:opt) == type([])
return map(copy(a:opt), 'syntastic#util#shescape(v:val)')
endif
12 0.000033 return []
FUNCTION 204()
Called 1 time
Total time: 0.000006
Self time: 0.000006
count total (s) self (s)
1 0.000003 let newObj = copy(self)
1 0.000001 return newObj
FUNCTION 205()
Called 6 times
Total time: 0.000070
Self time: 0.000023
count total (s) self (s)
6 0.000070 0.000023 return syntastic#util#var('echo_current_error')
FUNCTION 206()
Called 3 times
Total time: 0.000185
Self time: 0.000067
count total (s) self (s)
3 0.000057 0.000018 if self.enabled() && !a:loclist.isEmpty()
1 0.000013 0.000005 call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: refresh')
1 0.000080 0.000009 let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
1 0.000002 let b:oldLine = -1
1 0.000006 autocmd! syntastic CursorMoved
1 0.000009 autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
1 0.000001 endif
FUNCTION 207()
Called 1 time
Total time: 0.000082
Self time: 0.000050
count total (s) self (s)
1 0.000049 0.000017 call syntastic#log#debug(g:SyntasticDebugNotifications, 'cursor: reset')
1 0.000015 autocmd! syntastic CursorMoved
1 0.000006 unlet! b:syntastic_messages
1 0.000007 let b:oldLine = -1
FUNCTION 208()
Called 1 time
Total time: 0.000036
Self time: 0.000014
count total (s) self (s)
1 0.000004 let newObj = copy(self)
1 0.000001 if !s:setup_done
1 0.000025 0.000003 call self._setup()
1 0.000002 let s:setup_done = 1
1 0.000001 endif
1 0.000001 return newObj
FUNCTION 209()
Called 6 times
Total time: 0.000721
Self time: 0.000135
count total (s) self (s)
6 0.000675 0.000089 return s:has_highlighting && syntastic#util#var('enable_highlighting')
FUNCTION syntastic#util#parseVersion()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.')
FUNCTION <SNR>43_BufWritePostHook()
Called 1 time
Total time: 0.095878
Self time: 0.000072
count total (s) self (s)
1 0.000091 0.000048 call syntastic#log#debug(g:SyntasticDebugAutocommands, 'autocmd: BufWritePost, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
1 0.095782 0.000019 call s:UpdateErrors(1)
FUNCTION <SNR>44_formatVariable()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let vals = []
if exists('g:syntastic_' . a:name)
call add(vals, 'g:syntastic_' . a:name . ' = ' . strtrans(string(g:syntastic_{a:name})))
endif
if exists('b:syntastic_' . a:name)
call add(vals, 'b:syntastic_' . a:name . ' = ' . strtrans(string(b:syntastic_{a:name})))
endif
return join(vals, ', ')
FUNCTION 210()
Called 3 times
Total time: 0.000526
Self time: 0.000251
count total (s) self (s)
3 0.000138 0.000034 if self.enabled()
3 0.000162 0.000021 call self.reset(a:loclist)
3 0.000038 0.000016 call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: refresh')
3 0.000009 let buf = bufnr('')
3 0.000035 0.000027 let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
4 0.000007 for item in issues
1 0.000004 let group = item['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
" The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is
" used to override default highlighting.
1 0.000002 if has_key(item, 'hl')
call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl'])
elseif get(item, 'col', 0)
if get(item, 'vcol', 0)
let lastcol = virtcol([item['lnum'], '$'])
let coltype = 'v'
else
let lastcol = col([item['lnum'], '$'])
let coltype = 'c'
endif
let lcol = min([lastcol, item['col']])
call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype)
endif
1 0.000001 endfor
3 0.000002 endif
FUNCTION 211()
Called 4 times
Total time: 0.000316
Self time: 0.000256
count total (s) self (s)
4 0.000011 if s:has_highlighting
4 0.000094 0.000034 call syntastic#log#debug(g:SyntasticDebugNotifications, 'highlighting: reset')
7 0.000036 for match in getmatches()
3 0.000022 if stridx(match['group'], 'Syntastic') == 0
call matchdelete(match['id'])
endif
3 0.000004 endfor
4 0.000005 endif
FUNCTION 212()
Called 1 time
Total time: 0.000022
Self time: 0.000022
count total (s) self (s)
1 0.000002 if s:has_highlighting
1 0.000003 if !hlexists('SyntasticError')
1 0.000003 highlight link SyntasticError SpellBad
1 0.000001 endif
1 0.000002 if !hlexists('SyntasticWarning')
1 0.000008 highlight link SyntasticWarning SpellCap
1 0.000001 endif
1 0.000001 endif
FUNCTION 213()
Called 5 times
Total time: 0.001049
Self time: 0.001049
count total (s) self (s)
5 0.000091 let newObj = copy(self)
5 0.000065 let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
7 0.000018 for e in llist
2 0.000007 if get(e, 'type', '') == ''
let e['type'] = 'E'
endif
2 0.000002 endfor
5 0.000765 let newObj._rawLoclist = llist
5 0.000017 let newObj._name = ''
5 0.000010 return newObj
FUNCTION 214()
Called 15 times
Total time: 0.000573
Self time: 0.000495
count total (s) self (s)
15 0.000124 if !exists("b:syntastic_loclist")
2 0.000093 0.000015 let b:syntastic_loclist = g:SyntasticLoclist.New([])
2 0.000002 endif
15 0.000067 return b:syntastic_loclist
FUNCTION 215()
Called 1 time
Total time: 0.000046
Self time: 0.000005
count total (s) self (s)
1 0.000000 let list = self.copyRaw()
1 0.000000 call extend(list, a:other.copyRaw())
1 0.000045 0.000004 return g:SyntasticLoclist.New(list)
FUNCTION 216()
Called 10 times
Total time: 0.000025
Self time: 0.000025
count total (s) self (s)
10 0.000020 return empty(self._rawLoclist)
FUNCTION 217()
Called 5 times
Total time: 0.000008
Self time: 0.000008
count total (s) self (s)
5 0.000008 return copy(self._rawLoclist)
FUNCTION 218()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return self._rawLoclist
FUNCTION 219()
Called 11 times
Total time: 0.001482
Self time: 0.001465
count total (s) self (s)
11 0.000093 if !exists("self._stl_format")
3 0.000008 let self._stl_format = ''
3 0.000003 endif
11 0.000063 if !exists("self._stl_flag")
3 0.000008 let self._stl_flag = ''
3 0.000001 endif
11 0.000049 if g:syntastic_stl_format !=# self._stl_format
3 0.000006 let self._stl_format = g:syntastic_stl_format
3 0.000006 if !empty(self._rawLoclist)
1 0.000014 0.000005 let errors = self.errors()
1 0.000012 0.000004 let warnings = self.warnings()
1 0.000002 let num_errors = len(errors)
1 0.000002 let num_warnings = len(warnings)
1 0.000002 let num_issues = len(self._rawLoclist)
1 0.000002 let output = self._stl_format
"hide stuff wrapped in %E(...) unless there are errors
1 0.000011 let output = substitute(output, '\m\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
"hide stuff wrapped in %W(...) unless there are warnings
1 0.000007 let output = substitute(output, '\m\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
"hide stuff wrapped in %B(...) unless there are both errors and warnings
1 0.000007 let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
"sub in the total errors/warnings/both
1 0.000006 let output = substitute(output, '\m\C%w', num_warnings, 'g')
1 0.000005 let output = substitute(output, '\m\C%e', num_errors, 'g')
1 0.000006 let output = substitute(output, '\m\C%t', num_issues, 'g')
"first error/warning line num
1 0.000007 let output = substitute(output, '\m\C%F', num_issues ? self._rawLoclist[0]['lnum'] : '', 'g')
"first error line num
1 0.000007 let output = substitute(output, '\m\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
"first warning line num
1 0.000005 let output = substitute(output, '\m\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g')
1 0.000001 let self._stl_flag = output
1 0.000001 else
2 0.000003 let self._stl_flag = ''
2 0.000001 endif
3 0.000002 endif
11 0.000029 return self._stl_flag
FUNCTION syntastic#log#debugDump()
Called 1 time
Total time: 0.000028
Self time: 0.000019
count total (s) self (s)
1 0.000022 0.000013 if !s:isDebugEnabled(a:level)
1 0.000004 return
endif
call syntastic#log#debugShowVariables( a:level, sort(keys(g:syntastic_defaults)) )
FUNCTION syntastic#util#wideMsg()
Called 1 time
Total time: 0.008930
Self time: 0.001468
count total (s) self (s)
1 0.000013 let old_ruler = &ruler
1 0.000010 let old_showcmd = &showcmd
"This is here because it is possible for some error messages to
"begin with \n which will cause a "press enter" prompt.
1 0.000026 let msg = substitute(a:msg, "\n", "", "g")
"convert tabs to spaces so that the tabs count towards the window
"width as the proper amount of characters
1 0.000777 let chunks = split(msg, "\t", 1)
1 0.000394 let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1]
1 0.000035 let msg = strpart(msg, 0, &columns - 1)
1 0.000029 set noruler noshowcmd
1 0.007492 0.000030 call syntastic#util#redraw(0)
1 0.000082 echo msg
1 0.000015 let &ruler = old_ruler
1 0.000008 let &showcmd = old_showcmd
FUNCTION 220()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return get(self._rawLoclist, 0, {})
FUNCTION 221()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return len(self._name)
FUNCTION 222()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000002 let self._name = a:name
FUNCTION 223()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
for e in self._rawLoclist
let e['text'] .= ' [' . a:tag . ']'
endfor
FUNCTION 224()
Called 3 times
Total time: 0.000066
Self time: 0.000029
count total (s) self (s)
3 0.000009 if !exists("self._cachedErrors")
1 0.000043 0.000006 let self._cachedErrors = self.filter({'type': "E"})
1 0.000000 endif
3 0.000003 return self._cachedErrors
FUNCTION 225()
Called 3 times
Total time: 0.000055
Self time: 0.000027
count total (s) self (s)
3 0.000008 if !exists("self._cachedWarnings")
1 0.000034 0.000006 let self._cachedWarnings = self.filter({'type': "W"})
1 0.000001 endif
3 0.000005 return self._cachedWarnings
FUNCTION 226()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return !self.isEmpty()
FUNCTION 227()
Called 1 time
Total time: 0.000071
Self time: 0.000056
count total (s) self (s)
1 0.000003 if !exists("self._cachedMessages")
1 0.000002 let self._cachedMessages = {}
1 0.000025 0.000010 let errors = self.errors() + self.warnings()
2 0.000002 for e in errors
1 0.000002 let b = e['bufnr']
1 0.000002 let l = e['lnum']
1 0.000003 if !has_key(self._cachedMessages, b)
1 0.000003 let self._cachedMessages[b] = {}
1 0.000001 endif
1 0.000003 if !has_key(self._cachedMessages[b], l)
1 0.000004 let self._cachedMessages[b][l] = e['text']
1 0.000001 endif
1 0.000001 endfor
1 0.000000 endif
1 0.000003 return get(self._cachedMessages, a:buf, {})
FUNCTION 228()
Called 2 times
Total time: 0.000065
Self time: 0.000053
count total (s) self (s)
2 0.000038 0.000026 let conditions = values(map(copy(a:filters), 's:translate(v:key, v:val)'))
2 0.000010 let filter = len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
2 0.000015 return filter(copy(self._rawLoclist), filter)
FUNCTION 229()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
if !exists('w:syntastic_loclist_set')
let w:syntastic_loclist_set = 0
endif
let replace = g:syntastic_reuse_loc_lists && w:syntastic_loclist_set
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
let w:syntastic_loclist_set = 1
FUNCTION <SNR>44_isDebugEnabled_dumb()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
" poor man's bit test for bit N, assuming a:level == 2**N
return (g:syntastic_debug / a:level) % 2
FUNCTION <SNR>41_normaliseFiletype()
Called 2 times
Total time: 0.001019
Self time: 0.001019
count total (s) self (s)
2 0.000572 let ft = get(s:defaultFiletypeMap, a:ftalias, a:ftalias)
2 0.000069 let ft = get(g:syntastic_filetype_map, ft, ft)
2 0.000256 let ft = substitute(ft, '\m-', '_', 'g')
2 0.000020 return ft
FUNCTION 230()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: show')
call self.setloclist()
if !self.isEmpty()
let num = winnr()
execute "lopen " . syntastic#util#var('loc_list_height')
if num != winnr()
wincmd p
endif
" try to find the loclist window and set w:quickfix_title
let errors = getloclist(0)
for buf in tabpagebuflist()
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
let win = bufwinnr(buf)
let title = getwinvar(win, 'quickfix_title')
" TODO: try to make sure we actually own this window; sadly,
" errors == getloclist(0) is the only somewhat safe way to
" achieve that
if strpart(title, 0, 16) ==# ':SyntasticCheck ' || ( (title == '' || title ==# ':setloclist()') && errors == getloclist(0) )
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
endif
endif
endfor
endif
FUNCTION 231()
Called 1 time
Total time: 0.000033
Self time: 0.000015
count total (s) self (s)
1 0.000003 if !exists('s:SyntasticModeMapInstance')
1 0.000005 let s:SyntasticModeMapInstance = copy(self)
1 0.000021 0.000003 call s:SyntasticModeMapInstance.synch()
1 0.000000 endif
1 0.000002 return s:SyntasticModeMapInstance
FUNCTION 232()
Called 2 times
Total time: 0.000085
Self time: 0.000085
count total (s) self (s)
2 0.000013 if exists('g:syntastic_mode_map')
let self._mode = get(g:syntastic_mode_map, 'mode', 'active')
let self._activeFiletypes = get(g:syntastic_mode_map, 'active_filetypes', [])
let self._passiveFiletypes = get(g:syntastic_mode_map, 'passive_filetypes', [])
else
2 0.000008 let self._mode = 'active'
2 0.000013 let self._activeFiletypes = []
2 0.000009 let self._passiveFiletypes = []
2 0.000003 endif
FUNCTION 233()
Called 1 time
Total time: 0.000128
Self time: 0.000074
count total (s) self (s)
1 0.000026 let fts = split(a:filetype, '\m\.')
1 0.000025 0.000015 if self.isPassive()
return self._isOneFiletypeActive(fts)
else
1 0.000062 0.000018 return self._noFiletypesArePassive(fts)
endif
FUNCTION 234()
Called 1 time
Total time: 0.000010
Self time: 0.000010
count total (s) self (s)
1 0.000007 return self._mode ==# 'passive'
FUNCTION 235()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
call self.synch()
if self._mode ==# 'active'
let self._mode = 'passive'
else
let self._mode = 'active'
endif
"XXX Changing a global variable. Tsk, tsk...
if !exists('g:syntastic_mode_map')
let g:syntastic_mode_map = {}
endif
let g:syntastic_mode_map['mode'] = self._mode
FUNCTION 236()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
echo "Syntastic: " . self._mode . " mode enabled"
FUNCTION 237()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return !empty(filter(copy(a:filetypes), 'index(self._activeFiletypes, v:val) != -1'))
FUNCTION 238()
Called 1 time
Total time: 0.000044
Self time: 0.000044
count total (s) self (s)
1 0.000042 return empty(filter(copy(a:filetypes), 'index(self._passiveFiletypes, v:val) != -1'))
FUNCTION 239()
Called 1 time
Total time: 0.000305
Self time: 0.000019
count total (s) self (s)
1 0.000003 if !exists('s:SyntasticNotifiersInstance')
1 0.000004 let s:SyntasticNotifiersInstance = copy(self)
1 0.000292 0.000006 call s:SyntasticNotifiersInstance._initNotifiers()
1 0.000001 endif
1 0.000002 return s:SyntasticNotifiersInstance
FUNCTION <SNR>43_resolveFiletypes()
Called 1 time
Total time: 0.000049
Self time: 0.000049
count total (s) self (s)
1 0.000017 let type = a:0 ? a:1 : &filetype
1 0.000029 return split( get(g:syntastic_filetype_map, type, type), '\m\.' )
FUNCTION SyntasticCheckerIsAvailableDefault()
Called 4 times
Total time: 0.000497
Self time: 0.000349
count total (s) self (s)
4 0.000490 0.000342 return executable(self.getExec())
FUNCTION 240()
Called 3 times
Total time: 0.003427
Self time: 0.000538
count total (s) self (s)
3 0.000045 0.000018 call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: refresh')
18 0.000030 for type in self._enabled_types
15 0.000160 let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
15 0.000895 0.000166 if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
12 0.002214 0.000081 call self._notifier[type].refresh(a:loclist)
12 0.000004 endif
15 0.000011 endfor
FUNCTION 241()
Called 1 time
Total time: 0.000897
Self time: 0.000549
count total (s) self (s)
1 0.000125 0.000077 call syntastic#log#debug(g:SyntasticDebugNotifications, 'notifiers: reset')
6 0.000037 for type in self._enabled_types
5 0.000184 let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
" reset notifiers regardless if they are enabled or not, since
" the user might have disabled them since the last refresh();
" notifiers MUST be prepared to deal with reset() when disabled
5 0.000076 if has_key(g:{class}, 'reset')
3 0.000365 0.000065 call self._notifier[type].reset(a:loclist)
3 0.000007 endif
5 0.000012 endfor
FUNCTION 242()
Called 1 time
Total time: 0.000286
Self time: 0.000132
count total (s) self (s)
1 0.000003 let self._notifier = {}
6 0.000011 for type in s:notifier_types
5 0.000067 let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
5 0.000190 0.000036 let self._notifier[type] = g:{class}.New()
5 0.000001 endfor
1 0.000004 let self._enabled_types = copy(s:notifier_types)
FUNCTION 243()
Called 6 times
Total time: 0.000296
Self time: 0.000296
count total (s) self (s)
6 0.000110 if !exists('s:SyntasticRegistryInstance')
1 0.000019 let s:SyntasticRegistryInstance = copy(self)
1 0.000005 let s:SyntasticRegistryInstance._checkerRaw = {}
1 0.000002 let s:SyntasticRegistryInstance._checkerMap = {}
1 0.000001 endif
6 0.000030 return s:SyntasticRegistryInstance
FUNCTION 244()
Called 5 times
Total time: 0.004752
Self time: 0.000437
count total (s) self (s)
5 0.002262 0.000142 let checker = g:SyntasticChecker.New(a:args)
5 0.000353 0.000100 let registry = g:SyntasticRegistry.Instance()
5 0.002104 0.000162 call registry._registerChecker(checker)
FUNCTION 245()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckers(ft)
return !empty(self._checkerMap[ft])
FUNCTION 246()
Called 1 time
Total time: 0.011332
Self time: 0.000057
count total (s) self (s)
1 0.000207 0.000021 let ft = s:normaliseFiletype(a:ftalias)
1 0.011112 0.000023 call self._loadCheckers(ft)
1 0.000008 return self._checkerMap[ft]
FUNCTION 247()
Called 1 time
Total time: 0.012498
Self time: 0.000188
count total (s) self (s)
1 0.011355 0.000023 let checkers_map = self.getCheckersMap(a:ftalias)
1 0.000008 if empty(checkers_map)
return []
endif
1 0.000866 0.000033 let ft = s:normaliseFiletype(a:ftalias)
1 0.000111 0.000021 call self._checkDeprecation(ft)
1 0.000049 let names = !empty(a:list) ? a:list : exists('b:syntastic_checkers') ? b:syntastic_checkers : exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers : get(s:defaultCheckers, ft, 0)
1 0.000090 0.000035 return type(names) == type([]) ? self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
FUNCTION 248()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let types = keys(s:defaultCheckers)
call extend(types, keys(s:defaultFiletypeMap))
if exists('g:syntastic_filetype_map')
call extend(types, keys(g:syntastic_filetype_map))
endif
if exists('g:syntastic_extra_filetypes') && type(g:syntastic_extra_filetypes) == type([])
call extend(types, g:syntastic_extra_filetypes)
endif
return syntastic#util#unique(types)
FUNCTION 249()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
echomsg "Syntastic info for filetype: " . join(a:ftalias_list, '.')
let ft_list = syntastic#util#unique(map( copy(a:ftalias_list), 's:normaliseFiletype(v:val)' ))
if len(ft_list) != 1
let available = []
let active = []
for ft in ft_list
call extend(available, map( keys(self.getCheckersMap(ft)), 'ft . "/" . v:val' ))
call extend(active, map( self.getCheckers(ft, []), 'ft . "/" . v:val.getName()' ))
endfor
else
let ft = ft_list[0]
let available = keys(self.getCheckersMap(ft))
let active = map(self.getCheckers(ft, []), 'v:val.getName()')
endif
echomsg "Available checker(s): " . join(sort(available))
echomsg "Currently enabled checker(s): " . join(active)
FUNCTION SyntasticMake()
Called 1 time
Total time: 0.074806
Self time: 0.000748
count total (s) self (s)
1 0.000058 0.000025 call syntastic#log#debug(g:SyntasticDebugTrace, 'SyntasticMake: called with options:', a:options)
" save options and locale env variables {{{3
1 0.000009 let old_shell = &shell
1 0.000007 let old_shellredir = &shellredir
1 0.000009 let old_local_errorformat = &l:errorformat
1 0.000009 let old_errorformat = &errorformat
1 0.000019 let old_cwd = getcwd()
1 0.000011 let old_lc_messages = $LC_MESSAGES
1 0.000007 let old_lc_all = $LC_ALL
" }}}3
1 0.000981 0.000019 call s:bashHack()
1 0.000010 if has_key(a:options, 'errorformat')
1 0.000052 let &errorformat = a:options['errorformat']
1 0.000006 endif
1 0.000011 if has_key(a:options, 'cwd')
execute 'lcd ' . fnameescape(a:options['cwd'])
endif
1 0.000025 let $LC_MESSAGES = 'C'
1 0.000009 let $LC_ALL = ''
1 0.073178 0.000160 let err_lines = split(system(a:options['makeprg']), "\n", 1)
1 0.000015 let $LC_ALL = old_lc_all
1 0.000006 let $LC_MESSAGES = old_lc_messages
1 0.000041 0.000019 call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines)
1 0.000003 if has_key(a:options, 'Preprocess')
let err_lines = call(a:options['Preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess (external):', err_lines)
elseif has_key(a:options, 'preprocess')
let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines)
endif
1 0.000116 lgetexpr err_lines
1 0.000014 let errors = deepcopy(getloclist(0))
1 0.000003 if has_key(a:options, 'cwd')
execute 'lcd ' . fnameescape(old_cwd)
endif
1 0.000021 silent! lolder
" restore options {{{3
1 0.000008 let &errorformat = old_errorformat
1 0.000003 let &l:errorformat = old_local_errorformat
1 0.000004 let &shellredir = old_shellredir
1 0.000002 let &shell = old_shell
" }}}3
1 0.000037 0.000023 if !s:running_windows && (s:uname() =~ "FreeBSD" || s:uname() =~ "OpenBSD")
call syntastic#util#redraw(g:syntastic_full_redraws)
endif
1 0.000015 0.000006 call syntastic#log#debug(g:SyntasticDebugLoclist, 'raw loclist:', errors)
1 0.000004 if has_key(a:options, 'returns') && index(a:options['returns'], v:shell_error) == -1
throw 'Syntastic: checker error'
endif
1 0.000002 if has_key(a:options, 'defaults')
call s:addToErrors(errors, a:options['defaults'])
endif
" Add subtype info if present.
1 0.000001 if has_key(a:options, 'subtype')
call s:addToErrors(errors, { 'subtype': a:options['subtype'] })
endif
1 0.000002 if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess'])
for rule in a:options['Postprocess']
let errors = call(rule, [errors])
endfor
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess (external):', errors)
elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
for rule in a:options['postprocess']
let errors = call('syntastic#postprocess#' . rule, [errors])
endfor
call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess:', errors)
endif
1 0.000001 return errors
FUNCTION 251()
Called 1 time
Total time: 0.000055
Self time: 0.000055
count total (s) self (s)
1 0.000052 return filter( map(copy(a:list), 'get(a:checkers_map, v:val, {})'), '!empty(v:val)' )
FUNCTION 252()
Called 1 time
Total time: 0.011089
Self time: 0.002664
count total (s) self (s)
1 0.000012 if has_key(self._checkerRaw, a:filetype)
return
endif
1 0.011030 0.002605 execute "runtime! syntax_checkers/" . a:filetype . "/*.vim"
1 0.000018 if !has_key(self._checkerRaw, a:filetype)
let self._checkerRaw[a:filetype] = []
let self._checkerMap[a:filetype] = {}
endif
FUNCTION 253()
Called 5 times
Total time: 0.000331
Self time: 0.000266
count total (s) self (s)
5 0.000098 0.000065 let ft = a:checker.getFiletype()
5 0.000096 0.000064 let name = a:checker.getName()
5 0.000065 if index(self._checkerRaw[ft], name) > -1
throw 'Syntastic: Duplicate syntax checker name: ' . ft . '/' . name
endif
FUNCTION 254()
Called 1 time
Total time: 0.000090
Self time: 0.000090
count total (s) self (s)
1 0.000019 if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
call syntastic#log#deprecationWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
endif
FUNCTION 255()
Called 1 time
Total time: 0.000101
Self time: 0.000018
count total (s) self (s)
1 0.000006 let newObj = copy(self)
1 0.000001 if !s:setup_done
1 0.000087 0.000004 call self._setup()
1 0.000002 let s:setup_done = 1
1 0.000000 endif
1 0.000001 return newObj
FUNCTION 256()
Called 6 times
Total time: 0.000099
Self time: 0.000044
count total (s) self (s)
6 0.000098 0.000043 return has('signs') && syntastic#util#var('enable_signs')
FUNCTION 257()
Called 3 times
Total time: 0.001257
Self time: 0.000088
count total (s) self (s)
3 0.000039 0.000013 call syntastic#log#debug(g:SyntasticDebugNotifications, 'signs: refresh')
3 0.000045 0.000017 let old_signs = copy(self._bufSignIds())
3 0.000055 0.000014 if self.enabled()
3 0.001053 0.000016 call self._signErrors(a:loclist)
3 0.000003 endif
3 0.000049 0.000012 call self._removeSigns(old_signs)
3 0.000007 let s:first_sign_id = s:next_sign_id
FUNCTION 258()
Called 1 time
Total time: 0.000083
Self time: 0.000083
count total (s) self (s)
1 0.000005 if has('signs')
1 0.000007 if !hlexists('SyntasticErrorSign')
1 0.000007 highlight link SyntasticErrorSign error
1 0.000001 endif
1 0.000003 if !hlexists('SyntasticWarningSign')
1 0.000003 highlight link SyntasticWarningSign todo
1 0.000000 endif
1 0.000003 if !hlexists('SyntasticStyleErrorSign')
1 0.000003 highlight link SyntasticStyleErrorSign SyntasticErrorSign
1 0.000001 endif
1 0.000002 if !hlexists('SyntasticStyleWarningSign')
1 0.000003 highlight link SyntasticStyleWarningSign SyntasticWarningSign
1 0.000000 endif
1 0.000002 if !hlexists('SyntasticStyleErrorLine')
1 0.000003 highlight link SyntasticStyleErrorLine SyntasticErrorLine
1 0.000000 endif
1 0.000003 if !hlexists('SyntasticStyleWarningLine')
1 0.000003 highlight link SyntasticStyleWarningLine SyntasticWarningLine
1 0.000000 endif
" define the signs used to display syntax and style errors/warns
1 0.000009 exe 'sign define SyntasticError text=' . g:syntastic_error_symbol . ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine'
1 0.000006 exe 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol . ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine'
1 0.000006 exe 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol . ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine'
1 0.000006 exe 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol . ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine'
1 0.000001 endif
FUNCTION 259()
Called 3 times
Total time: 0.001037
Self time: 0.000927
count total (s) self (s)
3 0.000007 let loclist = a:loclist
3 0.000018 0.000010 if !loclist.isEmpty()
" errors some first, so that they are not masked by warnings
1 0.000002 let buf = bufnr('')
1 0.000054 0.000005 let issues = copy(loclist.errors())
1 0.000046 0.000006 call extend(issues, loclist.warnings())
1 0.000005 call filter(issues, 'v:val["bufnr"] == buf')
1 0.000001 let seen = {}
2 0.000005 for i in issues
1 0.000003 if !has_key(seen, i['lnum'])
1 0.000003 let seen[i['lnum']] = 1
1 0.000004 let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
1 0.000003 let sign_subtype = get(i, 'subtype', '')
1 0.000003 let sign_type = 'Syntastic' . sign_subtype . sign_severity
1 0.000753 execute "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr']
1 0.000038 0.000025 call add(self._bufSignIds(), s:next_sign_id)
1 0.000005 let s:next_sign_id += 1
1 0.000001 endif
1 0.000001 endfor
1 0.000000 endif
FUNCTION syntastic#util#unique()
Called 3 times
Total time: 0.000058
Self time: 0.000058
count total (s) self (s)
3 0.000007 let seen = {}
3 0.000005 let uniques = []
4 0.000006 for e in a:list
1 0.000002 if !has_key(seen, e)
1 0.000003 let seen[e] = 1
1 0.000005 call add(uniques, e)
1 0.000001 endif
1 0.000000 endfor
3 0.000003 return uniques
FUNCTION 260()
Called 3 times
Total time: 0.000037
Self time: 0.000037
count total (s) self (s)
3 0.000010 if has('signs')
3 0.000004 for i in a:ids
execute "sign unplace " . i
call remove(self._bufSignIds(), index(self._bufSignIds(), i))
endfor
3 0.000002 endif
FUNCTION 261()
Called 4 times
Total time: 0.000041
Self time: 0.000041
count total (s) self (s)
4 0.000017 if !exists("b:syntastic_sign_ids")
2 0.000005 let b:syntastic_sign_ids = []
2 0.000002 endif
4 0.000008 return b:syntastic_sign_ids
FUNCTION syntastic#util#var()
Called 31 times
Total time: 0.000947
Self time: 0.000947
count total (s) self (s)
31 0.000867 return exists('b:syntastic_' . a:name) ? b:syntastic_{a:name} : exists('g:syntastic_' . a:name) ? g:syntastic_{a:name} : a:0 > 0 ? a:1 : ''
FUNCTION <SNR>43_BufWinEnterHook()
Called 2 times
Total time: 0.002044
Self time: 0.000073
count total (s) self (s)
2 0.000072 0.000040 call syntastic#log#debug(g:SyntasticDebugAutocommands, 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) . ', &buftype = ' . string(&buftype))
2 0.000004 if &buftype == ''
2 0.001963 0.000024 call s:notifiers.refresh(g:SyntasticLoclist.current())
2 0.000001 endif
FUNCTION syntastic#util#shexpand()
Called 2 times
Total time: 0.000224
Self time: 0.000129
count total (s) self (s)
2 0.000218 0.000123 return syntastic#util#shescape(expand(a:string))
FUNCTION g:SyntasticRefreshCursor()
Called 2 times
Total time: 0.010563
Self time: 0.001633
count total (s) self (s)
2 0.000025 if !exists('b:syntastic_messages') || empty(b:syntastic_messages)
" file not checked
return
endif
2 0.000011 if !exists('b:oldLine')
let b:oldLine = -1
endif
2 0.000013 let l = line('.')
2 0.000007 if l == b:oldLine
return
endif
2 0.000009 let b:oldLine = l
2 0.000016 if has_key(b:syntastic_messages, l)
1 0.008958 0.000028 call syntastic#util#wideMsg(b:syntastic_messages[l])
1 0.000003 else
1 0.000009 echo
1 0.000001 endif
FUNCTION <SNR>43_CacheErrors()
Called 1 time
Total time: 0.093504
Self time: 0.000578
count total (s) self (s)
1 0.001424 0.000018 call s:ClearCache()
1 0.000897 0.000030 let newLoclist = g:SyntasticLoclist.New([])
1 0.000200 0.000020 if !s:skipFile()
" debug logging {{{3
1 0.000066 0.000032 call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'version')
1 0.000107 0.000025 call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options)
1 0.000044 0.000016 call syntastic#log#debugDump(g:SyntasticDebugVariables)
1 0.000042 0.000017 call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'aggregate_errors')
1 0.000058 0.000030 call syntastic#log#debug(g:SyntasticDebugTrace, 'getcwd() = ' . getcwd())
" }}}3
1 0.000072 0.000023 let filetypes = s:resolveFiletypes()
1 0.000055 0.000021 let aggregate_errors = syntastic#util#var('aggregate_errors')
1 0.000018 let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
1 0.000006 let clist = []
2 0.000014 for type in filetypes
1 0.012532 0.000034 call extend(clist, s:registry.getCheckers(type, a:checker_names))
1 0.000005 endfor
1 0.000007 let names = []
1 0.000009 for checker in clist
1 0.000044 0.000030 let cname = checker.getFiletype() . '/' . checker.getName()
1 0.000062 0.000024 call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
1 0.077569 0.000018 let loclist = checker.getLocList()
1 0.000008 0.000005 if !loclist.isEmpty()
1 0.000000 if decorate_errors
call loclist.decorate(cname)
endif
1 0.000000 call add(names, cname)
1 0.000066 0.000020 let newLoclist = newLoclist.extend(loclist)
1 0.000002 if !aggregate_errors
1 0.000001 break
endif
endif
endfor
" set names {{{3
1 0.000002 if !empty(names)
1 0.000054 0.000025 if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
1 0.000009 let type = substitute(names[0], '\m/.*', '', '')
1 0.000015 let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
1 0.000009 0.000005 call newLoclist.setName( name . ' ('. type . ')' )
1 0.000000 else
" checkers from mixed types
call newLoclist.setName(join(names, ', '))
endif
1 0.000001 endif
" }}}3
" issue warning about no active checkers {{{3
1 0.000002 if empty(clist)
if !empty(a:checker_names)
if len(a:checker_names) == 1
call syntastic#log#warn('checker ' . a:checker_names[0] . ' is not available')
else
call syntastic#log#warn('checkers ' . join(a:checker_names, ', ') . ' are not available')
endif
else
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: no checkers available for ' . &filetype)
endif
endif
" }}}3
1 0.000022 0.000012 call syntastic#log#debug(g:SyntasticDebugLoclist, 'aggregated:', newLoclist)
1 0.000001 endif
1 0.000003 let b:syntastic_loclist = newLoclist
FUNCTION syntastic#util#dictFilter()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let rules = s:translateFilter(a:filter)
" call syntastic#log#debug(g:SyntasticDebugFilters, "applying filter:", rules)
try
call filter(a:errors, rules)
catch /\m^Vim\%((\a\+)\)\=:E/
let msg = matchstr(v:exception, '\m^Vim\%((\a\+)\)\=:\zs.*')
call syntastic#log#error('quiet_messages: ' . msg)
endtry
FUNCTION SyntasticStatuslineFlag()
Called 11 times
Total time: 0.002284
Self time: 0.000374
count total (s) self (s)
11 0.002181 0.000271 return g:SyntasticLoclist.current().getStatuslineFlag()
FUNCTION syntastic#log#info()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
echomsg "syntastic: info: " . a:msg
FUNCTION syntastic#util#findInParent()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let here = fnamemodify(a:where, ':p')
let root = syntastic#util#Slash()
if syntastic#util#isRunningWindows() && here[1] == ':'
" The drive letter is an ever-green source of fun. That's because
" we don't care about running syntastic on Amiga these days. ;)
let root = fnamemodify(root, ':p')
let root = here[0] . root[1:]
endif
let old = ''
while here != ''
let p = split(globpath(here, a:what), '\n')
if !empty(p)
return fnamemodify(p[0], ':p')
elseif here ==? root || here ==? old
break
endif
let old = here
" we use ':h:h' rather than ':h' since ':p' adds a trailing '/'
" if 'here' is a directory
let here = fnamemodify(here, ':p:h:h')
endwhile
return ''
FUNCTION <SNR>44_isDebugEnabled_smart()
Called 42 times
Total time: 0.000238
Self time: 0.000238
count total (s) self (s)
42 0.000192 return and(g:syntastic_debug, a:level)
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 0.095878 0.000072 <SNR>43_BufWritePostHook()
1 0.095763 0.000197 <SNR>43_UpdateErrors()
1 0.093504 0.000578 <SNR>43_CacheErrors()
1 0.077551 0.000025 197()
1 0.077463 0.000075 196()
1 0.077248 0.000293 SyntaxCheckers_ruby_mri_GetLocList()
1 0.074806 0.000748 SyntasticMake()
1 0.012498 0.000188 247()
1 0.011332 0.000057 246()
1 0.011089 0.002664 252()
2 0.010563 0.001633 g:SyntasticRefreshCursor()
1 0.008930 0.001468 syntastic#util#wideMsg()
1 0.007462 syntastic#util#redraw()
5 0.004752 0.000437 244()
3 0.003427 0.000538 240()
11 0.002284 0.000374 SyntasticStatuslineFlag()
5 0.002120 191()
2 0.002044 0.000073 <SNR>43_BufWinEnterHook()
5 0.001942 0.000703 250()
1 0.001921 0.000204 198()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
1 0.007462 syntastic#util#redraw()
1 0.011089 0.002664 252()
5 0.002120 191()
2 0.010563 0.001633 g:SyntasticRefreshCursor()
1 0.008930 0.001468 syntastic#util#wideMsg()
11 0.001482 0.001465 219()
5 0.001049 213()
2 0.001019 <SNR>41_normaliseFiletype()
31 0.000947 syntastic#util#var()
3 0.001037 0.000927 259()
1 0.000962 0.000916 <SNR>43_bashHack()
5 0.001559 0.000788 202()
1 0.074806 0.000748 SyntasticMake()
5 0.001942 0.000703 250()
15 0.000606 203()
1 0.093504 0.000578 <SNR>43_CacheErrors()
1 0.000897 0.000549 241()
3 0.003427 0.000538 240()
15 0.000573 0.000495 214()
1 0.001406 0.000479 <SNR>43_ClearCache()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment