Skip to content

Instantly share code, notes, and snippets.

@rawaludin
Created September 12, 2018 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawaludin/a6c6b40145ab1f75e039eb6631411395 to your computer and use it in GitHub Desktop.
Save rawaludin/a6c6b40145ab1f75e039eb6631411395 to your computer and use it in GitHub Desktop.
Ale slow on neovim auto completion php language server
This file has been truncated, but you can view the full file.
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/fzf.vim/autoload/fzf/vim.vim
Sourced 1 time
Total time: 0.003230
Self time: 0.003210
count total (s) self (s)
" Copyright (c) 2017 Junegunn Choi
"
" MIT License
"
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be
" included in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 0.000017 let s:cpo_save = &cpo
1 0.000030 0.000022 set cpo&vim
" ------------------------------------------------------------------
" Common
" ------------------------------------------------------------------
1 0.000010 let s:is_win = has('win32') || has('win64')
1 0.000004 let s:layout_keys = ['window', 'up', 'down', 'left', 'right']
1 0.000006 let s:bin_dir = expand('<sfile>:h:h:h').'/bin/'
1 0.000088 let s:bin = {
\ 'preview': s:bin_dir.(executable('ruby') ? 'preview.rb' : 'preview.sh'),
\ 'tags': s:bin_dir.'tags.pl' }
1 0.000011 let s:TYPE = {'dict': type({}), 'funcref': type(function('call')), 'string': type(''), 'list': type([])}
1 0.000002 if s:is_win
if has('nvim')
let s:bin.preview = split(system('for %A in ("'.s:bin.preview.'") do @echo %~sA'), "\n")[0]
else
let s:bin.preview = fnamemodify(s:bin.preview, ':8')
endif
let s:bin.preview = (executable('ruby') ? 'ruby' : 'bash').' '.escape(s:bin.preview, '\')
endif
1 0.000001 let s:wide = 120
1 0.000009 function! s:extend_opts(dict, eopts, prepend)
if empty(a:eopts)
return
endif
if has_key(a:dict, 'options')
if type(a:dict.options) == s:TYPE.list && type(a:eopts) == s:TYPE.list
if a:prepend
let a:dict.options = extend(copy(a:eopts), a:dict.options)
else
call extend(a:dict.options, a:eopts)
endif
else
let all_opts = a:prepend ? [a:eopts, a:dict.options] : [a:dict.options, a:eopts]
let a:dict.options = join(map(all_opts, 'type(v:val) == s:TYPE.list ? join(map(copy(v:val), "fzf#shellescape(v:val)")) : v:val'))
endif
else
let a:dict.options = a:eopts
endif
endfunction
1 0.000002 function! s:merge_opts(dict, eopts)
return s:extend_opts(a:dict, a:eopts, 0)
endfunction
1 0.000002 function! s:prepend_opts(dict, eopts)
return s:extend_opts(a:dict, a:eopts, 1)
endfunction
" [[options to wrap], preview window expression, [toggle-preview keys...]]
1 0.000004 function! fzf#vim#with_preview(...)
" Default options
let options = {}
let window = 'right'
let args = copy(a:000)
" Options to wrap
if len(args) && type(args[0]) == s:TYPE.dict
let options = copy(args[0])
call remove(args, 0)
endif
" Preview window
if len(args) && type(args[0]) == s:TYPE.string
if args[0] !~# '^\(up\|down\|left\|right\)'
throw 'invalid preview window: '.args[0]
endif
let window = args[0]
call remove(args, 0)
endif
let preview = ['--preview-window', window, '--preview', (s:is_win ? s:bin.preview : fzf#shellescape(s:bin.preview)).' {}']
if len(args)
call extend(preview, ['--bind', join(map(args, 'v:val.":toggle-preview"'), ',')])
endif
call s:merge_opts(options, preview)
return options
endfunction
1 0.000002 function! s:remove_layout(opts)
for key in s:layout_keys
if has_key(a:opts, key)
call remove(a:opts, key)
endif
endfor
return a:opts
endfunction
1 0.000002 function! s:wrap(name, opts, bang)
" fzf#wrap does not append --expect if sink or sink* is found
let opts = copy(a:opts)
let options = ''
if has_key(opts, 'options')
let options = type(opts.options) == s:TYPE.list ? join(opts.options) : opts.options
endif
if options !~ '--expect' && has_key(opts, 'sink*')
let Sink = remove(opts, 'sink*')
let wrapped = fzf#wrap(a:name, opts, a:bang)
let wrapped['sink*'] = Sink
else
let wrapped = fzf#wrap(a:name, opts, a:bang)
endif
return wrapped
endfunction
1 0.000001 function! s:strip(str)
return substitute(a:str, '^\s*\|\s*$', '', 'g')
endfunction
1 0.000001 function! s:chomp(str)
return substitute(a:str, '\n*$', '', 'g')
endfunction
1 0.000002 function! s:escape(path)
let path = fnameescape(a:path)
return s:is_win ? escape(path, '$') : path
endfunction
1 0.000002 if v:version >= 704
1 0.000002 function! s:function(name)
return function(a:name)
endfunction
1 0.000001 else
function! s:function(name)
" By Ingo Karkat
return function(substitute(a:name, '^s:', matchstr(expand('<sfile>'), '<SNR>\d\+_\zefunction$'), ''))
endfunction
endif
1 0.000002 function! s:get_color(attr, ...)
let gui = has('termguicolors') && &termguicolors
let fam = gui ? 'gui' : 'cterm'
let pat = gui ? '^#[a-f0-9]\+' : '^[0-9]\+$'
for group in a:000
let code = synIDattr(synIDtrans(hlID(group)), a:attr, fam)
if code =~? pat
return code
endif
endfor
return ''
endfunction
1 0.000006 let s:ansi = {'black': 30, 'red': 31, 'green': 32, 'yellow': 33, 'blue': 34, 'magenta': 35, 'cyan': 36}
1 0.000001 function! s:csi(color, fg)
let prefix = a:fg ? '38;' : '48;'
if a:color[0] == '#'
return prefix.'2;'.join(map([a:color[1:2], a:color[3:4], a:color[5:6]], 'str2nr(v:val, 16)'), ';')
endif
return prefix.'5;'.a:color
endfunction
1 0.000002 function! s:ansi(str, group, default, ...)
let fg = s:get_color('fg', a:group)
let bg = s:get_color('bg', a:group)
let color = s:csi(empty(fg) ? s:ansi[a:default] : fg, 1) .
\ (empty(bg) ? '' : s:csi(bg, 0))
return printf("\x1b[%s%sm%s\x1b[m", color, a:0 ? ';1' : '', a:str)
endfunction
8 0.000014 for s:color_name in keys(s:ansi)
1 0.000016 execute "function! s:".s:color_name."(str, ...)\n"
\ " return s:ansi(a:str, get(a:, 1, ''), '".s:color_name."')\n"
6 0.000047 \ "endfunction"
7 0.000005 endfor
1 0.000001 function! s:buflisted()
return filter(range(1, bufnr('$')), 'buflisted(v:val) && getbufvar(v:val, "&filetype") != "qf"')
endfunction
1 0.000002 function! s:fzf(name, opts, extra)
let [extra, bang] = [{}, 0]
if len(a:extra) <= 1
let first = get(a:extra, 0, 0)
if type(first) == s:TYPE.dict
let extra = first
else
let bang = first
endif
elseif len(a:extra) == 2
let [extra, bang] = a:extra
else
throw 'invalid number of arguments'
endif
let eopts = has_key(extra, 'options') ? remove(extra, 'options') : ''
let merged = extend(copy(a:opts), extra)
call s:merge_opts(merged, eopts)
return fzf#run(s:wrap(a:name, merged, bang))
endfunction
1 0.000006 let s:default_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
1 0.000002 function! s:action_for(key, ...)
let default = a:0 ? a:1 : ''
let Cmd = get(get(g:, 'fzf_action', s:default_action), a:key, default)
return type(Cmd) == s:TYPE.string ? Cmd : default
endfunction
1 0.000002 function! s:open(cmd, target)
if stridx('edit', a:cmd) == 0 && fnamemodify(a:target, ':p') ==# expand('%:p')
return
endif
execute a:cmd s:escape(a:target)
endfunction
1 0.000002 function! s:align_lists(lists)
let maxes = {}
for list in a:lists
let i = 0
while i < len(list)
let maxes[i] = max([get(maxes, i, 0), len(list[i])])
let i += 1
endwhile
endfor
for list in a:lists
call map(list, "printf('%-'.maxes[v:key].'s', v:val)")
endfor
return a:lists
endfunction
1 0.000001 function! s:warn(message)
echohl WarningMsg
echom a:message
echohl None
return 0
endfunction
1 0.000003 function! fzf#vim#_uniq(list)
let visited = {}
let ret = []
for l in a:list
if !empty(l) && !has_key(visited, l)
call add(ret, l)
let visited[l] = 1
endif
endfor
return ret
endfunction
" ------------------------------------------------------------------
" Files
" ------------------------------------------------------------------
1 0.000002 function! s:shortpath()
let short = fnamemodify(getcwd(), ':~:.')
if !has('win32unix')
let short = pathshorten(short)
endif
let slash = (s:is_win && !&shellslash) ? '\' : '/'
return empty(short) ? '~'.slash : short . (short =~ escape(slash, '\').'$' ? '' : slash)
endfunction
1 0.000002 function! fzf#vim#files(dir, ...)
let args = {}
if !empty(a:dir)
if !isdirectory(expand(a:dir))
return s:warn('Invalid directory')
endif
let slash = (s:is_win && !&shellslash) ? '\\' : '/'
let dir = substitute(a:dir, '[/\\]*$', slash, '')
let args.dir = dir
else
let dir = s:shortpath()
endif
let args.options = ['-m', '--prompt', strwidth(dir) < &columns / 2 - 20 ? dir : '> ']
call s:merge_opts(args, get(g:, 'fzf_files_options', []))
return s:fzf('files', args, a:000)
endfunction
" ------------------------------------------------------------------
" Lines
" ------------------------------------------------------------------
1 0.000002 function! s:line_handler(lines)
if len(a:lines) < 2
return
endif
normal! m'
let cmd = s:action_for(a:lines[0])
if !empty(cmd) && stridx('edit', cmd) < 0
execute 'silent' cmd
endif
let keys = split(a:lines[1], '\t')
execute 'buffer' keys[0]
execute keys[2]
normal! ^zz
endfunction
1 0.000002 function! fzf#vim#_lines(all)
let cur = []
let rest = []
let buf = bufnr('')
let longest_name = 0
let display_bufnames = &columns > s:wide
if display_bufnames
let bufnames = {}
for b in s:buflisted()
let bufnames[b] = pathshorten(fnamemodify(bufname(b), ":~:."))
let longest_name = max([longest_name, len(bufnames[b])])
endfor
endif
let len_bufnames = min([15, longest_name])
for b in s:buflisted()
let lines = getbufline(b, 1, "$")
if empty(lines)
let path = fnamemodify(bufname(b), ':p')
let lines = filereadable(path) ? readfile(path) : []
endif
if display_bufnames
let bufname = bufnames[b]
if len(bufname) > len_bufnames + 1
let bufname = '…' . bufname[-(len_bufnames+1):]
endif
let bufname = printf(s:green("%".len_bufnames."s", "Directory"), bufname)
else
let bufname = ''
endif
call extend(b == buf ? cur : rest,
\ filter(
\ map(lines,
\ '(!a:all && empty(v:val)) ? "" : printf(s:blue("%2d\t", "TabLine")."%s".s:yellow("\t%4d ", "LineNr")."\t%s", b, bufname, v:key + 1, v:val)'),
\ 'a:all || !empty(v:val)'))
endfor
return [display_bufnames, extend(cur, rest)]
endfunction
1 0.000002 function! fzf#vim#lines(...)
let [display_bufnames, lines] = fzf#vim#_lines(1)
let nth = display_bufnames ? 3 : 2
let [query, args] = (a:0 && type(a:1) == type('')) ?
\ [a:1, a:000[1:]] : ['', a:000]
return s:fzf('lines', {
\ 'source': lines,
\ 'sink*': s:function('s:line_handler'),
\ 'options': ['+m', '--tiebreak=index', '--prompt', 'Lines> ', '--ansi', '--extended', '--nth='.nth.'..', '--layout=reverse-list', '--tabstop=1', '--query', query]
\}, args)
endfunction
" ------------------------------------------------------------------
" BLines
" ------------------------------------------------------------------
1 0.000003 function! s:buffer_line_handler(lines)
if len(a:lines) < 2
return
endif
normal! m'
let cmd = s:action_for(a:lines[0])
if !empty(cmd)
execute 'silent' cmd
endif
execute split(a:lines[1], '\t')[0]
normal! ^zz
endfunction
1 0.000002 function! s:buffer_lines()
return map(getline(1, "$"),
\ 'printf(s:yellow(" %4d ", "LineNr")."\t%s", v:key + 1, v:val)')
endfunction
1 0.000004 function! fzf#vim#buffer_lines(...)
let [query, args] = (a:0 && type(a:1) == type('')) ?
\ [a:1, a:000[1:]] : ['', a:000]
return s:fzf('blines', {
\ 'source': s:buffer_lines(),
\ 'sink*': s:function('s:buffer_line_handler'),
\ 'options': ['+m', '--tiebreak=index', '--prompt', 'BLines> ', '--ansi', '--extended', '--nth=2..', '--layout=reverse-list', '--tabstop=1', '--query', query]
\}, args)
endfunction
" ------------------------------------------------------------------
" Colors
" ------------------------------------------------------------------
1 0.000002 function! fzf#vim#colors(...)
let colors = split(globpath(&rtp, "colors/*.vim"), "\n")
if has('packages')
let colors += split(globpath(&packpath, "pack/*/opt/*/colors/*.vim"), "\n")
endif
return s:fzf('colors', {
\ 'source': fzf#vim#_uniq(map(colors, "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")),
\ 'sink': 'colo',
\ 'options': '+m --prompt="Colors> "'
\}, a:000)
endfunction
" ------------------------------------------------------------------
" Locate
" ------------------------------------------------------------------
1 0.000002 function! fzf#vim#locate(query, ...)
return s:fzf('locate', {
\ 'source': 'locate '.a:query,
\ 'options': '-m --prompt "Locate> "'
\}, a:000)
endfunction
" ------------------------------------------------------------------
" History[:/]
" ------------------------------------------------------------------
1 0.000002 function! s:all_files()
return fzf#vim#_uniq(map(
\ filter([expand('%')], 'len(v:val)')
\ + filter(map(s:buflisted_sorted(), 'bufname(v:val)'), 'len(v:val)')
\ + filter(copy(v:oldfiles), "filereadable(fnamemodify(v:val, ':p'))"),
\ 'fnamemodify(v:val, ":~:.")'))
endfunction
1 0.000002 function! s:history_source(type)
let max = histnr(a:type)
let fmt = ' %'.len(string(max)).'d '
let list = filter(map(range(1, max), 'histget(a:type, - v:val)'), '!empty(v:val)')
return extend([' :: Press '.s:magenta('CTRL-E', 'Special').' to edit'],
\ map(list, 's:yellow(printf(fmt, len(list) - v:key), "Number")." ".v:val'))
endfunction
1 0.000032 nnoremap <plug>(-fzf-vim-do) :execute g:__fzf_command<cr>
1 0.000009 nnoremap <plug>(-fzf-/) /
1 0.000007 nnoremap <plug>(-fzf-:) :
1 0.000003 function! s:history_sink(type, lines)
if len(a:lines) < 2
return
endif
let prefix = "\<plug>(-fzf-".a:type.')'
let key = a:lines[0]
let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*')
if key == 'ctrl-e'
call histadd(a:type, item)
redraw
call feedkeys(a:type."\<up>")
else
if a:type == ':'
call histadd(a:type, item)
endif
let g:__fzf_command = "normal ".prefix.item."\<cr>"
call feedkeys("\<plug>(-fzf-vim-do)")
endif
endfunction
1 0.000003 function! s:cmd_history_sink(lines)
call s:history_sink(':', a:lines)
endfunction
1 0.000003 function! fzf#vim#command_history(...)
return s:fzf('history-command', {
\ 'source': s:history_source(':'),
\ 'sink*': s:function('s:cmd_history_sink'),
\ 'options': '+m --ansi --prompt="Hist:> " --header-lines=1 --expect=ctrl-e --tiebreak=index'}, a:000)
endfunction
1 0.000002 function! s:search_history_sink(lines)
call s:history_sink('/', a:lines)
endfunction
1 0.000002 function! fzf#vim#search_history(...)
return s:fzf('history-search', {
\ 'source': s:history_source('/'),
\ 'sink*': s:function('s:search_history_sink'),
\ 'options': '+m --ansi --prompt="Hist/> " --header-lines=1 --expect=ctrl-e --tiebreak=index'}, a:000)
endfunction
1 0.000002 function! fzf#vim#history(...)
return s:fzf('history-files', {
\ 'source': s:all_files(),
\ 'options': ['-m', '--header-lines', !empty(expand('%')), '--prompt', 'Hist> ']
\}, a:000)
endfunction
" ------------------------------------------------------------------
" GFiles[?]
" ------------------------------------------------------------------
1 0.000002 function! s:get_git_root()
let root = split(system('git rev-parse --show-toplevel'), '\n')[0]
return v:shell_error ? '' : root
endfunction
1 0.000002 function! fzf#vim#gitfiles(args, ...)
let root = s:get_git_root()
if empty(root)
return s:warn('Not in git repo')
endif
if a:args != '?'
return s:fzf('gfiles', {
\ 'source': 'git ls-files '.a:args.(s:is_win ? '' : ' | uniq'),
\ 'dir': root,
\ 'options': '-m --prompt "GitFiles> "'
\}, a:000)
endif
" Here be dragons!
" We're trying to access the common sink function that fzf#wrap injects to
" the options dictionary.
let wrapped = fzf#wrap({
\ 'source': 'git -c color.status=always status --short --untracked-files=all',
\ 'dir': root,
\ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', 'sh -c "(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500"']
\})
call s:remove_layout(wrapped)
let wrapped.common_sink = remove(wrapped, 'sink*')
function! wrapped.newsink(lines)
let lines = extend(a:lines[0:0], map(a:lines[1:], 'substitute(v:val[3:], ".* -> ", "", "")'))
return self.common_sink(lines)
endfunction
let wrapped['sink*'] = remove(wrapped, 'newsink')
return s:fzf('gfiles-diff', wrapped, a:000)
endfunction
" ------------------------------------------------------------------
" Buffers
" ------------------------------------------------------------------
1 0.000002 function! s:find_open_window(b)
let [tcur, tcnt] = [tabpagenr() - 1, tabpagenr('$')]
for toff in range(0, tabpagenr('$') - 1)
let t = (tcur + toff) % tcnt + 1
let buffers = tabpagebuflist(t)
for w in range(1, len(buffers))
let b = buffers[w - 1]
if b == a:b
return [t, w]
endif
endfor
endfor
return [0, 0]
endfunction
1 0.000002 function! s:jump(t, w)
execute 'normal!' a:t.'gt'
execute a:w.'wincmd w'
endfunction
1 0.000001 function! s:bufopen(lines)
if len(a:lines) < 2
return
endif
let b = matchstr(a:lines[1], '\[\zs[0-9]*\ze\]')
if empty(a:lines[0]) && get(g:, 'fzf_buffers_jump')
let [t, w] = s:find_open_window(b)
if t
call s:jump(t, w)
return
endif
endif
let cmd = s:action_for(a:lines[0])
if !empty(cmd)
execute 'silent' cmd
endif
execute 'buffer' b
endfunction
1 0.000001 function! s:format_buffer(b)
let name = bufname(a:b)
let name = empty(name) ? '[No Name]' : fnamemodify(name, ":p:~:.")
let flag = a:b == bufnr('') ? s:blue('%', 'Conditional') :
\ (a:b == bufnr('#') ? s:magenta('#', 'Special') : ' ')
let modified = getbufvar(a:b, '&modified') ? s:red(' [+]', 'Exception') : ''
let readonly = getbufvar(a:b, '&modifiable') ? '' : s:green(' [RO]', 'Constant')
let extra = join(filter([modified, readonly], '!empty(v:val)'), '')
return s:strip(printf("[%s] %s\t%s\t%s", s:yellow(a:b, 'Number'), flag, name, extra))
endfunction
1 0.000001 function! s:sort_buffers(...)
let [b1, b2] = map(copy(a:000), 'get(g:fzf#vim#buffers, v:val, v:val)')
" Using minus between a float and a number in a sort function causes an error
return b1 < b2 ? 1 : -1
endfunction
1 0.000001 function! s:buflisted_sorted()
return sort(s:buflisted(), 's:sort_buffers')
endfunction
1 0.000002 function! fzf#vim#buffers(...)
let [query, args] = (a:0 && type(a:1) == type('')) ?
\ [a:1, a:000[1:]] : ['', a:000]
return s:fzf('buffers', {
\ 'source': map(s:buflisted_sorted(), 's:format_buffer(v:val)'),
\ 'sink*': s:function('s:bufopen'),
\ 'options': ['+m', '-x', '--tiebreak=index', '--header-lines=1', '--ansi', '-d', '\t', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query]
\}, args)
endfunction
" ------------------------------------------------------------------
" Ag
" ------------------------------------------------------------------
1 0.000005 function! s:ag_to_qf(line, with_column)
let parts = split(a:line, ':')
let text = join(parts[(a:with_column ? 3 : 2):], ':')
let dict = {'filename': &acd ? fnamemodify(parts[0], ':p') : parts[0], 'lnum': parts[1], 'text': text}
if a:with_column
let dict.col = parts[2]
endif
return dict
endfunction
1 0.000002 function! s:ag_handler(lines, with_column)
if len(a:lines) < 2
return
endif
let cmd = s:action_for(a:lines[0], 'e')
let list = map(filter(a:lines[1:], 'len(v:val)'), 's:ag_to_qf(v:val, a:with_column)')
if empty(list)
return
endif
let first = list[0]
try
call s:open(cmd, first.filename)
execute first.lnum
if a:with_column
execute 'normal!' first.col.'|'
endif
normal! zz
catch
endtry
if len(list) > 1
call setqflist(list)
copen
wincmd p
endif
endfunction
" query, [[ag options], options]
1 0.000003 function! fzf#vim#ag(query, ...)
if type(a:query) != s:TYPE.string
return s:warn('Invalid query argument')
endif
let query = empty(a:query) ? '^(?=.)' : a:query
let args = copy(a:000)
let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : ''
let command = ag_opts . ' ' . fzf#shellescape(query)
return call('fzf#vim#ag_raw', insert(args, command, 0))
endfunction
" ag command suffix, [options]
1 0.000002 function! fzf#vim#ag_raw(command_suffix, ...)
if !executable('ag')
return s:warn('ag is not found')
endif
return call('fzf#vim#grep', extend(['ag --nogroup --column --color '.a:command_suffix, 1], a:000))
endfunction
" command, with_column, [options]
1 0.000002 function! fzf#vim#grep(grep_command, with_column, ...)
let words = []
for word in split(a:grep_command)
if word !~# '^[a-z]'
break
endif
call add(words, word)
endfor
let words = empty(words) ? ['grep'] : words
let name = join(words, '-')
let capname = join(map(words, 'toupper(v:val[0]).v:val[1:]'), '')
let opts = {
\ 'source': a:grep_command,
\ 'column': a:with_column,
\ 'options': ['--ansi', '--prompt', capname.'> ',
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
\ '--color', 'hl:68,hl+:110']
\}
function! opts.sink(lines)
return s:ag_handler(a:lines, self.column)
endfunction
let opts['sink*'] = remove(opts, 'sink')
return s:fzf(name, opts, a:000)
endfunction
" ------------------------------------------------------------------
" BTags
" ------------------------------------------------------------------
1 0.000002 function! s:btags_source(tag_cmds)
if !filereadable(expand('%'))
throw 'Save the file first'
endif
for cmd in a:tag_cmds
let lines = split(system(cmd), "\n")
if !v:shell_error && len(lines)
break
endif
endfor
if v:shell_error
throw get(lines, 0, 'Failed to extract tags')
elseif empty(lines)
throw 'No tags found'
endif
return map(s:align_lists(map(lines, 'split(v:val, "\t")')), 'join(v:val, "\t")')
endfunction
1 0.000002 function! s:btags_sink(lines)
if len(a:lines) < 2
return
endif
normal! m'
let cmd = s:action_for(a:lines[0])
if !empty(cmd)
execute 'silent' cmd '%'
endif
let qfl = []
for line in a:lines[1:]
execute split(line, "\t")[2]
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
endfor
if len(qfl) > 1
call setqflist(qfl)
copen
wincmd p
cfirst
endif
normal! zz
endfunction
" query, [[tag commands], options]
1 0.000004 function! fzf#vim#buffer_tags(query, ...)
let args = copy(a:000)
let escaped = fzf#shellescape(expand('%'))
let null = s:is_win ? 'nul' : '/dev/null'
let sort = has('unix') && !has('win32unix') && executable('sort') ? '| sort -s -k 5' : ''
let tag_cmds = (len(args) > 1 && type(args[0]) != type({})) ? remove(args, 0) : [
\ printf('ctags -f - --sort=yes --excmd=number --language-force=%s %s 2> %s %s', &filetype, escaped, null, sort),
\ printf('ctags -f - --sort=yes --excmd=number %s 2> %s %s', escaped, null, sort)]
if type(tag_cmds) != type([])
let tag_cmds = [tag_cmds]
endif
try
return s:fzf('btags', {
\ 'source': s:btags_source(tag_cmds),
\ 'sink*': s:function('s:btags_sink'),
\ 'options': ['--layout=reverse-list', '-m', '-d', '\t', '--with-nth', '1,4..', '-n', '1', '--prompt', 'BTags> ', '--query', a:query]}, args)
catch
return s:warn(v:exception)
endtry
endfunction
" ------------------------------------------------------------------
" Tags
" ------------------------------------------------------------------
1 0.000003 function! s:tags_sink(lines)
if len(a:lines) < 2
return
endif
normal! m'
let qfl = []
let cmd = s:action_for(a:lines[0], 'e')
try
let [magic, &magic, wrapscan, &wrapscan, acd, &acd] = [&magic, 0, &wrapscan, 1, &acd, 0]
for line in a:lines[1:]
try
let parts = split(line, '\t\zs')
let excmd = matchstr(join(parts[2:-2], '')[:-2], '^.\{-}\ze;\?"\t')
let base = fnamemodify(parts[-1], ':h')
let relpath = parts[1][:-2]
let abspath = relpath =~ (s:is_win ? '^[A-Z]:\' : '^/') ? relpath : join([base, relpath], '/')
call s:open(cmd, expand(abspath, 1))
execute excmd
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
catch /^Vim:Interrupt$/
break
catch
call s:warn(v:exception)
endtry
endfor
finally
let [&magic, &wrapscan, &acd] = [magic, wrapscan, acd]
endtry
if len(qfl) > 1
call setqflist(qfl)
copen
wincmd p
clast
endif
normal! zz
endfunction
1 0.000005 function! fzf#vim#tags(query, ...)
if !executable('perl')
return s:warn('Tags command requires perl')
endif
if empty(tagfiles())
call inputsave()
echohl WarningMsg
let gen = input('tags not found. Generate? (y/N) ')
echohl None
call inputrestore()
redraw
if gen =~? '^y'
call s:warn('Preparing tags')
call system(get(g:, 'fzf_tags_command', 'ctags -R'.(s:is_win ? ' --output-format=e-ctags' : '')))
if empty(tagfiles())
return s:warn('Failed to create tags')
endif
else
return s:warn('No tags found')
endif
endif
let tagfiles = tagfiles()
let v2_limit = 1024 * 1024 * 200
for tagfile in tagfiles
let v2_limit -= getfsize(tagfile)
if v2_limit < 0
break
endif
endfor
let opts = v2_limit < 0 ? ['--algo=v1'] : []
return s:fzf('tags', {
\ 'source': 'perl '.fzf#shellescape(s:bin.tags).' '.join(map(tagfiles, 'fzf#shellescape(fnamemodify(v:val, ":p"))')),
\ 'sink*': s:function('s:tags_sink'),
\ 'options': extend(opts, ['--nth', '1..2', '-m', '--tiebreak=begin', '--prompt', 'Tags> ', '--query', a:query])}, a:000)
endfunction
" ------------------------------------------------------------------
" Snippets (UltiSnips)
" ------------------------------------------------------------------
1 0.000002 function! s:inject_snippet(line)
let snip = split(a:line, "\t")[0]
execute 'normal! a'.s:strip(snip)."\<c-r>=UltiSnips#ExpandSnippet()\<cr>"
endfunction
1 0.000002 function! fzf#vim#snippets(...)
if !exists(':UltiSnipsEdit')
return s:warn('UltiSnips not found')
endif
let list = UltiSnips#SnippetsInCurrentScope()
if empty(list)
return s:warn('No snippets available here')
endif
let aligned = sort(s:align_lists(items(list)))
let colored = map(aligned, 's:yellow(v:val[0])."\t".v:val[1]')
return s:fzf('snippets', {
\ 'source': colored,
\ 'options': '--ansi --tiebreak=index +m -n 1 -d "\t"',
\ 'sink': s:function('s:inject_snippet')}, a:000)
endfunction
" ------------------------------------------------------------------
" Commands
" ------------------------------------------------------------------
1 0.000009 let s:nbs = nr2char(0x2007)
1 0.000002 function! s:format_cmd(line)
return substitute(a:line, '\C \([A-Z]\S*\) ',
\ '\=s:nbs.s:yellow(submatch(1), "Function").s:nbs', '')
endfunction
1 0.000001 function! s:command_sink(lines)
if len(a:lines) < 2
return
endif
let cmd = matchstr(a:lines[1], s:nbs.'\zs\S*\ze'.s:nbs)
if empty(a:lines[0])
call feedkeys(':'.cmd.(a:lines[1][0] == '!' ? '' : ' '))
else
execute cmd
endif
endfunction
1 0.000002 function! s:format_excmd(ex)
let match = matchlist(a:ex, '^|:\(\S\+\)|\s*\S*\(.*\)')
return printf(' '.s:blue('%-38s', 'Statement').'%s', s:nbs.match[1].s:nbs, s:strip(match[2]))
endfunction
1 0.000001 function! s:excmds()
let help = globpath($VIMRUNTIME, 'doc/index.txt')
if empty(help)
return []
endif
let commands = []
let command = ''
for line in readfile(help)
if line =~ '^|:[^|]'
if !empty(command)
call add(commands, s:format_excmd(command))
endif
let command = line
elseif line =~ '^\s\+\S' && !empty(command)
let command .= substitute(line, '^\s*', ' ', '')
elseif !empty(commands) && line =~ '^\s*$'
break
endif
endfor
if !empty(command)
call add(commands, s:format_excmd(command))
endif
return commands
endfunction
1 0.000002 function! fzf#vim#commands(...)
redir => cout
silent command
redir END
let list = split(cout, "\n")
return s:fzf('commands', {
\ 'source': extend(extend(list[0:0], map(list[1:], 's:format_cmd(v:val)')), s:excmds()),
\ 'sink*': s:function('s:command_sink'),
\ 'options': '--ansi --expect '.get(g:, 'fzf_commands_expect', 'ctrl-x').
\ ' --tiebreak=index --header-lines 1 -x --prompt "Commands> " -n2,3,2..3 -d'.s:nbs}, a:000)
endfunction
" ------------------------------------------------------------------
" Marks
" ------------------------------------------------------------------
1 0.000002 function! s:format_mark(line)
return substitute(a:line, '\S', '\=s:yellow(submatch(0))', '')
endfunction
1 0.000001 function! s:mark_sink(lines)
if len(a:lines) < 2
return
endif
let cmd = s:action_for(a:lines[0])
if !empty(cmd)
execute 'silent' cmd
endif
execute 'normal! `'.matchstr(a:lines[1], '\S').'zz'
endfunction
1 0.000002 function! fzf#vim#marks(...)
redir => cout
silent marks
redir END
let list = split(cout, "\n")
return s:fzf('marks', {
\ 'source': extend(list[0:0], map(list[1:], 's:format_mark(v:val)')),
\ 'sink*': s:function('s:mark_sink'),
\ 'options': '+m -x --ansi --tiebreak=index --header-lines 1 --tiebreak=begin --prompt "Marks> "'}, a:000)
endfunction
" ------------------------------------------------------------------
" Help tags
" ------------------------------------------------------------------
1 0.000002 function! s:helptag_sink(line)
let [tag, file, path] = split(a:line, "\t")[0:2]
let rtp = fnamemodify(path, ':p:h:h')
if stridx(&rtp, rtp) < 0
execute 'set rtp+='.s:escape(rtp)
endif
execute 'help' tag
endfunction
1 0.000002 function! fzf#vim#helptags(...)
if !executable('grep') || !executable('perl')
return s:warn('Helptags command requires grep and perl')
endif
let sorted = sort(split(globpath(&runtimepath, 'doc/tags', 1), '\n'))
let tags = exists('*uniq') ? uniq(sorted) : fzf#vim#_uniq(sorted)
if exists('s:helptags_script')
silent! call delete(s:helptags_script)
endif
let s:helptags_script = tempname()
call writefile(['/('.(s:is_win ? '^[A-Z]:\/.*?[^:]' : '.*?').'):(.*?)\t(.*?)\t/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\n), $2, $3, $1)'], s:helptags_script)
return s:fzf('helptags', {
\ 'source': 'grep -H ".*" '.join(map(tags, 'fzf#shellescape(v:val)')).
\ ' | perl -n '.fzf#shellescape(s:helptags_script).' | sort',
\ 'sink': s:function('s:helptag_sink'),
\ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..-2']}, a:000)
endfunction
" ------------------------------------------------------------------
" File types
" ------------------------------------------------------------------
1 0.000002 function! fzf#vim#filetypes(...)
return s:fzf('filetypes', {
\ 'source': sort(map(split(globpath(&rtp, 'syntax/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")')),
\ 'sink': 'setf',
\ 'options': '+m --prompt="File types> "'
\}, a:000)
endfunction
" ------------------------------------------------------------------
" Windows
" ------------------------------------------------------------------
1 0.000002 function! s:format_win(tab, win, buf)
let modified = getbufvar(a:buf, '&modified')
let name = bufname(a:buf)
let name = empty(name) ? '[No Name]' : name
let active = tabpagewinnr(a:tab) == a:win
return (active? s:blue('> ', 'Operator') : ' ') . name . (modified? s:red(' [+]', 'Exception') : '')
endfunction
1 0.000001 function! s:windows_sink(line)
let list = matchlist(a:line, '^ *\([0-9]\+\) *\([0-9]\+\)')
call s:jump(list[1], list[2])
endfunction
1 0.000002 function! fzf#vim#windows(...)
let lines = []
for t in range(1, tabpagenr('$'))
let buffers = tabpagebuflist(t)
for w in range(1, len(buffers))
call add(lines,
\ printf('%s %s %s',
\ s:yellow(printf('%3d', t), 'Number'),
\ s:cyan(printf('%3d', w), 'String'),
\ s:format_win(t, w, buffers[w-1])))
endfor
endfor
return s:fzf('windows', {
\ 'source': extend(['Tab Win Name'], lines),
\ 'sink': s:function('s:windows_sink'),
\ 'options': '+m --ansi --tiebreak=begin --header-lines=1'}, a:000)
endfunction
" ------------------------------------------------------------------
" Commits / BCommits
" ------------------------------------------------------------------
1 0.000002 function! s:yank_to_register(data)
let @" = a:data
silent! let @* = a:data
silent! let @+ = a:data
endfunction
1 0.000001 function! s:commits_sink(lines)
if len(a:lines) < 2
return
endif
let pat = '[0-9a-f]\{7,9}'
if a:lines[0] == 'ctrl-y'
let hashes = join(filter(map(a:lines[1:], 'matchstr(v:val, pat)'), 'len(v:val)'))
return s:yank_to_register(hashes)
end
let diff = a:lines[0] == 'ctrl-d'
let cmd = s:action_for(a:lines[0], 'e')
let buf = bufnr('')
for idx in range(1, len(a:lines) - 1)
let sha = matchstr(a:lines[idx], pat)
if !empty(sha)
if diff
if idx > 1
execute 'tab sb' buf
endif
execute 'Gdiff' sha
else
" Since fugitive buffers are unlisted, we can't keep using 'e'
let c = (cmd == 'e' && idx > 1) ? 'tab split' : cmd
execute c FugitiveGenerate(sha)
endif
endif
endfor
endfunction
1 0.000002 function! s:commits(buffer_local, args)
let s:git_root = s:get_git_root()
if empty(s:git_root)
return s:warn('Not in git repository')
endif
let source = 'git log '.get(g:, 'fzf_commits_log_options', '--color=always '.fzf#shellescape('--format=%C(auto)%h%d %s %C(green)%cr'))
let current = expand('%')
let managed = 0
if !empty(current)
call system('git show '.fzf#shellescape(current).' 2> '.(s:is_win ? 'nul' : '/dev/null'))
let managed = !v:shell_error
endif
if a:buffer_local
if !managed
return s:warn('The current buffer is not in the working tree')
endif
let source .= ' --follow '.fzf#shellescape(current)
else
let source .= ' --graph'
endif
let command = a:buffer_local ? 'BCommits' : 'Commits'
let expect_keys = join(keys(get(g:, 'fzf_action', s:default_action)), ',')
let options = {
\ 'source': source,
\ 'sink*': s:function('s:commits_sink'),
\ 'options': ['--ansi', '--multi', '--tiebreak=index', '--layout=reverse-list',
\ '--inline-info', '--prompt', command.'> ', '--bind=ctrl-s:toggle-sort',
\ '--header', ':: Press '.s:magenta('CTRL-S', 'Special').' to toggle sort, '.s:magenta('CTRL-Y', 'Special').' to yank commit hashes',
\ '--expect=ctrl-y,'.expect_keys]
\ }
if a:buffer_local
let options.options[-2] .= ', '.s:magenta('CTRL-D', 'Special').' to diff'
let options.options[-1] .= ',ctrl-d'
endif
if !s:is_win && &columns > s:wide
call extend(options.options,
\ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -200'])
endif
return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args)
endfunction
1 0.000003 function! fzf#vim#commits(...)
return s:commits(0, a:000)
endfunction
1 0.000002 function! fzf#vim#buffer_commits(...)
return s:commits(1, a:000)
endfunction
" ------------------------------------------------------------------
" fzf#vim#maps(mode, opts[with count and op])
" ------------------------------------------------------------------
1 0.000002 function! s:align_pairs(list)
let maxlen = 0
let pairs = []
for elem in a:list
let match = matchlist(elem, '^\(\S*\)\s*\(.*\)$')
let [_, k, v] = match[0:2]
let maxlen = max([maxlen, len(k)])
call add(pairs, [k, substitute(v, '^\*\?[@ ]\?', '', '')])
endfor
let maxlen = min([maxlen, 35])
return map(pairs, "printf('%-'.maxlen.'s', v:val[0]).' '.v:val[1]")
endfunction
1 0.000002 function! s:highlight_keys(str)
return substitute(
\ substitute(a:str, '<[^ >]\+>', s:yellow('\0', 'Special'), 'g'),
\ '<Plug>', s:blue('<Plug>', 'SpecialKey'), 'g')
endfunction
1 0.000002 function! s:key_sink(line)
let key = matchstr(a:line, '^\S*')
redraw
call feedkeys(s:map_gv.s:map_cnt.s:map_reg, 'n')
call feedkeys(s:map_op.
\ substitute(key, '<[^ >]\+>', '\=eval("\"\\".submatch(0)."\"")', 'g'))
endfunction
1 0.000002 function! fzf#vim#maps(mode, ...)
let s:map_gv = a:mode == 'x' ? 'gv' : ''
let s:map_cnt = v:count == 0 ? '' : v:count
let s:map_reg = empty(v:register) ? '' : ('"'.v:register)
let s:map_op = a:mode == 'o' ? v:operator : ''
redir => cout
silent execute 'verbose' a:mode.'map'
redir END
let list = []
let curr = ''
for line in split(cout, "\n")
if line =~ "^\t"
let src = ' '.join(reverse(reverse(split(split(line)[-1], '/'))[0:2]), '/')
call add(list, printf('%s %s', curr, s:green(src, 'Comment')))
let curr = ''
else
let curr = line[3:]
endif
endfor
if !empty(curr)
call add(list, curr)
endif
let aligned = s:align_pairs(list)
let sorted = sort(aligned)
let colored = map(sorted, 's:highlight_keys(v:val)')
let pcolor = a:mode == 'x' ? 9 : a:mode == 'o' ? 10 : 12
return s:fzf('maps', {
\ 'source': colored,
\ 'sink': s:function('s:key_sink'),
\ 'options': '--prompt "Maps ('.a:mode.')> " --ansi --no-hscroll --nth 1,.. --color prompt:'.pcolor}, a:000)
endfunction
" ----------------------------------------------------------------------------
" fzf#vim#complete - completion helper
" ----------------------------------------------------------------------------
1 0.000030 inoremap <silent> <Plug>(-fzf-complete-trigger) <c-o>:call <sid>complete_trigger()<cr>
1 0.000002 function! s:pluck(dict, key, default)
return has_key(a:dict, a:key) ? remove(a:dict, a:key) : a:default
endfunction
1 0.000001 function! s:complete_trigger()
let opts = copy(s:opts)
call s:prepend_opts(opts, ['+m', '-q', s:query])
let opts['sink*'] = s:function('s:complete_insert')
let s:reducer = s:pluck(opts, 'reducer', s:function('s:first_line'))
call fzf#run(opts)
endfunction
" The default reducer
1 0.000001 function! s:first_line(lines)
return a:lines[0]
endfunction
1 0.000001 function! s:complete_insert(lines)
if empty(a:lines)
return
endif
let chars = strchars(s:query)
if chars == 0 | let del = ''
elseif chars == 1 | let del = '"_x'
else | let del = (chars - 1).'"_dvh'
endif
let data = call(s:reducer, [a:lines])
let ve = &ve
set ve=
execute 'normal!' ((s:eol || empty(chars)) ? '' : 'h').del.(s:eol ? 'a': 'i').data
let &ve = ve
if mode() =~ 't'
call feedkeys('a', 'n')
else
execute "normal! \<esc>la"
endif
endfunction
1 0.000002 function! s:eval(dict, key, arg)
if has_key(a:dict, a:key) && type(a:dict[a:key]) == s:TYPE.funcref
let ret = copy(a:dict)
let ret[a:key] = call(a:dict[a:key], [a:arg])
return ret
endif
return a:dict
endfunction
1 0.000002 function! fzf#vim#complete(...)
if a:0 == 0
let s:opts = fzf#wrap()
elseif type(a:1) == s:TYPE.dict
let s:opts = copy(a:1)
elseif type(a:1) == s:TYPE.string
let s:opts = extend({'source': a:1}, get(a:000, 1, fzf#wrap()))
else
echoerr 'Invalid argument: '.string(a:000)
return ''
endif
for s in ['sink', 'sink*']
if has_key(s:opts, s)
call remove(s:opts, s)
endif
endfor
let eol = col('$')
let ve = &ve
set ve=all
let s:eol = col('.') == eol
let &ve = ve
let Prefix = s:pluck(s:opts, 'prefix', '\k*$')
if col('.') == 1
let s:query = ''
else
let full_prefix = getline('.')[0 : col('.')-2]
if type(Prefix) == s:TYPE.funcref
let s:query = call(Prefix, [full_prefix])
else
let s:query = matchstr(full_prefix, Prefix)
endif
endif
let s:opts = s:eval(s:opts, 'source', s:query)
let s:opts = s:eval(s:opts, 'options', s:query)
let s:opts = s:eval(s:opts, 'extra_options', s:query)
if has_key(s:opts, 'extra_options')
call s:merge_opts(s:opts, remove(s:opts, 'extra_options'))
endif
if has_key(s:opts, 'options')
if type(s:opts.options) == s:TYPE.list
call add(s:opts.options, '--no-expect')
else
let s:opts.options .= ' --no-expect'
endif
endif
call feedkeys("\<Plug>(-fzf-complete-trigger)")
return ''
endfunction
" ------------------------------------------------------------------
1 0.000028 0.000015 let &cpo = s:cpo_save
1 0.000003 unlet s:cpo_save
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/util.vim
Sourced 1 time
Total time: 0.000863
Self time: 0.000863
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Contains miscellaneous functions
" A wrapper function for mode() so we can test calls for it.
1 0.000008 function! ale#util#Mode(...) abort
return call('mode', a:000)
endfunction
" A wrapper function for feedkeys so we can test calls for it.
1 0.000002 function! ale#util#FeedKeys(...) abort
return call('feedkeys', a:000)
endfunction
" Show a message in as small a window as possible.
"
" Vim 8 does not support echoing long messages from asynchronous callbacks,
" but NeoVim does. Small messages can be echoed in Vim 8, and larger messages
" have to be shown in preview windows.
1 0.000002 function! ale#util#ShowMessage(string) abort
if !has('nvim')
call ale#preview#CloseIfTypeMatches('ale-preview.message')
endif
" We have to assume the user is using a monospace font.
if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns)
execute 'echo a:string'
else
call ale#preview#Show(split(a:string, "\n"), {
\ 'filetype': 'ale-preview.message',
\ 'stay_here': 1,
\})
endif
endfunction
" A wrapper function for execute, so we can test executing some commands.
1 0.000002 function! ale#util#Execute(expr) abort
execute a:expr
endfunction
1 0.000006 if !exists('g:ale#util#nul_file')
" A null file for sending output to nothing.
1 0.000005 let g:ale#util#nul_file = '/dev/null'
1 0.000004 if has('win32')
let g:ale#util#nul_file = 'nul'
endif
1 0.000001 endif
" Given a job, a buffered line of data, a list of parts of lines, a mode data
" is being read in, and a callback, join the lines of output for a NeoVim job
" or socket together, and call the callback with the joined output.
"
" Note that jobs and IDs are the same thing on NeoVim.
1 0.000003 function! ale#util#JoinNeovimOutput(job, last_line, data, mode, callback) abort
if a:mode is# 'raw'
call a:callback(a:job, join(a:data, "\n"))
return ''
endif
let l:lines = a:data[:-2]
if len(a:data) > 1
let l:lines[0] = a:last_line . l:lines[0]
let l:new_last_line = a:data[-1]
else
let l:new_last_line = a:last_line . get(a:data, 0, '')
endif
for l:line in l:lines
call a:callback(a:job, l:line)
endfor
return l:new_last_line
endfunction
" Return the number of lines for a given buffer.
1 0.000002 function! ale#util#GetLineCount(buffer) abort
return len(getbufline(a:buffer, 1, '$'))
endfunction
1 0.000003 function! ale#util#GetFunction(string_or_ref) abort
if type(a:string_or_ref) is v:t_string
return function(a:string_or_ref)
endif
return a:string_or_ref
endfunction
1 0.000002 function! ale#util#Open(filename, line, column, options) abort
if get(a:options, 'open_in_tab', 0)
call ale#util#Execute('tabedit +' . a:line . ' ' . fnameescape(a:filename))
elseif bufnr(a:filename) isnot bufnr('')
" Open another file only if we need to.
call ale#util#Execute('edit +' . a:line . ' ' . fnameescape(a:filename))
else
normal! m`
endif
call cursor(a:line, a:column)
endfunction
1 0.000004 let g:ale#util#error_priority = 5
1 0.000003 let g:ale#util#warning_priority = 4
1 0.000002 let g:ale#util#info_priority = 3
1 0.000002 let g:ale#util#style_error_priority = 2
1 0.000002 let g:ale#util#style_warning_priority = 1
1 0.000002 function! ale#util#GetItemPriority(item) abort
if a:item.type is# 'I'
return g:ale#util#info_priority
endif
if a:item.type is# 'W'
if get(a:item, 'sub_type', '') is# 'style'
return g:ale#util#style_warning_priority
endif
return g:ale#util#warning_priority
endif
if get(a:item, 'sub_type', '') is# 'style'
return g:ale#util#style_error_priority
endif
return g:ale#util#error_priority
endfunction
" Compare two loclist items for ALE, sorted by their buffers, filenames, and
" line numbers and column numbers.
1 0.000002 function! ale#util#LocItemCompare(left, right) abort
if a:left.bufnr < a:right.bufnr
return -1
endif
if a:left.bufnr > a:right.bufnr
return 1
endif
if a:left.bufnr == -1
if a:left.filename < a:right.filename
return -1
endif
if a:left.filename > a:right.filename
return 1
endif
endif
if a:left.lnum < a:right.lnum
return -1
endif
if a:left.lnum > a:right.lnum
return 1
endif
if a:left.col < a:right.col
return -1
endif
if a:left.col > a:right.col
return 1
endif
" When either of the items lacks a problem type, then the two items should
" be considered equal. This is important for loclist jumping.
if !has_key(a:left, 'type') || !has_key(a:right, 'type')
return 0
endif
let l:left_priority = ale#util#GetItemPriority(a:left)
let l:right_priority = ale#util#GetItemPriority(a:right)
if l:left_priority < l:right_priority
return -1
endif
if l:left_priority > l:right_priority
return 1
endif
return 0
endfunction
" Compare two loclist items, including the text for the items.
"
" This function can be used for de-duplicating lists.
1 0.000002 function! ale#util#LocItemCompareWithText(left, right) abort
let l:cmp_value = ale#util#LocItemCompare(a:left, a:right)
if l:cmp_value
return l:cmp_value
endif
if a:left.text < a:right.text
return -1
endif
if a:left.text > a:right.text
return 1
endif
return 0
endfunction
" This function will perform a binary search and a small sequential search
" on the list to find the last problem in the buffer and line which is
" on or before the column. The index of the problem will be returned.
"
" -1 will be returned if nothing can be found.
1 0.000003 function! ale#util#BinarySearch(loclist, buffer, line, column) abort
let l:min = 0
let l:max = len(a:loclist) - 1
while 1
if l:max < l:min
return -1
endif
let l:mid = (l:min + l:max) / 2
let l:item = a:loclist[l:mid]
" Binary search for equal buffers, equal lines, then near columns.
if l:item.bufnr < a:buffer
let l:min = l:mid + 1
elseif l:item.bufnr > a:buffer
let l:max = l:mid - 1
elseif l:item.lnum < a:line
let l:min = l:mid + 1
elseif l:item.lnum > a:line
let l:max = l:mid - 1
else
" This part is a small sequential search.
let l:index = l:mid
" Search backwards to find the first problem on the line.
while l:index > 0
\&& a:loclist[l:index - 1].bufnr == a:buffer
\&& a:loclist[l:index - 1].lnum == a:line
let l:index -= 1
endwhile
" Find the last problem on or before this column.
while l:index < l:max
\&& a:loclist[l:index + 1].bufnr == a:buffer
\&& a:loclist[l:index + 1].lnum == a:line
\&& a:loclist[l:index + 1].col <= a:column
let l:index += 1
endwhile
" Scan forwards to find the last item on the column for the item
" we found, which will have the most serious problem.
let l:item_column = a:loclist[l:index].col
while l:index < l:max
\&& a:loclist[l:index + 1].bufnr == a:buffer
\&& a:loclist[l:index + 1].lnum == a:line
\&& a:loclist[l:index + 1].col == l:item_column
let l:index += 1
endwhile
return l:index
endif
endwhile
endfunction
" A function for testing if a function is running inside a sandbox.
" See :help sandbox
1 0.000002 function! ale#util#InSandbox() abort
try
let &l:equalprg=&l:equalprg
catch /E48/
" E48 is the sandbox error.
return 1
endtry
return 0
endfunction
1 0.000001 function! ale#util#Tempname() abort
let l:clear_tempdir = 0
if exists('$TMPDIR') && empty($TMPDIR)
let l:clear_tempdir = 1
let $TMPDIR = '/tmp'
endif
try
let l:name = tempname() " no-custom-checks
finally
if l:clear_tempdir
let $TMPDIR = ''
endif
endtry
return l:name
endfunction
" Given a single line, or a List of lines, and a single pattern, or a List
" of patterns, return all of the matches for the lines(s) from the given
" patterns, using matchlist().
"
" Only the first pattern which matches a line will be returned.
1 0.000002 function! ale#util#GetMatches(lines, patterns) abort
let l:matches = []
let l:lines = type(a:lines) is v:t_list ? a:lines : [a:lines]
let l:patterns = type(a:patterns) is v:t_list ? a:patterns : [a:patterns]
for l:line in l:lines
for l:pattern in l:patterns
let l:match = matchlist(l:line, l:pattern)
if !empty(l:match)
call add(l:matches, l:match)
break
endif
endfor
endfor
return l:matches
endfunction
1 0.000004 function! s:LoadArgCount(function) abort
let l:Function = a:function
redir => l:output
silent! function Function
redir END
if !exists('l:output')
return 0
endif
let l:match = matchstr(split(l:output, "\n")[0], '\v\([^)]+\)')[1:-2]
let l:arg_list = filter(split(l:match, ', '), 'v:val isnot# ''...''')
return len(l:arg_list)
endfunction
" Given the name of a function, a Funcref, or a lambda, return the number
" of named arguments for a function.
1 0.000002 function! ale#util#FunctionArgCount(function) abort
let l:Function = ale#util#GetFunction(a:function)
let l:count = s:LoadArgCount(l:Function)
" If we failed to get the count, forcibly load the autoload file, if the
" function is an autoload function. autoload functions aren't normally
" defined until they are called.
if l:count == 0
let l:function_name = matchlist(string(l:Function), 'function([''"]\(.\+\)[''"])')[1]
if l:function_name =~# '#'
execute 'runtime autoload/' . join(split(l:function_name, '#')[:-2], '/') . '.vim'
let l:count = s:LoadArgCount(l:Function)
endif
endif
return l:count
endfunction
" Escape a string so the characters in it will be safe for use inside of PCRE
" or RE2 regular expressions without characters having special meanings.
1 0.000002 function! ale#util#EscapePCRE(unsafe_string) abort
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g')
endfunction
" Escape a string so that it can be used as a literal string inside an evaled
" vim command.
1 0.000004 function! ale#util#EscapeVim(unsafe_string) abort
return "'" . substitute(a:unsafe_string, "'", "''", 'g') . "'"
endfunction
" Given a String or a List of String values, try and decode the string(s)
" as a JSON value which can be decoded with json_decode. If the JSON string
" is invalid, the default argument value will be returned instead.
"
" This function is useful in code where the data can't be trusted to be valid
" JSON, and where throwing exceptions is mostly just irritating.
1 0.000002 function! ale#util#FuzzyJSONDecode(data, default) abort
if empty(a:data)
return a:default
endif
let l:str = type(a:data) is v:t_string ? a:data : join(a:data, '')
try
let l:result = json_decode(l:str)
" Vim 8 only uses the value v:none for decoding blank strings.
if !has('nvim') && l:result is v:none
return a:default
endif
return l:result
catch /E474/
return a:default
endtry
endfunction
" Write a file, including carriage return characters for DOS files.
"
" The buffer number is required for determining the fileformat setting for
" the buffer.
1 0.000002 function! ale#util#Writefile(buffer, lines, filename) abort
let l:corrected_lines = getbufvar(a:buffer, '&fileformat') is# 'dos'
\ ? map(copy(a:lines), 'v:val . "\r"')
\ : a:lines
call writefile(l:corrected_lines, a:filename) " no-custom-checks
endfunction
1 0.000003 if !exists('s:patial_timers')
1 0.000002 let s:partial_timers = {}
1 0.000001 endif
1 0.000002 function! s:ApplyPartialTimer(timer_id) abort
if has_key(s:partial_timers, a:timer_id)
let [l:Callback, l:args] = remove(s:partial_timers, a:timer_id)
call call(l:Callback, [a:timer_id] + l:args)
endif
endfunction
" Given a delay, a callback, a List of arguments, start a timer with
" timer_start() and call the callback provided with [timer_id] + args.
"
" The timer must not be stopped with timer_stop().
" Use ale#util#StopPartialTimer() instead, which can stop any timer, and will
" clear any arguments saved for executing callbacks later.
1 0.000002 function! ale#util#StartPartialTimer(delay, callback, args) abort
let l:timer_id = timer_start(a:delay, function('s:ApplyPartialTimer'))
let s:partial_timers[l:timer_id] = [a:callback, a:args]
return l:timer_id
endfunction
1 0.000002 function! ale#util#StopPartialTimer(timer_id) abort
call timer_stop(a:timer_id)
if has_key(s:partial_timers, a:timer_id)
call remove(s:partial_timers, a:timer_id)
endif
endfunction
" Given a possibly multi-byte string and a 1-based character position on a
" line, return the 1-based byte position on that line.
1 0.000002 function! ale#util#Col(str, chr) abort
if a:chr < 2
return a:chr
endif
return strlen(join(split(a:str, '\zs')[0:a:chr - 2], '')) + 1
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/linter.vim
Sourced 1 time
Total time: 0.000860
Self time: 0.000860
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Linter registration and lazy-loading
" Retrieves linters as requested by the engine, loading them if needed.
1 0.000009 let s:runtime_loaded_map = {}
1 0.000002 let s:linters = {}
" Default filetype aliases.
" The user defined aliases will be merged with this Dictionary.
"
" NOTE: Update the g:ale_linter_aliases documentation when modifying this.
1 0.000019 let s:default_ale_linter_aliases = {
\ 'Dockerfile': 'dockerfile',
\ 'csh': 'sh',
\ 'plaintex': 'tex',
\ 'systemverilog': 'verilog',
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown',
\ 'zsh': 'sh',
\}
" Default linters to run for particular filetypes.
" The user defined linter selections will be merged with this Dictionary.
"
" No linters are used for plaintext files by default.
"
" Only cargo is enabled for Rust by default.
" rpmlint is disabled by default because it can result in code execution.
" hhast is disabled by default because it executes code in the project root.
"
" NOTE: Update the g:ale_linters documentation when modifying this.
1 0.000013 let s:default_ale_linters = {
\ 'csh': ['shell'],
\ 'go': ['gofmt', 'golint', 'go vet'],
\ 'hack': ['hack'],
\ 'help': [],
\ 'perl': ['perlcritic'],
\ 'python': ['flake8', 'mypy', 'pylint'],
\ 'rust': ['cargo'],
\ 'spec': [],
\ 'text': [],
\ 'zsh': ['shell'],
\}
" Testing/debugging helper to unload all linters.
1 0.000005 function! ale#linter#Reset() abort
let s:runtime_loaded_map = {}
let s:linters = {}
endfunction
" Return a reference to the linters loaded.
" This is only for tests.
" Do not call this function.
1 0.000002 function! ale#linter#GetLintersLoaded() abort
" This command will throw from the sandbox.
let &l:equalprg=&l:equalprg
return s:linters
endfunction
1 0.000004 function! s:IsCallback(value) abort
return type(a:value) is v:t_string || type(a:value) is v:t_func
endfunction
1 0.000001 function! s:IsBoolean(value) abort
return type(a:value) is v:t_number && (a:value == 0 || a:value == 1)
endfunction
1 0.000001 function! s:LanguageGetter(buffer) dict abort
return l:self.language
endfunction
1 0.000002 function! ale#linter#PreProcess(filetype, linter) abort
if type(a:linter) isnot v:t_dict
throw 'The linter object must be a Dictionary'
endif
let l:obj = {
\ 'add_newline': get(a:linter, 'add_newline', 0),
\ 'name': get(a:linter, 'name'),
\ 'lsp': get(a:linter, 'lsp', ''),
\}
if type(l:obj.name) isnot v:t_string
throw '`name` must be defined to name the linter'
endif
let l:needs_address = l:obj.lsp is# 'socket'
let l:needs_executable = l:obj.lsp isnot# 'socket'
let l:needs_command = l:obj.lsp isnot# 'socket'
let l:needs_lsp_details = !empty(l:obj.lsp)
if empty(l:obj.lsp)
let l:obj.callback = get(a:linter, 'callback')
if !s:IsCallback(l:obj.callback)
throw '`callback` must be defined with a callback to accept output'
endif
endif
if index(['', 'socket', 'stdio', 'tsserver'], l:obj.lsp) < 0
throw '`lsp` must be either `''lsp''` or `''tsserver''` if defined'
endif
if !l:needs_executable
if has_key(a:linter, 'executable')
\|| has_key(a:linter, 'executable_callback')
throw '`executable` and `executable_callback` cannot be used when lsp == ''socket'''
endif
elseif has_key(a:linter, 'executable_callback')
let l:obj.executable_callback = a:linter.executable_callback
if !s:IsCallback(l:obj.executable_callback)
throw '`executable_callback` must be a callback if defined'
endif
elseif has_key(a:linter, 'executable')
let l:obj.executable = a:linter.executable
if type(l:obj.executable) isnot v:t_string
throw '`executable` must be a string if defined'
endif
else
throw 'Either `executable` or `executable_callback` must be defined'
endif
if !l:needs_command
if has_key(a:linter, 'command')
\|| has_key(a:linter, 'command_callback')
\|| has_key(a:linter, 'command_chain')
throw '`command` and `command_callback` and `command_chain` cannot be used when lsp == ''socket'''
endif
elseif has_key(a:linter, 'command_chain')
let l:obj.command_chain = a:linter.command_chain
if type(l:obj.command_chain) isnot v:t_list
throw '`command_chain` must be a List'
endif
if empty(l:obj.command_chain)
throw '`command_chain` must contain at least one item'
endif
let l:link_index = 0
for l:link in l:obj.command_chain
let l:err_prefix = 'The `command_chain` item ' . l:link_index . ' '
if !s:IsCallback(get(l:link, 'callback'))
throw l:err_prefix . 'must define a `callback` function'
endif
if has_key(l:link, 'output_stream')
if type(l:link.output_stream) isnot v:t_string
\|| index(['stdout', 'stderr', 'both'], l:link.output_stream) < 0
throw l:err_prefix . '`output_stream` flag must be '
\ . "'stdout', 'stderr', or 'both'"
endif
endif
if has_key(l:link, 'read_buffer') && !s:IsBoolean(l:link.read_buffer)
throw l:err_prefix . 'value for `read_buffer` must be `0` or `1`'
endif
let l:link_index += 1
endfor
elseif has_key(a:linter, 'command_callback')
let l:obj.command_callback = a:linter.command_callback
if !s:IsCallback(l:obj.command_callback)
throw '`command_callback` must be a callback if defined'
endif
elseif has_key(a:linter, 'command')
let l:obj.command = a:linter.command
if type(l:obj.command) isnot v:t_string
throw '`command` must be a string if defined'
endif
else
throw 'Either `command`, `executable_callback`, `command_chain` '
\ . 'must be defined'
endif
if (
\ has_key(a:linter, 'command')
\ + has_key(a:linter, 'command_chain')
\ + has_key(a:linter, 'command_callback')
\) > 1
throw 'Only one of `command`, `command_callback`, or `command_chain` '
\ . 'should be set'
endif
if !l:needs_address
if has_key(a:linter, 'address_callback')
throw '`address_callback` cannot be used when lsp != ''socket'''
endif
elseif has_key(a:linter, 'address_callback')
let l:obj.address_callback = a:linter.address_callback
if !s:IsCallback(l:obj.address_callback)
throw '`address_callback` must be a callback if defined'
endif
else
throw '`address_callback` must be defined for getting the LSP address'
endif
if l:needs_lsp_details
if has_key(a:linter, 'language_callback')
if has_key(a:linter, 'language')
throw 'Only one of `language` or `language_callback` '
\ . 'should be set'
endif
let l:obj.language_callback = get(a:linter, 'language_callback')
if !s:IsCallback(l:obj.language_callback)
throw '`language_callback` must be a callback for LSP linters'
endif
else
" Default to using the filetype as the language.
let l:obj.language = get(a:linter, 'language', a:filetype)
if type(l:obj.language) isnot v:t_string
throw '`language` must be a string'
endif
" Make 'language_callback' return the 'language' value.
let l:obj.language_callback = function('s:LanguageGetter')
endif
let l:obj.project_root_callback = get(a:linter, 'project_root_callback')
if !s:IsCallback(l:obj.project_root_callback)
throw '`project_root_callback` must be a callback for LSP linters'
endif
if has_key(a:linter, 'completion_filter')
let l:obj.completion_filter = a:linter.completion_filter
if !s:IsCallback(l:obj.completion_filter)
throw '`completion_filter` must be a callback'
endif
endif
if has_key(a:linter, 'initialization_options_callback')
if has_key(a:linter, 'initialization_options')
throw 'Only one of `initialization_options` or '
\ . '`initialization_options_callback` should be set'
endif
let l:obj.initialization_options_callback = a:linter.initialization_options_callback
if !s:IsCallback(l:obj.initialization_options_callback)
throw '`initialization_options_callback` must be a callback if defined'
endif
elseif has_key(a:linter, 'initialization_options')
let l:obj.initialization_options = a:linter.initialization_options
endif
endif
let l:obj.output_stream = get(a:linter, 'output_stream', 'stdout')
if type(l:obj.output_stream) isnot v:t_string
\|| index(['stdout', 'stderr', 'both'], l:obj.output_stream) < 0
throw "`output_stream` must be 'stdout', 'stderr', or 'both'"
endif
" An option indicating that this linter should only be run against the
" file on disk.
let l:obj.lint_file = get(a:linter, 'lint_file', 0)
if !s:IsBoolean(l:obj.lint_file)
throw '`lint_file` must be `0` or `1`'
endif
" An option indicating that the buffer should be read.
let l:obj.read_buffer = get(a:linter, 'read_buffer', !l:obj.lint_file)
if !s:IsBoolean(l:obj.read_buffer)
throw '`read_buffer` must be `0` or `1`'
endif
if l:obj.lint_file && l:obj.read_buffer
throw 'Only one of `lint_file` or `read_buffer` can be `1`'
endif
let l:obj.aliases = get(a:linter, 'aliases', [])
if type(l:obj.aliases) isnot v:t_list
\|| len(filter(copy(l:obj.aliases), 'type(v:val) isnot v:t_string')) > 0
throw '`aliases` must be a List of String values'
endif
return l:obj
endfunction
1 0.000004 function! ale#linter#Define(filetype, linter) abort
" This command will throw from the sandbox.
let &l:equalprg=&l:equalprg
if !has_key(s:linters, a:filetype)
let s:linters[a:filetype] = []
endif
let l:new_linter = ale#linter#PreProcess(a:filetype, a:linter)
call add(s:linters[a:filetype], l:new_linter)
endfunction
" Prevent any linters from being loaded for a given filetype.
1 0.000003 function! ale#linter#PreventLoading(filetype) abort
let s:runtime_loaded_map[a:filetype] = 1
endfunction
1 0.000003 function! ale#linter#GetAll(filetypes) abort
" Don't return linters in the sandbox.
" Otherwise a sandboxed script could modify them.
if ale#util#InSandbox()
return []
endif
let l:combined_linters = []
for l:filetype in a:filetypes
" Load linters from runtimepath if we haven't done that yet.
if !has_key(s:runtime_loaded_map, l:filetype)
execute 'silent! runtime! ale_linters/' . l:filetype . '/*.vim'
let s:runtime_loaded_map[l:filetype] = 1
endif
call extend(l:combined_linters, get(s:linters, l:filetype, []))
endfor
return l:combined_linters
endfunction
1 0.000003 function! s:GetAliasedFiletype(original_filetype) abort
let l:buffer_aliases = get(b:, 'ale_linter_aliases', {})
" b:ale_linter_aliases can be set to a List.
if type(l:buffer_aliases) is v:t_list
return l:buffer_aliases
endif
" Check for aliased filetypes first in a buffer variable,
" then the global variable,
" then in the default mapping,
" otherwise use the original filetype.
for l:dict in [
\ l:buffer_aliases,
\ g:ale_linter_aliases,
\ s:default_ale_linter_aliases,
\]
if has_key(l:dict, a:original_filetype)
return l:dict[a:original_filetype]
endif
endfor
return a:original_filetype
endfunction
1 0.000003 function! ale#linter#ResolveFiletype(original_filetype) abort
let l:filetype = s:GetAliasedFiletype(a:original_filetype)
if type(l:filetype) isnot v:t_list
return [l:filetype]
endif
return l:filetype
endfunction
1 0.000002 function! s:GetLinterNames(original_filetype) abort
let l:buffer_ale_linters = get(b:, 'ale_linters', {})
" b:ale_linters can be set to 'all'
if l:buffer_ale_linters is# 'all'
return 'all'
endif
" b:ale_linters can be set to a List.
if type(l:buffer_ale_linters) is v:t_list
return l:buffer_ale_linters
endif
" Try to get a buffer-local setting for the filetype
if has_key(l:buffer_ale_linters, a:original_filetype)
return l:buffer_ale_linters[a:original_filetype]
endif
" Try to get a global setting for the filetype
if has_key(g:ale_linters, a:original_filetype)
return g:ale_linters[a:original_filetype]
endif
" If the user has configured ALE to only enable linters explicitly, then
" don't enable any linters by default.
if g:ale_linters_explicit
return []
endif
" Try to get a default setting for the filetype
if has_key(s:default_ale_linters, a:original_filetype)
return s:default_ale_linters[a:original_filetype]
endif
return 'all'
endfunction
1 0.000002 function! ale#linter#Get(original_filetypes) abort
let l:possibly_duplicated_linters = []
" Handle dot-separated filetypes.
for l:original_filetype in split(a:original_filetypes, '\.')
let l:filetype = ale#linter#ResolveFiletype(l:original_filetype)
let l:linter_names = s:GetLinterNames(l:original_filetype)
let l:all_linters = ale#linter#GetAll(l:filetype)
let l:filetype_linters = []
if type(l:linter_names) is v:t_string && l:linter_names is# 'all'
let l:filetype_linters = l:all_linters
elseif type(l:linter_names) is v:t_list
" Select only the linters we or the user has specified.
for l:linter in l:all_linters
let l:name_list = [l:linter.name] + l:linter.aliases
for l:name in l:name_list
if index(l:linter_names, l:name) >= 0
call add(l:filetype_linters, l:linter)
break
endif
endfor
endfor
endif
call extend(l:possibly_duplicated_linters, l:filetype_linters)
endfor
let l:name_list = []
let l:combined_linters = []
" Make sure we override linters so we don't get two with the same name,
" like 'eslint' for both 'javascript' and 'typescript'
"
" Note that the reverse calls here modify the List variables.
for l:linter in reverse(l:possibly_duplicated_linters)
if index(l:name_list, l:linter.name) < 0
call add(l:name_list, l:linter.name)
call add(l:combined_linters, l:linter)
endif
endfor
return reverse(l:combined_linters)
endfunction
" Given a buffer and linter, get the executable String for the linter.
1 0.000002 function! ale#linter#GetExecutable(buffer, linter) abort
return has_key(a:linter, 'executable_callback')
\ ? ale#util#GetFunction(a:linter.executable_callback)(a:buffer)
\ : a:linter.executable
endfunction
" Given a buffer and linter, get the command String for the linter.
" The command_chain key is not supported.
1 0.000003 function! ale#linter#GetCommand(buffer, linter) abort
return has_key(a:linter, 'command_callback')
\ ? ale#util#GetFunction(a:linter.command_callback)(a:buffer)
\ : a:linter.command
endfunction
" Given a buffer and linter, get the address for connecting to the server.
1 0.000002 function! ale#linter#GetAddress(buffer, linter) abort
return has_key(a:linter, 'address_callback')
\ ? ale#util#GetFunction(a:linter.address_callback)(a:buffer)
\ : a:linter.address
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/ftplugin/php.vim
Sourced 1 time
Total time: 0.000436
Self time: 0.000436
count total (s) self (s)
" Set tab to 4 space
1 0.000029 setlocal shiftwidth=4
1 0.000007 setlocal tabstop=4
1 0.000017 setlocal softtabstop=4
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/splitjoin.vim/ftplugin/php/splitjoin.vim
Sourced 1 time
Total time: 0.000370
Self time: 0.000370
count total (s) self (s)
1 0.000031 let b:splitjoin_split_callbacks = [
\ 'sj#php#SplitMethodChain',
\ 'sj#php#SplitArray',
\ 'sj#php#SplitIfClause',
\ 'sj#php#SplitElseClause',
\ 'sj#php#SplitBraces',
\ 'sj#html#SplitTags',
\ 'sj#php#SplitPhpMarker',
\ ]
1 0.000014 let b:splitjoin_join_callbacks = [
\ 'sj#php#JoinPhpMarker',
\ 'sj#php#JoinMethodChain',
\ 'sj#php#JoinArray',
\ 'sj#php#JoinBraces',
\ 'sj#php#JoinIfClause',
\ 'sj#php#JoinElseClause',
\ 'sj#php#JoinHtmlTags',
\ ]
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/ftplugin/php.vim
Sourced 1 time
Total time: 0.005994
Self time: 0.002911
count total (s) self (s)
" Vim filetype plugin file
" Language: php
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
1 0.000013 if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
1 0.000009 let s:keepcpo= &cpo
1 0.000008 set cpo&vim
" Define some defaults in case the included ftplugins don't set them.
1 0.000002 let s:undo_ftplugin = ""
1 0.000004 let s:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .
\ "All Files (*.*)\t*.*\n"
1 0.000001 let s:match_words = ""
1 0.005295 0.002212 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
1 0.000007 let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
1 0.000006 if exists("b:undo_ftplugin")
1 0.000004 let s:undo_ftplugin = b:undo_ftplugin
1 0.000001 endif
1 0.000003 if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
1 0.000003 if exists("b:match_words")
1 0.000003 let s:match_words = b:match_words
1 0.000004 endif
1 0.000003 if exists("b:match_skip")
unlet b:match_skip
endif
" Change the :browse e filter to primarily show PHP-related files.
1 0.000004 if has("gui_win32")
let b:browsefilter="PHP Files (*.php)\t*.php\n" . s:browsefilter
endif
" ###
" Provided by Mikolaj Machowski <mikmach at wp dot pl>
1 0.000019 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\?
" Disabled changing 'iskeyword', it breaks a command such as "*"
" setlocal iskeyword+=$
1 0.000005 if exists("loaded_matchit")
1 0.000012 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' .
\ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
\ '\<while\>:\<endwhile\>,' .
\ '\<do\>:\<while\>,' .
\ '\<for\>:\<endfor\>,' .
\ '\<foreach\>:\<endforeach\>,' .
\ '(:),[:],{:},' .
\ s:match_words
1 0.000001 endif
" ###
1 0.000003 if exists('&omnifunc')
1 0.000003 setlocal omnifunc=phpcomplete#CompletePHP
1 0.000001 endif
" Section jumping: [[ and ]] provided by Antony Scriven <adscriven at gmail dot com>
1 0.000003 let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function'
1 0.000002 let s:class = '\(abstract\s\+\|final\s\+\)*class'
1 0.000001 let s:interface = 'interface'
1 0.000005 let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)'
1 0.000040 exe 'nno <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
1 0.000020 exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
1 0.000020 exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
1 0.000018 exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
1 0.000004 setlocal commentstring=/*%s*/
" Undo the stuff we changed.
1 0.000005 let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" .
\ " | unlet! b:browsefilter b:match_words | " .
\ s:undo_ftplugin
" Restore the saved compatibility options.
1 0.000006 let &cpo = s:keepcpo
1 0.000007 unlet s:keepcpo
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/splitjoin.vim/ftplugin/html/splitjoin.vim
Sourced 1 time
Total time: 0.000450
Self time: 0.000450
count total (s) self (s)
1 0.000017 if !exists('b:splitjoin_split_callbacks')
let b:splitjoin_split_callbacks = [
\ 'sj#html#SplitTags',
\ 'sj#html#SplitAttributes'
\ ]
endif
1 0.000009 if !exists('b:splitjoin_join_callbacks')
let b:splitjoin_join_callbacks = [
\ 'sj#html#JoinAttributes',
\ 'sj#html#JoinTags'
\ ]
endif
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/ftplugin/html.vim
Sourced 1 time
Total time: 0.002580
Self time: 0.001090
count total (s) self (s)
" Vim filetype plugin file
" Language: html
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
1 0.000013 if exists("b:did_ftplugin") | finish | endif
1 0.000004 let b:did_ftplugin = 1
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
1 0.000007 let s:save_cpo = &cpo
1 0.000009 set cpo-=C
1 0.000004 setlocal matchpairs+=<:>
1 0.000011 setlocal commentstring=<!--%s-->
1 0.000004 setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
1 0.000004 if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1)
setlocal formatoptions-=t formatoptions+=croql
endif
1 0.000002 if exists('&omnifunc')
1 0.000003 setlocal omnifunc=htmlcomplete#CompleteTags
1 0.002006 0.000516 call htmlcomplete#DetectOmniFlavor()
1 0.000001 endif
" HTML: thanks to Johannes Zellner and Benji Fisher.
1 0.000003 if exists("loaded_matchit")
1 0.000002 let b:match_ignorecase = 1
1 0.000006 let b:match_words = '<:>,' .
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
1 0.000001 endif
" Change the :browse e filter to primarily show HTML-related files.
1 0.000004 if has("gui_win32")
let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" .
\ "JavaScript Files (*.js)\t*.js\n" .
\ "Cascading StyleSheets (*.css)\t*.css\n" .
\ "All Files (*.*)\t*.*\n"
endif
" Undo the stuff we changed.
1 0.000009 let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc< comments< formatoptions<" .
\ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter"
" Restore the saved compatibility options.
1 0.000011 let &cpo = s:save_cpo
1 0.000006 unlet s:save_cpo
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/autoload/htmlcomplete.vim
Sourced 1 time
Total time: 0.001328
Self time: 0.001328
count total (s) self (s)
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2014 Jun 20
" Distinguish between HTML versions.
" To use with other HTML versions add another "elseif" condition to match
" proper DOCTYPE.
1 0.000008 function! htmlcomplete#DetectOmniFlavor()
if &filetype == 'xhtml'
let b:html_omni_flavor = 'xhtml10s'
else
let b:html_omni_flavor = 'html401t'
endif
let i = 1
let line = ""
while i < 10 && i < line("$")
let line = getline(i)
if line =~ '<!DOCTYPE.*\<DTD '
break
endif
let i += 1
endwhile
if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
if line =~ ' HTML 3\.2'
let b:html_omni_flavor = 'html32'
elseif line =~ ' XHTML 1\.1'
let b:html_omni_flavor = 'xhtml11'
else " two-step detection with strict/frameset/transitional
if line =~ ' XHTML 1\.0'
let b:html_omni_flavor = 'xhtml10'
elseif line =~ ' HTML 4\.01'
let b:html_omni_flavor = 'html401'
elseif line =~ ' HTML 4.0\>'
let b:html_omni_flavor = 'html40'
endif
if line =~ '\<Transitional\>'
let b:html_omni_flavor .= 't'
elseif line =~ '\<Frameset\>'
let b:html_omni_flavor .= 'f'
else
let b:html_omni_flavor .= 's'
endif
endif
endif
endfunction
1 0.000003 function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
let curline = line('.')
let compl_begin = col('.') - 2
while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)'
let start -= 1
endwhile
" Handling of entities {{{
if start >= 0 && line[start - 1] =~ '&'
let b:entitiescompl = 1
let b:compl_context = ''
return start
endif
" }}}
" Handling of <style> tag {{{
let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
let styleend = searchpair('<style\>', '', '<\/style\>', "nW")
if stylestart != 0 && styleend != 0
if stylestart <= curline && styleend >= curline
let start = col('.') - 1
let b:csscompl = 1
while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
let start -= 1
endwhile
endif
endif
" }}}
" Handling of <script> tag {{{
let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW")
let scriptend = searchpair('<script\>', '', '<\/script\>', "nW")
if scriptstart != 0 && scriptend != 0
if scriptstart <= curline && scriptend >= curline
let start = col('.') - 1
let b:jscompl = 1
let b:jsrange = [scriptstart, scriptend]
while start >= 0 && line[start - 1] =~ '\k'
let start -= 1
endwhile
" We are inside of <script> tag. But we should also get contents
" of all linked external files and (secondary, less probably) other <script> tags
" This logic could possible be done in separate function - may be
" reused in events scripting (also with option could be reused for
" CSS
let b:js_extfiles = []
let l = line('.')
let c = col('.')
call cursor(1,1)
while search('<\@<=script\>', 'W') && line('.') <= l
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
if filereadable(sname)
let b:js_extfiles += readfile(sname)
endif
endif
endwhile
call cursor(1,1)
let js_scripttags = []
while search('<script\>', 'W') && line('.') < l
if matchstr(getline('.'), '<script[^>]*src') == ''
let js_scripttag = getline(line('.'), search('</script>', 'W'))
let js_scripttags += js_scripttag
endif
endwhile
let b:js_extfiles += js_scripttags
call cursor(l,c)
unlet! l c
endif
endif
" }}}
if !exists("b:csscompl") && !exists("b:jscompl")
let b:compl_context = getline('.')[0:(compl_begin)]
if b:compl_context !~ '<[^>]*$'
" Look like we may have broken tag. Check previous lines.
let i = 1
while 1
let context_line = getline(curline-i)
if context_line =~ '<[^>]*$'
" Yep, this is this line
let context_lines = getline(curline-i, curline-1) + [b:compl_context]
let b:compl_context = join(context_lines, ' ')
break
elseif context_line =~ '>[^<]*$' || i == curline
" We are in normal tag line, no need for completion at all
" OR reached first line without tag at all
let b:compl_context = ''
break
endif
let i += 1
endwhile
" Make sure we don't have counter
unlet! i
endif
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
" Return proper start for on-events. Without that beginning of
" completion will be badly reported
if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
let start = col('.') - 1
while start >= 0 && line[start - 1] =~ '\k'
let start -= 1
endwhile
endif
" If b:compl_context begins with <? we are inside of PHP code. It
" wasn't closed so PHP completion passed it to HTML
if &filetype =~? 'php' && b:compl_context =~ '^<?'
let b:phpcompl = 1
let start = col('.') - 1
while start >= 0 && line[start - 1] =~ '[a-zA-Z_0-9\x7f-\xff$]'
let start -= 1
endwhile
endif
else
let b:compl_context = getline('.')[0:compl_begin]
endif
return start
else
" Initialize base return lists
let res = []
let res2 = []
" a:base is very short - we need context
let context = b:compl_context
" Check if we should do CSS completion inside of <style> tag
" or JS completion inside of <script> tag or PHP completion in case of <?
" tag AND &ft==php
if exists("b:csscompl")
unlet! b:csscompl
let context = b:compl_context
unlet! b:compl_context
return csscomplete#CompleteCSS(0, context)
elseif exists("b:jscompl")
unlet! b:jscompl
return javascriptcomplete#CompleteJS(0, a:base)
elseif exists("b:phpcompl")
unlet! b:phpcompl
let context = b:compl_context
return phpcomplete#CompletePHP(0, a:base)
else
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
return []
endif
let context = matchstr(b:compl_context, '.\zs.*')
endif
unlet! b:compl_context
" Entities completion {{{
if exists("b:entitiescompl")
unlet! b:entitiescompl
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
let entities = b:html_omni['vimxmlentities']
if len(a:base) == 1
for m in entities
if m =~ '^'.a:base
call add(res, m.';')
endif
endfor
return res
else
for m in entities
if m =~? '^'.a:base
call add(res, m.';')
elseif m =~? a:base
call add(res2, m.';')
endif
endfor
return res + res2
endif
endif
" }}}
if context =~ '>'
" Generally if context contains > it means we are outside of tag and
" should abandon action - with one exception: <style> span { bo
if context =~ 'style[^>]\{-}>[^<]\{-}$'
return csscomplete#CompleteCSS(0, context)
elseif context =~ 'script[^>]\{-}>[^<]\{-}$'
let b:jsrange = [line('.'), search('<\/script\>', 'nW')]
return javascriptcomplete#CompleteJS(0, context)
else
return []
endif
endif
" If context contains > it means we are already outside of tag and we
" should abandon action
" If context contains white space it is attribute.
" It can be also value of attribute.
" We have to get first word to offer proper completions
if context == ''
let tag = ''
else
let tag = split(context)[0]
" Detect if tag is uppercase to return in proper case,
" we need to make it lowercase for processing
if tag =~ '^[A-Z]*$'
let uppercase_tag = 1
let tag = tolower(tag)
else
let uppercase_tag = 0
endif
endif
" Get last word, it should be attr name
let attr = matchstr(context, '.*\s\zs.*')
" Possible situations where any prediction would be difficult:
" 1. Events attributes
if context =~ '\s'
" Sort out style, class, and on* cases
if context =~? "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
" Id, class completion {{{
if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
let search_for = "class"
elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
let search_for = "id"
endif
" Handle class name completion
" 1. Find lines of <link stylesheet>
" 1a. Check file for @import
" 2. Extract filename(s?) of stylesheet,
call cursor(1,1)
let head = getline(search('<head\>'), search('<\/head>'))
let headjoined = join(copy(head), ' ')
if headjoined =~ '<style'
" Remove possibly confusing CSS operators
let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g')
if search_for == 'class'
let styleheadlines = split(stylehead)
let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
else
let stylesheet = split(headjoined, '[{}]')
" Get all lines which fit id syntax
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
" Filter out possible color definitions
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
" Filter out complex border definitions
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
let templines = join(classlines, ' ')
let headclasslines = split(templines)
call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
endif
let internal = 1
else
let internal = 0
endif
let styletable = []
let secimportfiles = []
let filestable = filter(copy(head), "v:val =~ '\\(@import\\|link.*stylesheet\\)'")
for line in filestable
if line =~ "@import"
let styletable += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")]
elseif line =~ "<link"
let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")]
endif
endfor
for file in styletable
if filereadable(file)
let stylesheet = readfile(file)
let secimport = filter(copy(stylesheet), "v:val =~ '@import'")
if len(secimport) > 0
for line in secimport
let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")
let secfile = fnamemodify(file, ":p:h").'/'.secfile
let secimportfiles += [secfile]
endfor
endif
endif
endfor
let cssfiles = styletable + secimportfiles
let classes = []
for file in cssfiles
let classlines = []
if filereadable(file)
let stylesheet = readfile(file)
let stylefile = join(stylesheet, ' ')
let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g')
if search_for == 'class'
let stylesheet = split(stylefile)
let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
else
let stylesheet = split(stylefile, '[{}]')
" Get all lines which fit id syntax
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
" Filter out possible color definitions
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
" Filter out complex border definitions
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
let templines = join(classlines, ' ')
let stylelines = split(templines)
let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
endif
endif
" We gathered classes definitions from all external files
let classes += classlines
endfor
if internal == 1
let classes += headclasslines
endif
if search_for == 'class'
let elements = {}
for element in classes
if element =~ '^\.'
let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let class = substitute(class, ':.*', '', '')
if has_key(elements, 'common')
let elements['common'] .= ' '.class
else
let elements['common'] = class
endif
else
let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
if tagname != ''
if has_key(elements, tagname)
let elements[tagname] .= ' '.class
else
let elements[tagname] = class
endif
endif
endif
endfor
if has_key(elements, tag) && has_key(elements, 'common')
let values = split(elements[tag]." ".elements['common'])
elseif has_key(elements, tag) && !has_key(elements, 'common')
let values = split(elements[tag])
elseif !has_key(elements, tag) && has_key(elements, 'common')
let values = split(elements['common'])
else
return []
endif
elseif search_for == 'id'
" Find used IDs
" 1. Catch whole file
let filelines = getline(1, line('$'))
" 2. Find lines with possible id
let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"')
" 3a. Join all filtered lines
let id_string = join(used_id_lines, ' ')
" 3b. And split them to be sure each id is in separate item
let id_list = split(id_string, 'id\s*=\s*')
" 4. Extract id values
let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")')
let joined_used_id = ','.join(used_id, ',').','
let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")')
let values = []
for element in classes
if joined_used_id !~ ','.element.','
let values += [element]
endif
endfor
endif
" We need special version of sbase
let classbase = matchstr(context, ".*[\"']")
let classquote = matchstr(classbase, '.$')
let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*")
for m in sort(values)
if m =~? '^'.entered_class
call add(res, m . classquote)
elseif m =~? entered_class
call add(res2, m . classquote)
endif
endfor
return res + res2
elseif context =~? "style\\s*=\\s*[\"'][^\"']*$"
return csscomplete#CompleteCSS(0, context)
endif
" }}}
" Complete on-events {{{
if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
" We have to:
" 1. Find external files
let b:js_extfiles = []
let l = line('.')
let c = col('.')
call cursor(1,1)
while search('<\@<=script\>', 'W') && line('.') <= l
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
if filereadable(sname)
let b:js_extfiles += readfile(sname)
endif
endif
endwhile
" 2. Find at least one <script> tag
call cursor(1,1)
let js_scripttags = []
while search('<script\>', 'W') && line('.') < l
if matchstr(getline('.'), '<script[^>]*src') == ''
let js_scripttag = getline(line('.'), search('</script>', 'W'))
let js_scripttags += js_scripttag
endif
endwhile
let b:js_extfiles += js_scripttags
" 3. Proper call for javascriptcomplete#CompleteJS
call cursor(l,c)
let js_context = matchstr(a:base, '\k\+$')
let js_shortcontext = substitute(a:base, js_context.'$', '', '')
let b:compl_context = context
let b:jsrange = [l, l]
unlet! l c
return javascriptcomplete#CompleteJS(0, js_context)
endif
" }}}
let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
" Now we have context stripped from all chars up to style/class.
" It may fail with some strange style value combinations.
if stripbase !~ "[\"']"
return []
endif
endif
" Value of attribute completion {{{
" If attr contains =\s*[\"'] we catched value of attribute
if attr =~ "=\s*[\"']" || attr =~ "=\s*$"
" Let do attribute specific completion
let attrname = matchstr(attr, '.*\ze\s*=')
let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*")
let values = []
" Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
" }}}
if attrname == 'href'
" Now we are looking for local anchors defined by name or id
if entered_value =~ '^#'
let file = join(getline(1, line('$')), ' ')
" Split it be sure there will be one id/name element in
" item, it will be also first word [a-zA-Z0-9_-] in element
let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']")
for i in oneelement
let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
endfor
endif
else
if has_key(b:html_omni, tag) && has_key(b:html_omni[tag][1], attrname)
let values = b:html_omni[tag][1][attrname]
else
return []
endif
endif
if len(values) == 0
return []
endif
" We need special version of sbase
let attrbase = matchstr(context, ".*[\"']")
let attrquote = matchstr(attrbase, '.$')
if attrquote !~ "['\"]"
let attrquoteopen = '"'
let attrquote = '"'
else
let attrquoteopen = ''
endif
for m in values
" This if is needed to not offer all completions as-is
" alphabetically but sort them. Those beginning with entered
" part will be as first choices
if m =~ '^'.entered_value
call add(res, attrquoteopen . m . attrquote)
elseif m =~ entered_value
call add(res2, attrquoteopen . m . attrquote)
endif
endfor
return res + res2
endif
" }}}
" Attribute completion {{{
" Shorten context to not include last word
let sbase = matchstr(context, '.*\ze\s.*')
" Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni")
call htmlcomplete#LoadData()
endif
" }}}
if has_key(b:html_omni, tag)
let attrs = keys(b:html_omni[tag][1])
else
return []
endif
for m in sort(attrs)
if m =~ '^'.attr
call add(res, m)
elseif m =~ attr
call add(res2, m)
endif
endfor
let menu = res + res2
if has_key(b:html_omni, 'vimxmlattrinfo')
let final_menu = []
for i in range(len(menu))
let item = menu[i]
if has_key(b:html_omni['vimxmlattrinfo'], item)
let m_menu = b:html_omni['vimxmlattrinfo'][item][0]
let m_info = b:html_omni['vimxmlattrinfo'][item][1]
else
let m_menu = ''
let m_info = ''
endif
if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
let item = item
let m_menu = 'Bool'
else
let item .= '="'
endif
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
endfor
else
let final_menu = []
for i in range(len(menu))
let item = menu[i]
if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
let item = item
else
let item .= '="'
endif
let final_menu += [item]
endfor
return final_menu
endif
return final_menu
endif
" }}}
" Close tag {{{
let b:unaryTagsStack = "base meta link hr br param img area input col"
if context =~ '^\/'
if context =~ '^\/.'
return []
else
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
return [opentag.">"]
endif
endif
" }}}
" Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
" }}}
" Tag completion {{{
" Deal with tag completion.
let opentag = tolower(xmlcomplete#GetLastOpenTag("b:unaryTagsStack"))
" MM: TODO: GLOT works always the same but with some weird situation it
" behaves as intended in HTML but screws in PHP
if opentag == '' || &filetype == 'php' && !has_key(b:html_omni, opentag)
" Hack for sometimes failing GetLastOpenTag.
" As far as I tested fail isn't GLOT fault but problem
" of invalid document - not properly closed tags and other mish-mash.
" Also when document is empty. Return list of *all* tags.
let tags = keys(b:html_omni)
call filter(tags, 'v:val !~ "^vimxml"')
else
if has_key(b:html_omni, opentag)
let tags = b:html_omni[opentag][0]
else
return []
endif
endif
" }}}
if exists("uppercase_tag") && uppercase_tag == 1
let context = tolower(context)
endif
" Handle XML keywords: DOCTYPE
if opentag == ''
let tags += [
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
\ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">'
\ ]
endif
for m in sort(tags)
if m =~ '^'.context
call add(res, m)
elseif m =~ context
call add(res2, m)
endif
endfor
let menu = res + res2
if has_key(b:html_omni, 'vimxmltaginfo')
let final_menu = []
for i in range(len(menu))
let item = menu[i]
if has_key(b:html_omni['vimxmltaginfo'], item)
let m_menu = b:html_omni['vimxmltaginfo'][item][0]
let m_info = b:html_omni['vimxmltaginfo'][item][1]
else
let m_menu = ''
let m_info = ''
endif
if &filetype == 'html' && exists("uppercase_tag") && uppercase_tag == 1 && item !~ 'DOCTYPE'
let item = toupper(item)
endif
if item =~ 'DOCTYPE'
let abbr = 'DOCTYPE '.matchstr(item, 'DTD \zsX\?HTML .\{-}\ze\/\/')
else
let abbr = item
endif
let final_menu += [{'abbr':abbr, 'word':item, 'menu':m_menu, 'info':m_info}]
endfor
else
let final_menu = menu
endif
return final_menu
" }}}
endif
endfunction
1 0.000003 function! htmlcomplete#LoadData() " {{{
if !exists("b:html_omni_flavor")
if &filetype == 'html'
let b:html_omni_flavor = 'html401t'
else
let b:html_omni_flavor = 'xhtml10s'
endif
endif
" With that if we still have bloated memory but create new buffer
" variables only by linking to existing g:variable, not sourcing whole
" file.
if exists('g:xmldata_'.b:html_omni_flavor)
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
else
exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
endif
endfunction
" }}}
1 0.000002 function! htmlcomplete#CheckDoctype() " {{{
if exists('b:html_omni_flavor')
let old_flavor = b:html_omni_flavor
else
let old_flavor = ''
endif
let i = 1
while i < 10 && i < line("$")
let line = getline(i)
if line =~ '<!DOCTYPE.*\<DTD HTML 3\.2'
let b:html_omni_flavor = 'html32'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Transitional'
let b:html_omni_flavor = 'html40t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Frameset'
let b:html_omni_flavor = 'html40f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0'
let b:html_omni_flavor = 'html40s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Transitional'
let b:html_omni_flavor = 'html401t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Frameset'
let b:html_omni_flavor = 'html401f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01'
let b:html_omni_flavor = 'html401s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Transitional'
let b:html_omni_flavor = 'xhtml10t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Frameset'
let b:html_omni_flavor = 'xhtml10f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Strict'
let b:html_omni_flavor = 'xhtml10s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.1'
let b:html_omni_flavor = 'xhtml11'
let b:html_doctype = 1
break
endif
let i += 1
endwhile
if !exists("b:html_doctype")
return
else
" Tie g:xmldata with b:html_omni this way we need to sourca data file only
" once, not every time per buffer.
if old_flavor == b:html_omni_flavor
return
else
if exists('g:xmldata_'.b:html_omni_flavor)
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
else
exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
endif
return
endif
endif
endfunction
" }}}
" vim:set foldmethod=marker:
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/indent/php.vim
Sourced 1 time
Total time: 0.001154
Self time: 0.001121
count total (s) self (s)
" Vim indent file
" Language: PHP
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2017 Jun 13
" Version: 1.62
"
"
" Type :help php-indent for available options
"
" A fully commented version of this file is available on github
"
"
" If you find a bug, please open a ticket on github.org
" ( https://github.com/2072/PHP-Indenting-for-VIm/issues ) with an example of
" code that breaks the algorithm.
"
" NOTE: This script must be used with PHP syntax ON and with the php syntax
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the
" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 )
" the later is bunbdled by default with Vim 7.
"
"
" In the case you have syntax errors in your script such as HereDoc end
" identifiers not at col 1 you'll have to indent your file 2 times (This
" script will automatically put HereDoc end identifiers at col 1 if
" they are followed by a ';').
"
" NOTE: If you are editing files in Unix file format and that (by accident)
" there are '\r' before new lines, this script won't be able to proceed
" correctly and will make many mistakes because it won't be able to match
" '\s*$' correctly.
" So you have to remove those useless characters first with a command like:
"
" :%s /\r$//g
"
" or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will
" silently remove them when VIM load this script (at each bufread).
1 0.000010 if exists("b:did_indent")
finish
endif
1 0.000004 let b:did_indent = 1
1 0.000002 let g:php_sync_method = 0
1 0.000003 if exists("PHP_default_indenting")
let b:PHP_default_indenting = PHP_default_indenting * shiftwidth()
else
1 0.000002 let b:PHP_default_indenting = 0
1 0.000001 endif
1 0.000002 if exists("PHP_outdentSLComments")
let b:PHP_outdentSLComments = PHP_outdentSLComments * shiftwidth()
else
1 0.000002 let b:PHP_outdentSLComments = 0
1 0.000001 endif
1 0.000002 if exists("PHP_BracesAtCodeLevel")
let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel
else
1 0.000001 let b:PHP_BracesAtCodeLevel = 0
1 0.000001 endif
1 0.000002 if exists("PHP_autoformatcomment")
let b:PHP_autoformatcomment = PHP_autoformatcomment
else
1 0.000002 let b:PHP_autoformatcomment = 1
1 0.000001 endif
1 0.000002 if exists("PHP_outdentphpescape")
let b:PHP_outdentphpescape = PHP_outdentphpescape
else
1 0.000001 let b:PHP_outdentphpescape = 1
1 0.000001 endif
1 0.000003 if exists("PHP_vintage_case_default_indent") && PHP_vintage_case_default_indent
let b:PHP_vintage_case_default_indent = 1
else
1 0.000003 let b:PHP_vintage_case_default_indent = 0
1 0.000001 endif
1 0.000001 let b:PHP_lastindented = 0
1 0.000001 let b:PHP_indentbeforelast = 0
1 0.000001 let b:PHP_indentinghuge = 0
1 0.000002 let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
1 0.000002 let b:PHP_LastIndentedWasComment = 0
1 0.000001 let b:PHP_InsideMultilineComment = 0
1 0.000001 let b:InPHPcode = 0
1 0.000002 let b:InPHPcode_checked = 0
1 0.000001 let b:InPHPcode_and_script = 0
1 0.000002 let b:InPHPcode_tofind = ""
1 0.000002 let b:PHP_oldchangetick = b:changedtick
1 0.000002 let b:UserIsTypingComment = 0
1 0.000001 let b:optionsset = 0
1 0.000010 setlocal nosmartindent
1 0.000002 setlocal noautoindent
1 0.000002 setlocal nocindent
1 0.000008 setlocal nolisp
1 0.000005 setlocal indentexpr=GetPhpIndent()
1 0.000004 setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
1 0.000002 let s:searchpairflags = 'bWr'
1 0.000005 if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUnix
silent! %s/\r$//g
endif
1 0.000003 if exists("*GetPhpIndent")
call ResetPhpOptions()
finish
endif
1 0.000002 let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
1 0.000003 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
1 0.000004 let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
1 0.000004 let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
1 0.000002 let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
1 0.000005 let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
1 0.000005 let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
1 0.000002 let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
1 0.000005 let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
1 0.000001 let s:escapeDebugStops = 0
1 0.000002 function! DebugPrintReturn(scriptLine)
if ! s:escapeDebugStops
echo "debug:" . a:scriptLine
let c = getchar()
if c == "\<Del>"
let s:escapeDebugStops = 1
end
endif
endfunction
1 0.000002 function! GetLastRealCodeLNum(startline) " {{{
let lnum = a:startline
if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1
let lnum = b:GetLastRealCodeLNum_ADD
endif
while lnum > 1
let lnum = prevnonblank(lnum)
let lastline = getline(lnum)
if b:InPHPcode_and_script && lastline =~ '?>\s*$'
let lnum = lnum - 1
elseif lastline =~ '^\s*?>.*<?\%(php\)\=\s*$'
let lnum = lnum - 1
elseif lastline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
let lnum = lnum - 1
elseif lastline =~ '\*/\s*$'
call cursor(lnum, 1)
if lastline !~ '^\*/'
call search('\*/', 'W')
endif
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()')
let lastline = getline(lnum)
if lastline =~ '^\s*/\*'
let lnum = lnum - 1
else
break
endif
elseif lastline =~? '\%(//\s*\|?>.*\)\@<!<?\%(php\)\=\s*$\|^\s*<script\>'
while lastline !~ '\(<?.*\)\@<!?>' && lnum > 1
let lnum = lnum - 1
let lastline = getline(lnum)
endwhile
if lastline =~ '^\s*?>'
let lnum = lnum - 1
else
break
endif
elseif lastline =~? '^\a\w*;\=$' && lastline !~? s:notPhpHereDoc
let tofind=substitute( lastline, '\(\a\w*\);\=', '<<<\\s*[''"]\\=\1[''"]\\=$', '')
while getline(lnum) !~? tofind && lnum > 1
let lnum = lnum - 1
endwhile
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
let trylnum = lnum
while getline(trylnum) !~? tofind && trylnum > 1
let trylnum = trylnum - 1
endwhile
if trylnum == 1
break
else
if lastline =~ ';'.s:endline
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
let trylnum = prevnonblank(trylnum - 1)
endwhile
if trylnum == 1
break
end
end
let lnum = trylnum
end
else
break
endif
endwhile
if lnum==1 && getline(lnum) !~ '<?'
let lnum=0
endif
if b:InPHPcode_and_script && 1 > b:InPHPcode
let b:InPHPcode_and_script = 0
endif
return lnum
endfunction " }}}
1 0.000001 function! Skippmatch2()
let line = getline(".")
if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*'
return 1
else
return 0
endif
endfun
1 0.000001 function! Skippmatch() " {{{
let synname = synIDattr(synID(line("."), col("."), 0), "name")
if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment
return 0
else
return 1
endif
endfun " }}}
1 0.000001 function! FindOpenBracket(lnum, blockStarter) " {{{
call cursor(a:lnum, 1)
let line = searchpair('{', '', '}', 'bW', 'Skippmatch()')
if a:blockStarter == 1
while line > 1
let linec = getline(line)
if linec =~ s:terminated || linec =~ s:structureHead
break
endif
let line = GetLastRealCodeLNum(line - 1)
endwhile
endif
return line
endfun " }}}
1 0.000005 let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
1 0.000002 function! BalanceDirection (str)
let balance = 0
for c in split(a:str, '\zs')
if has_key(s:blockChars, c)
let balance += s:blockChars[c]
endif
endfor
return balance
endfun
1 0.000002 function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
let beforeelse = a:lnum
else
let beforeelse = GetLastRealCodeLNum(a:lnum - 1)
endif
if !s:level
let s:iftoskip = 0
endif
if getline(beforeelse) =~# '^\s*\%(}\s*\)\=else\%(\s*if\)\@!\>'
let s:iftoskip = s:iftoskip + 1
endif
if getline(beforeelse) =~ '^\s*}'
let beforeelse = FindOpenBracket(beforeelse, 0)
if getline(beforeelse) =~ '^\s*{'
let beforeelse = GetLastRealCodeLNum(beforeelse - 1)
endif
endif
if !s:iftoskip && a:StopAfterFirstPrevElse && getline(beforeelse) =~# '^\s*\%([}]\s*\)\=else\%(if\)\=\>'
return beforeelse
endif
if getline(beforeelse) !~# '^\s*if\>' && beforeelse>1 || s:iftoskip && beforeelse>1
if s:iftoskip && getline(beforeelse) =~# '^\s*if\>'
let s:iftoskip = s:iftoskip - 1
endif
let s:level = s:level + 1
let beforeelse = FindTheIfOfAnElse(beforeelse, a:StopAfterFirstPrevElse)
endif
return beforeelse
endfunction " }}}
1 0.000002 let s:defaultORcase = '^\s*\%(default\|case\).*:'
1 0.000001 function! FindTheSwitchIndent (lnum) " {{{
let test = GetLastRealCodeLNum(a:lnum - 1)
if test <= 1
return indent(1) - shiftwidth() * b:PHP_vintage_case_default_indent
end
while getline(test) =~ '^\s*}' && test > 1
let test = GetLastRealCodeLNum(FindOpenBracket(test, 0) - 1)
if getline(test) =~ '^\s*switch\>'
let test = GetLastRealCodeLNum(test - 1)
endif
endwhile
if getline(test) =~# '^\s*switch\>'
return indent(test)
elseif getline(test) =~# s:defaultORcase
return indent(test) - shiftwidth() * b:PHP_vintage_case_default_indent
else
return FindTheSwitchIndent(test)
endif
endfunction "}}}
1 0.000005 let s:SynPHPMatchGroups = {'phpParent':1, 'Delimiter':1, 'Define':1, 'Storageclass':1, 'StorageClass':1, 'Structure':1, 'Exception':1}
1 0.000003 function! IslinePHP (lnum, tofind) " {{{
let cline = getline(a:lnum)
if a:tofind==""
let tofind = "^\\s*[\"'`]*\\s*\\zs\\S"
else
let tofind = a:tofind
endif
let tofind = tofind . '\c'
let coltotest = match (cline, tofind) + 1
let synname = synIDattr(synID(a:lnum, coltotest, 0), "name")
if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick'
if cline !~ '^\s*[''"`]'
return "SpecStringEntrails"
else
return synname
end
end
if get(s:SynPHPMatchGroups, synname) || synname =~ '^php' || synname =~? '^javaScript'
return synname
else
return ""
endif
endfunction " }}}
1 0.000002 let s:autoresetoptions = 0
1 0.000001 if ! s:autoresetoptions
1 0.000003 let s:autoresetoptions = 1
1 0.000001 endif
1 0.000001 function! ResetPhpOptions()
if ! b:optionsset && &filetype =~ "php"
if b:PHP_autoformatcomment
setlocal comments=s1:/*,mb:*,ex:*/,://,:#
setlocal formatoptions-=t
setlocal formatoptions+=q
setlocal formatoptions+=r
setlocal formatoptions+=o
setlocal formatoptions+=c
setlocal formatoptions+=b
endif
let b:optionsset = 1
endif
endfunc
1 0.000046 0.000013 call ResetPhpOptions()
1 0.000001 function! GetPhpIndent()
let b:GetLastRealCodeLNum_ADD = 0
let UserIsEditing=0
if b:PHP_oldchangetick != b:changedtick
let b:PHP_oldchangetick = b:changedtick
let UserIsEditing=1
endif
if b:PHP_default_indenting
let b:PHP_default_indenting = g:PHP_default_indenting * shiftwidth()
endif
let cline = getline(v:lnum)
if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast
if b:PHP_indentbeforelast
let b:PHP_indentinghuge = 1
endif
let b:PHP_indentbeforelast = b:PHP_lastindented
endif
if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented
if b:PHP_indentinghuge
let b:PHP_indentinghuge = 0
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
endif
let real_PHP_lastindented = v:lnum
let b:PHP_LastIndentedWasComment=0
let b:PHP_InsideMultilineComment=0
let b:PHP_indentbeforelast = 0
let b:InPHPcode = 0
let b:InPHPcode_checked = 0
let b:InPHPcode_and_script = 0
let b:InPHPcode_tofind = ""
elseif v:lnum > b:PHP_lastindented
let real_PHP_lastindented = b:PHP_lastindented
else
let real_PHP_lastindented = v:lnum
endif
let b:PHP_lastindented = v:lnum
if !b:InPHPcode_checked " {{{ One time check
let b:InPHPcode_checked = 1
let b:UserIsTypingComment = 0
let synname = ""
if cline !~ '<?.*?>'
let synname = IslinePHP (prevnonblank(v:lnum), "")
endif
if synname!=""
if synname == "SpecStringEntrails"
let b:InPHPcode = -1 " thumb down
let b:InPHPcode_tofind = ""
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
let b:InPHPcode = 1
let b:InPHPcode_tofind = ""
if synname =~# '^php\%(Doc\)\?Comment'
let b:UserIsTypingComment = 1
let b:InPHPcode_checked = 0
endif
if synname =~? '^javaScript'
let b:InPHPcode_and_script = 1
endif
else
let b:InPHPcode = 0
let lnum = v:lnum - 1
while getline(lnum) !~? '<<<\s*[''"]\=\a\w*[''"]\=$' && lnum > 1
let lnum = lnum - 1
endwhile
let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '')
endif
else
let b:InPHPcode = 0
let b:InPHPcode_tofind = s:PHP_startindenttag
endif
endif "!b:InPHPcode_checked }}}
" Test if we are indenting PHP code {{{
let lnum = prevnonblank(v:lnum - 1)
let last_line = getline(lnum)
let endline= s:endline
if b:InPHPcode_tofind!=""
if cline =~? b:InPHPcode_tofind
let b:InPHPcode_tofind = ""
let b:UserIsTypingComment = 0
if b:InPHPcode == -1
let b:InPHPcode = 1
return -1
end
let b:InPHPcode = 1
if cline =~ '\*/'
call cursor(v:lnum, 1)
if cline !~ '^\*/'
call search('\*/', 'W')
endif
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()')
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
let b:PHP_LastIndentedWasComment = 0
if cline =~ '^\s*\*/'
return indent(lnum) + 1
else
return indent(lnum)
endif
elseif cline =~? '<script\>'
let b:InPHPcode_and_script = 1
let b:GetLastRealCodeLNum_ADD = v:lnum
endif
endif
endif
if 1 == b:InPHPcode
if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=~"Delimiter"
if cline !~? s:PHP_startindenttag
let b:InPHPcode = 0
let b:InPHPcode_tofind = s:PHP_startindenttag
elseif cline =~? '<script\>'
let b:InPHPcode_and_script = 1
endif
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
let b:InPHPcode = -1
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
let b:InPHPcode = 0
let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\s*[''"]\=\(\a\w*\)[''"]\=$', '^\\s*\1;\\=$', '')
elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*'
let b:InPHPcode = 0
let b:InPHPcode_tofind = '\*/'
elseif cline =~? '^\s*</script>'
let b:InPHPcode = 0
let b:InPHPcode_tofind = s:PHP_startindenttag
endif
endif " }}}
if 1 > b:InPHPcode && !b:InPHPcode_and_script
return -1
endif
" Indent successive // or # comment the same way the first is {{{
let addSpecial = 0
if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
let addSpecial = b:PHP_outdentSLComments
if b:PHP_LastIndentedWasComment == 1
return indent(real_PHP_lastindented)
endif
let b:PHP_LastIndentedWasComment = 1
else
let b:PHP_LastIndentedWasComment = 0
endif " }}}
" Indent multiline /* comments correctly {{{
if b:PHP_InsideMultilineComment || b:UserIsTypingComment
if cline =~ '^\s*\*\%(\/\)\@!'
if last_line =~ '^\s*/\*'
return indent(lnum) + 1
else
return indent(lnum)
endif
else
let b:PHP_InsideMultilineComment = 0
endif
endif
if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*\%(.*\*/\)\@!'
if getline(v:lnum + 1) !~ '^\s*\*'
return -1
endif
let b:PHP_InsideMultilineComment = 1
endif " }}}
" Things always indented at col 1 (PHP delimiter: <?, ?>, Heredoc end) {{{
if cline =~# '^\s*<?' && cline !~ '?>' && b:PHP_outdentphpescape
return 0
endif
if cline =~ '^\s*?>' && cline !~# '<?' && b:PHP_outdentphpescape
return 0
endif
if cline =~? '^\s*\a\w*;$\|^\a\w*$\|^\s*[''"`][;,]' && cline !~? s:notPhpHereDoc
return 0
endif " }}}
let s:level = 0
let lnum = GetLastRealCodeLNum(v:lnum - 1)
let last_line = getline(lnum)
let ind = indent(lnum)
if ind==0 && b:PHP_default_indenting
let ind = b:PHP_default_indenting
endif
if lnum == 0
return b:PHP_default_indenting + addSpecial
endif
if cline =~ '^\s*}\%(}}\)\@!'
let ind = indent(FindOpenBracket(v:lnum, 1))
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
return ind
endif
if cline =~ '^\s*\*/'
call cursor(v:lnum, 1)
if cline !~ '^\*/'
call search('\*/', 'W')
endif
let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()')
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
if cline =~ '^\s*\*/'
return indent(lnum) + 1
else
return indent(lnum)
endif
endif
if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase
if ind==b:PHP_default_indenting
return b:PHP_default_indenting + addSpecial
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
return b:PHP_CurrentIndentLevel + addSpecial
endif
endif
let LastLineClosed = 0
let terminated = s:terminated
let unstated = s:unstated
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
return indent(FindTheIfOfAnElse(v:lnum, 1))
elseif cline =~# s:defaultORcase
return FindTheSwitchIndent(v:lnum) + shiftwidth() * b:PHP_vintage_case_default_indent
elseif cline =~ '^\s*)\=\s*{'
let previous_line = last_line
let last_line_num = lnum
while last_line_num > 1
if previous_line =~ terminated || previous_line =~ s:structureHead
let ind = indent(last_line_num)
if b:PHP_BracesAtCodeLevel
let ind = ind + shiftwidth()
endif
return ind
endif
let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
let previous_line = getline(last_line_num)
endwhile
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
let ind = ind + shiftwidth() " we indent one level further when the preceding line is not stated
return ind + addSpecial
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
let previous_line = last_line
let last_line_num = lnum
let LastLineClosed = 1
let isSingleLineBlock = 0
while 1
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
call cursor(last_line_num, 1)
if previous_line !~ '^}'
call search('}\|;\s*}'.endline, 'W')
end
let oldLastLine = last_line_num
let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()')
if getline(last_line_num) =~ '^\s*{'
let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
elseif oldLastLine == last_line_num
let isSingleLineBlock = 1
continue
endif
let previous_line = getline(last_line_num)
continue
else
let isSingleLineBlock = 0
if getline(last_line_num) =~# '^\s*else\%(if\)\=\>'
let last_line_num = FindTheIfOfAnElse(last_line_num, 0)
continue
endif
let last_match = last_line_num
let one_ahead_indent = indent(last_line_num)
let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
let two_ahead_indent = indent(last_line_num)
let after_previous_line = previous_line
let previous_line = getline(last_line_num)
if previous_line =~# s:defaultORcase.'\|{'.endline
break
endif
if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline
break
endif
if one_ahead_indent == two_ahead_indent || last_line_num < 1
if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1
break
endif
endif
endif
endwhile
if indent(last_match) != ind
let ind = indent(last_match)
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
return ind + addSpecial
endif
endif
if (last_line !~ '^\s*}\%(}}\)\@!')
let plinnum = GetLastRealCodeLNum(lnum - 1)
else
let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1)
endif
let AntepenultimateLine = getline(plinnum)
let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','')
if ind == b:PHP_default_indenting
if last_line =~ terminated && last_line !~# s:defaultORcase
let LastLineClosed = 1
endif
endif
if !LastLineClosed
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
let dontIndent = 0
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
let dontIndent = 1
endif
if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{')
let ind = ind + shiftwidth()
endif
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1
let b:PHP_CurrentIndentLevel = ind
return ind + addSpecial
endif
elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
call cursor(lnum, 1)
call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
if openedparent != lnum
let ind = indent(openedparent)
endif
elseif last_line =~ '^\s*'.s:blockstart
let ind = ind + shiftwidth()
elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
let ind = ind + shiftwidth()
endif
endif
if cline =~ '^\s*[)\]];\='
let ind = ind - shiftwidth()
endif
let b:PHP_CurrentIndentLevel = ind
return ind + addSpecial
endfunction
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/php.vim
Sourced 1 time
Total time: 0.030270
Self time: 0.006151
count total (s) self (s)
" Vim syntax file
" Language: php PHP 3/4/5/7
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
" Last Change: Jul 14, 2017
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
"
" Note: If you are using a colour terminal with dark background, you will
" probably find the 'elflord' colorscheme is much better for PHP's syntax
" than the default colourscheme, because elflord's colours will better
" highlight the break-points (Statements) in your code.
"
" Options:
" Set to anything to enable:
" php_sql_query SQL syntax highlighting inside strings
" php_htmlInStrings HTML syntax highlighting inside strings
" php_baselib highlighting baselib functions
" php_asp_tags highlighting ASP-style short tags
" php_parent_error_close highlighting parent error ] or )
" php_parent_error_open skipping an php end tag, if there exists
" an open ( or [ without a closing one
" php_oldStyle use old colorstyle
" php_noShortTags don't sync <? ?> as php
" Set to a specific value:
" php_folding = 1 fold classes and functions
" php_folding = 2 fold all { } regions
" php_sync_method = x where x is an integer:
" -1 sync by search ( default )
" >0 sync at least x lines backwards
" 0 sync from start
" Set to 0 to _disable_: (Added by Peter Hodge On June 9, 2006)
" php_special_functions = 0 highlight functions with abnormal behaviour
" php_alt_comparisons = 0 comparison operators in an alternate colour
" php_alt_assignByReference = 0 '= &' in an alternate colour
"
"
" Note:
" Setting php_folding=1 will match a closing } by comparing the indent
" before the class or function keyword with the indent of a matching }.
" Setting php_folding=2 will match all of pairs of {,} ( see known
" bugs ii )
" Known Bugs:
" - setting php_parent_error_close on and php_parent_error_open off
" has these two leaks:
" i) A closing ) or ] inside a string match to the last open ( or [
" before the string, when the the closing ) or ] is on the same line
" where the string started. In this case a following ) or ] after
" the string would be highlighted as an error, what is incorrect.
" ii) Same problem if you are setting php_folding = 2 with a closing
" } inside an string on the first line of this string.
" quit when a syntax file was already loaded
1 0.000011 if exists("b:current_syntax")
finish
endif
1 0.000003 if !exists("main_syntax")
1 0.000004 let main_syntax = 'php'
1 0.000001 endif
1 0.022757 0.000735 runtime! syntax/html.vim
1 0.000002 unlet b:current_syntax
" accept old options
1 0.000003 if !exists("php_sync_method")
if exists("php_minlines")
let php_sync_method=php_minlines
else
let php_sync_method=-1
endif
endif
1 0.000003 if exists("php_parentError") && !exists("php_parent_error_open") && !exists("php_parent_error_close")
let php_parent_error_close=1
let php_parent_error_open=1
endif
1 0.000015 syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc
1 0.002565 0.000469 syn include @sqlTop syntax/sql.vim
1 0.000007 syn sync clear
1 0.000003 unlet b:current_syntax
1 0.000006 syn cluster sqlTop remove=sqlString,sqlComment
1 0.000005 if exists( "php_sql_query")
syn cluster phpAddStrings contains=@sqlTop
endif
1 0.000002 if exists( "php_htmlInStrings")
syn cluster phpAddStrings add=@htmlTop
endif
" make sure we can use \ at the beginning of the line to do a continuation
1 0.000007 let s:cpo_save = &cpo
1 0.000008 set cpo&vim
1 0.000001 syn case match
" Env Variables
1 0.000025 syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTOCOL REQUEST_METHOD QUERY_STRING DOCUMENT_ROOT HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CONNECTION HTTP_HOST HTTP_REFERER HTTP_USER_AGENT REMOTE_ADDR REMOTE_PORT SCRIPT_FILENAME SERVER_ADMIN SERVER_PORT SERVER_SIGNATURE PATH_TRANSLATED SCRIPT_NAME REQUEST_URI contained
" Internal Variables
1 0.000013 syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION contained
" Constants
1 0.000016 syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END contained
" Predefined constants
" Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u
1 0.000006 syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained
1 0.000001 syn case ignore
1 0.000023 syn keyword phpConstant __LINE__ __FILE__ __FUNCTION__ __METHOD__ __CLASS__ __DIR__ __NAMESPACE__ __TRAIT__ contained
" Function and Methods ripped from php_manual_de.tar.gz Jan 2003
1 0.000020 syn keyword phpFunctions apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_response_headers apache_setenv ascii2ebcdic ebcdic2ascii getallheaders virtual contained
1 0.000034 syn keyword phpFunctions array_change_key_case array_chunk array_column array_combine array_count_values array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_diff array_fill_keys array_fill array_filter array_flip array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace_recursive array_replace array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_uintersect_assoc array_uintersect_uassoc array_uintersect array_unique array_unshift array_values array_walk_recursive array_walk arsort asort count current each end in_array key_exists key krsort ksort natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort contained
1 0.000004 syn keyword phpFunctions aspell_check aspell_new aspell_suggest contained
1 0.000005 syn keyword phpFunctions bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub contained
1 0.000005 syn keyword phpFunctions bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite contained
1 0.000008 syn keyword phpFunctions cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days frenchtojd gregoriantojd jddayofweek jdmonthname jdtofrench jdtogregorian jdtojewish jdtojulian jdtounix jewishtojd juliantojd unixtojd contained
1 0.000007 syn keyword phpFunctions ccvs_add ccvs_auth ccvs_command ccvs_count ccvs_delete ccvs_done ccvs_init ccvs_lookup ccvs_new ccvs_report ccvs_return ccvs_reverse ccvs_sale ccvs_status ccvs_textvalue ccvs_void contained
1 0.000009 syn keyword phpFunctions call_user_method_array call_user_method class_exists get_class_methods get_class_vars get_class get_declared_classes get_object_vars get_parent_class is_a is_subclass_of method_exists contained
1 0.000008 syn keyword phpFunctions com VARIANT com_addref com_get com_invoke com_isenum com_load_typelib com_load com_propget com_propput com_propset com_release com_set contained
1 0.000032 syn keyword phpFunctions cpdf_add_annotation cpdf_add_outline cpdf_arc cpdf_begin_text cpdf_circle cpdf_clip cpdf_close cpdf_closepath_fill_stroke cpdf_closepath_stroke cpdf_closepath cpdf_continue_text cpdf_curveto cpdf_end_text cpdf_fill_stroke cpdf_fill cpdf_finalize_page cpdf_finalize cpdf_global_set_document_limits cpdf_import_jpeg cpdf_lineto cpdf_moveto cpdf_newpath cpdf_open cpdf_output_buffer cpdf_page_init cpdf_place_inline_image cpdf_rect cpdf_restore cpdf_rlineto cpdf_rmoveto cpdf_rotate_text cpdf_rotate cpdf_save_to_file cpdf_save cpdf_scale cpdf_set_action_url cpdf_set_char_spacing cpdf_set_creator cpdf_set_current_page cpdf_set_font_directories cpdf_set_font_map_file cpdf_set_font cpdf_set_horiz_scaling cpdf_set_keywords cpdf_set_leading cpdf_set_page_animation cpdf_set_subject cpdf_set_text_matrix cpdf_set_text_pos cpdf_set_text_rendering cpdf_set_text_rise cpdf_set_title cpdf_set_viewer_preferences cpdf_set_word_spacing cpdf_setdash cpdf_setflat cpdf_setgray_fill cpdf_setgray_stroke cpdf_setg 1 0.000004 syn keyword phpFunctions crack_check crack_closedict crack_getlastmessage crack_opendict contained
1 0.000005 syn keyword phpFunctions ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit contained
1 0.000010 syn keyword phpFunctions curl_close curl_errno curl_error curl_exec curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_setopt curl_version contained
1 0.000003 syn keyword phpFunctions cybercash_base64_decode cybercash_base64_encode cybercash_decr cybercash_encr contained
1 0.000004 syn keyword phpFunctions cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind contained
1 0.000008 syn keyword phpFunctions checkdate date getdate gettimeofday gmdate gmmktime gmstrftime localtime microtime mktime strftime strtotime time contained
1 0.000006 syn keyword phpFunctions dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync contained
1 0.000006 syn keyword phpFunctions dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record contained
1 0.000008 syn keyword phpFunctions dblist dbmclose dbmdelete dbmexists dbmfetch dbmfirstkey dbminsert dbmnextkey dbmopen dbmreplace contained
1 0.000020 syn keyword phpFunctions dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel contained
1 0.000005 syn keyword phpFunctions dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort contained
1 0.000004 syn keyword phpFunctions dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write contained
1 0.000005 syn keyword phpFunctions chdir chroot dir closedir getcwd opendir readdir rewinddir scandir contained
1 0.000008 syn keyword phpFunctions domxml_new_doc domxml_open_file domxml_open_mem domxml_version domxml_xmltree domxml_xslt_stylesheet_doc domxml_xslt_stylesheet_file domxml_xslt_stylesheet xpath_eval_expression xpath_eval xpath_new_context xptr_eval xptr_new_context contained
1 0.000033 syn keyword phpMethods name specified value create_attribute create_cdata_section create_comment create_element_ns create_element create_entity_reference create_processing_instruction create_text_node doctype document_element dump_file dump_mem get_element_by_id get_elements_by_tagname html_dump_mem xinclude entities internal_subset name notations public_id system_id get_attribute_node get_attribute get_elements_by_tagname has_attribute remove_attribute set_attribute tagname add_namespace append_child append_sibling attributes child_nodes clone_node dump_node first_child get_content has_attributes has_child_nodes insert_before is_blank_node last_child next_sibling node_name node_type node_value owner_document parent_node prefix previous_sibling remove_child replace_child replace_node set_content set_name set_namespace unlink_node data target process result_dump_file result_dump_mem contained
1 0.000002 syn keyword phpFunctions dotnet_load contained
1 0.000005 syn keyword phpFunctions debug_backtrace debug_print_backtrace error_log error_reporting restore_error_handler set_error_handler trigger_error user_error contained
1 0.000005 syn keyword phpFunctions escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system contained
1 0.000010 syn keyword phpFunctions fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor contained
1 0.000025 syn keyword phpFunctions fbsql_affected_rows fbsql_autocommit fbsql_change_user fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_select_db fbsql_set_lob_mode fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_tablename fbsql_username fbsql_warnings contained
1 0.000014 syn keyword phpFunctions fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version contained
1 0.000005 syn keyword phpFunctions filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro contained
1 0.000029 syn keyword phpFunctions basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable link linkinfo lstat mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink contained
1 0.000002 syn keyword phpFunctions fribidi_log2vis contained
1 0.000012 syn keyword phpFunctions ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype contained
1 0.000006 syn keyword phpFunctions call_user_func_array call_user_func create_function func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function contained
1 0.000005 syn keyword phpFunctions bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain contained
1 0.000110 syn keyword phpFunctions gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_sqrtrm gmp_strval gmp_sub gmp_xor contained
1 0.000004 syn keyword phpFunctions header headers_list headers_sent setcookie contained
1 0.000003 syn keyword phpFunctions hw_api_attribute hwapi_hgcsp hw_api_content hw_api_object contained
1 0.000021 syn keyword phpMethods key langdepvalue value values checkin checkout children mimetype read content copy dbstat dcstat dstanchors dstofsrcanchors count reason find ftstat hwstat identify info insert insertanchor insertcollection insertdocument link lock move assign attreditable count insert remove title value object objectbyanchor parents description type remove replace setcommitedversion srcanchors srcsofdst unlock user userlist contained
1 0.000026 syn keyword phpFunctions hw_Array2Objrec hw_changeobject hw_Children hw_ChildrenObj hw_Close hw_Connect hw_connection_info hw_cp hw_Deleteobject hw_DocByAnchor hw_DocByAnchorObj hw_Document_Attributes hw_Document_BodyTag hw_Document_Content hw_Document_SetContent hw_Document_Size hw_dummy hw_EditText hw_Error hw_ErrorMsg hw_Free_Document hw_GetAnchors hw_GetAnchorsObj hw_GetAndLock hw_GetChildColl hw_GetChildCollObj hw_GetChildDocColl hw_GetChildDocCollObj hw_GetObject hw_GetObjectByQuery hw_GetObjectByQueryColl hw_GetObjectByQueryCollObj hw_GetObjectByQueryObj hw_GetParents hw_GetParentsObj hw_getrellink hw_GetRemote hw_getremotechildren hw_GetSrcByDestObj hw_GetText hw_getusername hw_Identify hw_InCollections hw_Info hw_InsColl hw_InsDoc hw_insertanchors hw_InsertDocument hw_InsertObject hw_mapid hw_Modifyobject hw_mv hw_New_Document hw_objrec2array hw_Output_Document hw_pConnect hw_PipeDocument hw_Root hw_setlinkroot hw_stat hw_Unlock hw_Who contained
1 0.000019 syn keyword phpFunctions ibase_add_user ibase_affected_rows ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_rollback_ret ibase_rollback ibase_set_event_handler ibase_timefmt ibase_trans ibase_wait_event contained
1 0.000006 syn keyword phpFunctions iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler contained
1 0.000018 syn keyword phpFunctions ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob contained
1 0.000037 syn keyword phpFunctions exif_imagetype exif_read_data exif_thumbnail gd_info getimagesize image_type_to_mime_type image2wbmp imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect 1 0.000028 syn keyword phpFunctions imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 contained
1 0.000019 syn keyword phpFunctions assert_options assert dl extension_loaded get_cfg_var get_current_user get_defined_constants get_extension_funcs get_include_path get_included_files get_loaded_extensions get_magic_quotes_gpc get_magic_quotes_runtime get_required_files getenv getlastmod getmygid getmyinode getmypid getmyuid getopt getrusage ini_alter ini_get_all ini_get ini_restore ini_set main memory_get_usage php_ini_scanned_files php_logo_guid php_sapi_name php_uname phpcredits phpinfo phpversion putenv restore_include_path set_include_path set_magic_quotes_runtime set_time_limit version_compare zend_logo_guid zend_version contained
1 0.000011 syn keyword phpFunctions ingres_autocommit ingres_close ingres_commit ingres_connect ingres_fetch_array ingres_fetch_object ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_num_fields ingres_num_rows ingres_pconnect ingres_query ingres_rollback contained
1 0.000010 syn keyword phpFunctions ircg_channel_mode ircg_disconnect ircg_fetch_error_msg ircg_get_username ircg_html_encode ircg_ignore_add ircg_ignore_del ircg_is_conn_alive ircg_join ircg_kick ircg_lookup_format_messages ircg_msg ircg_nick ircg_nickname_escape ircg_nickname_unescape ircg_notice ircg_part ircg_pconnect ircg_register_format_messages ircg_set_current ircg_set_file ircg_set_on_die ircg_topic ircg_whois contained
1 0.000002 syn keyword phpFunctions java_last_exception_clear java_last_exception_get contained
1 0.000003 syn keyword phpFunctions json_decode json_encode json_last_error contained
1 0.000018 syn keyword phpFunctions ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind contained
1 0.000003 syn keyword phpFunctions lzf_compress lzf_decompress lzf_optimized_for contained
1 0.000002 syn keyword phpFunctions ezmlm_hash mail contained
1 0.000008 syn keyword phpFunctions mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all contained
1 0.000018 syn keyword phpFunctions abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh contained
1 0.000028 syn keyword phpFunctions mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_ereg_match mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_strlen mb_strpos mb_strrpos mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr contained
1 0.000020 syn keyword phpFunctions mcal_append_event mcal_close mcal_create_calendar mcal_date_compare mcal_date_valid mcal_day_of_week mcal_day_of_year mcal_days_in_month mcal_delete_calendar mcal_delete_event mcal_event_add_attribute mcal_event_init mcal_event_set_alarm mcal_event_set_category mcal_event_set_class mcal_event_set_description mcal_event_set_end mcal_event_set_recur_daily mcal_event_set_recur_monthly_mday mcal_event_set_recur_monthly_wday mcal_event_set_recur_none mcal_event_set_recur_weekly mcal_event_set_recur_yearly mcal_event_set_start mcal_event_set_title mcal_expunge mcal_fetch_current_stream_event mcal_fetch_event mcal_is_leap_year mcal_list_alarms mcal_list_events mcal_next_recurrence mcal_open mcal_popen mcal_rename_calendar mcal_reopen mcal_snooze mcal_store_event mcal_time_valid mcal_week_of_year contained
1 0.000020 syn keyword phpFunctions mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic contained
1 0.000030 syn keyword phpFunctions mcve_adduser mcve_adduserarg mcve_bt mcve_checkstatus mcve_chkpwd mcve_chngpwd mcve_completeauthorizations mcve_connect mcve_connectionerror mcve_deleteresponse mcve_deletetrans mcve_deleteusersetup mcve_deluser mcve_destroyconn mcve_destroyengine mcve_disableuser mcve_edituser mcve_enableuser mcve_force mcve_getcell mcve_getcellbynum mcve_getcommadelimited mcve_getheader mcve_getuserarg mcve_getuserparam mcve_gft mcve_gl mcve_gut mcve_initconn mcve_initengine mcve_initusersetup mcve_iscommadelimited mcve_liststats mcve_listusers mcve_maxconntimeout mcve_monitor mcve_numcolumns mcve_numrows mcve_override mcve_parsecommadelimited mcve_ping mcve_preauth mcve_preauthcompletion mcve_qc mcve_responseparam mcve_return mcve_returncode mcve_returnstatus mcve_sale mcve_setblocking mcve_setdropfile mcve_setip mcve_setssl_files mcve_setssl mcve_settimeout mcve_settle mcve_text_avs mcve_text_code mcve_text_cv mcve_transactionauth mcve_transactionavs mcve_transactionbatch mcve_transactioncv mcve_t 1 0.000003 syn keyword phpFunctions mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash contained
1 0.000002 syn keyword phpFunctions mime_content_type contained
1 0.000023 syn keyword phpFunctions ming_setcubicthreshold ming_setscale ming_useswfversion SWFAction SWFBitmap swfbutton_keypress SWFbutton SWFDisplayItem SWFFill SWFFont SWFGradient SWFMorph SWFMovie SWFShape SWFSprite SWFText SWFTextField contained
1 0.000034 syn keyword phpMethods getHeight getWidth addAction addShape setAction setdown setHit setOver setUp addColor move moveTo multColor remove Rotate rotateTo scale scaleTo setDepth setName setRatio skewX skewXTo skewY skewYTo moveTo rotateTo scaleTo skewXTo skewYTo getwidth addEntry getshape1 getshape2 add nextframe output remove save setbackground setdimension setframes setrate streammp3 addFill drawCurve drawCurveTo drawLine drawLineTo movePen movePenTo setLeftFill setLine setRightFill add nextframe remove setframes addString getWidth moveTo setColor setFont setHeight setSpacing addstring align setbounds setcolor setFont setHeight setindentation setLeftMargin setLineSpacing setMargins setname setrightMargin contained
1 0.000009 syn keyword phpFunctions connection_aborted connection_status connection_timeout constant define defined die eval exit get_browser highlight_file highlight_string ignore_user_abort pack show_source sleep uniqid unpack usleep contained
1 0.000015 syn keyword phpFunctions udm_add_search_limit udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_check_stored udm_clear_search_limits udm_close_stored udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_load_ispell_data udm_open_stored udm_set_agent_param contained
1 0.000027 syn keyword phpFunctions msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get msession_getdata msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set msession_setdata msession_timeout msession_uniq msession_unlock contained
1 0.000015 syn keyword phpFunctions msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_dbname msql_drop_db msql_dropdb msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_freeresult msql_list_dbs msql_list_fields msql_list_tables msql_listdbs msql_listfields msql_listtables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_selectdb msql_tablename msql contained
1 0.000032 syn keyword phpFunctions mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db contained
1 0.000011 syn keyword phpFunctions muscat_close muscat_get muscat_give muscat_setup_net muscat_setup contained
1 0.000021 syn keyword phpFunctions mysql_affected_rows mysql_change_user mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query contained
1 0.000031 syn keyword phpFunctions mysqli_affected_rows mysqli_autocommit mysqli_bind_param mysqli_bind_result mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect mysqli_data_seek mysqli_debug mysqli_disable_reads_from_master mysqli_disable_rpl_parse mysqli_dump_debug_info mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_errno mysqli_error mysqli_execute mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_fetch mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_client_info mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_master_query mysqli_num_fields mysqli_num_rows mysqli_options mysqli_param_count mysqli_ping mysqli_prepare_result mysqli_prepare mysqli_profiler mysqli_query mysqli_read_query_result mysqli_real_connect m 1 0.000065 syn keyword phpFunctions ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_inst 1 0.000010 syn keyword phpFunctions checkdnsrr closelog debugger_off debugger_on define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel getmxrr getprotobyname getprotobynumber getservbyname getservbyport ip2long long2ip openlog pfsockopen socket_get_status socket_set_blocking socket_set_timeout syslog contained
1 0.000004 syn keyword phpFunctions yp_all yp_cat yp_err_string yp_errno yp_first yp_get_default_domain yp_master yp_match yp_next yp_order contained
1 0.000009 syn keyword phpFunctions notes_body notes_copy_db notes_create_db notes_create_note notes_drop_db notes_find_note notes_header_info notes_list_msgs notes_mark_read notes_mark_unread notes_nav_create notes_search notes_unread notes_version contained
1 0.000003 syn keyword phpFunctions nsapi_request_headers nsapi_response_headers nsapi_virtual contained
1 0.000006 syn keyword phpFunctions aggregate_info aggregate_methods_by_list aggregate_methods_by_regexp aggregate_methods aggregate_properties_by_list aggregate_properties_by_regexp aggregate_properties aggregate aggregation_info deaggregate contained
1 0.000023 syn keyword phpFunctions ocibindbyname ocicancel ocicloselob ocicollappend ocicollassign ocicollassignelem ocicollgetelem ocicollmax ocicollsize ocicolltrim ocicolumnisnull ocicolumnname ocicolumnprecision ocicolumnscale ocicolumnsize ocicolumntype ocicolumntyperaw ocicommit ocidefinebyname ocierror ociexecute ocifetch ocifetchinto ocifetchstatement ocifreecollection ocifreecursor ocifreedesc ocifreestatement ociinternaldebug ociloadlob ocilogoff ocilogon ocinewcollection ocinewcursor ocinewdescriptor ocinlogon ocinumcols ociparse ociplogon ociresult ocirollback ocirowcount ocisavelob ocisavelobfile ociserverversion ocisetprefetch ocistatementtype ociwritelobtofile ociwritetemporarylob contained
1 0.000020 syn keyword phpFunctions odbc_autocommit odbc_binmode odbc_close_all odbc_close odbc_columnprivileges odbc_columns odbc_commit odbc_connect odbc_cursor odbc_data_source odbc_do odbc_error odbc_errormsg odbc_exec odbc_execute odbc_fetch_array odbc_fetch_into odbc_fetch_object odbc_fetch_row odbc_field_len odbc_field_name odbc_field_num odbc_field_precision odbc_field_scale odbc_field_type odbc_foreignkeys odbc_free_result odbc_gettypeinfo odbc_longreadlen odbc_next_result odbc_num_fields odbc_num_rows odbc_pconnect odbc_prepare odbc_primarykeys odbc_procedurecolumns odbc_procedures odbc_result_all odbc_result odbc_rollback odbc_setoption odbc_specialcolumns odbc_statistics odbc_tableprivileges odbc_tables contained
1 0.000023 syn keyword phpFunctions openssl_cipher_iv_length openssl_csr_export_to_file openssl_csr_export openssl_csr_get_public_key openssl_csr_get_subject openssl_csr_new openssl_csr_sign openssl_decrypt openssl_dh_compute_key openssl_digest openssl_encrypt openssl_error_string openssl_free_key openssl_get_cert_locations openssl_get_cipher_methods openssl_get_md_methods openssl_get_privatekey openssl_get_publickey openssl_open openssl_pbkdf2 openssl_pkcs12_export_to_file openssl_pkcs12_export openssl_pkcs12_read openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkey_export_to_file openssl_pkey_export openssl_pkey_free openssl_pkey_get_details openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_random_pseudo_bytes openssl_seal openssl_sign openssl_spki_export_challenge openssl_spki_export openssl_spki_new openssl_spki_verify openssl_verify openssl_x509_check_priv 1 0.000011 syn keyword phpFunctions ora_bind ora_close ora_columnname ora_columnsize ora_columntype ora_commit ora_commitoff ora_commiton ora_do ora_error ora_errorcode ora_exec ora_fetch_into ora_fetch ora_getcolumn ora_logoff ora_logon ora_numcols ora_numrows ora_open ora_parse ora_plogon ora_rollback contained
1 0.000007 syn keyword phpFunctions flush ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_gzhandler ob_implicit_flush ob_list_handlers ob_start output_add_rewrite_var output_reset_rewrite_vars contained
1 0.000002 syn keyword phpFunctions overload contained
1 0.000008 syn keyword phpFunctions ovrimos_close ovrimos_commit ovrimos_connect ovrimos_cursor ovrimos_exec ovrimos_execute ovrimos_fetch_into ovrimos_fetch_row ovrimos_field_len ovrimos_field_name ovrimos_field_num ovrimos_field_type ovrimos_free_result ovrimos_longreadlen ovrimos_num_fields ovrimos_num_rows ovrimos_prepare ovrimos_result_all ovrimos_result ovrimos_rollback contained
1 0.000007 syn keyword phpFunctions pcntl_exec pcntl_fork pcntl_signal pcntl_waitpid pcntl_wexitstatus pcntl_wifexited pcntl_wifsignaled pcntl_wifstopped pcntl_wstopsig pcntl_wtermsig contained
1 0.000006 syn keyword phpFunctions preg_grep preg_match_all preg_match preg_quote preg_replace_callback preg_replace preg_split contained
1 0.000040 syn keyword phpFunctions pdf_add_annotation pdf_add_bookmark pdf_add_launchlink pdf_add_locallink pdf_add_note pdf_add_outline pdf_add_pdflink pdf_add_thumbnail pdf_add_weblink pdf_arc pdf_arcn pdf_attach_file pdf_begin_page pdf_begin_pattern pdf_begin_template pdf_circle pdf_clip pdf_close_image pdf_close_pdi_page pdf_close_pdi pdf_close pdf_closepath_fill_stroke pdf_closepath_stroke pdf_closepath pdf_concat pdf_continue_text pdf_curveto pdf_delete pdf_end_page pdf_end_pattern pdf_end_template pdf_endpath pdf_fill_stroke pdf_fill pdf_findfont pdf_get_buffer pdf_get_font pdf_get_fontname pdf_get_fontsize pdf_get_image_height pdf_get_image_width pdf_get_majorversion pdf_get_minorversion pdf_get_parameter pdf_get_pdi_parameter pdf_get_pdi_value pdf_get_value pdf_initgraphics pdf_lineto pdf_makespotcolor pdf_moveto pdf_new pdf_open_CCITT pdf_open_file pdf_open_gif pdf_open_image_file pdf_open_image pdf_open_jpeg pdf_open_memory_image pdf_open_pdi_page pdf_open_pdi pdf_open_png pdf_open_tiff pdf_open pdf_place_im 1 0.000004 syn keyword phpFunctions pfpro_cleanup pfpro_init pfpro_process_raw pfpro_process pfpro_version contained
1 0.000023 syn keyword phpFunctions pg_affected_rows pg_cancel_query pg_client_encoding pg_close pg_connect pg_connection_busy pg_connection_reset pg_connection_status pg_convert pg_copy_from pg_copy_to pg_dbname pg_delete pg_end_copy pg_escape_bytea pg_escape_string pg_fetch_all pg_fetch_array pg_fetch_assoc pg_fetch_object pg_fetch_result pg_fetch_row pg_field_is_null pg_field_name pg_field_num pg_field_prtlen pg_field_size pg_field_type pg_free_result pg_get_notify pg_get_pid pg_get_result pg_host pg_insert pg_last_error pg_last_notice pg_last_oid pg_lo_close pg_lo_create pg_lo_export pg_lo_import pg_lo_open pg_lo_read_all pg_lo_read pg_lo_seek pg_lo_tell pg_lo_unlink pg_lo_write pg_meta_data pg_num_fields pg_num_rows pg_options pg_pconnect pg_ping pg_port pg_put_line pg_query pg_result_error pg_result_seek pg_result_status pg_select pg_send_query pg_set_client_encoding pg_trace pg_tty pg_unescape_bytea pg_untrace pg_update contained
1 0.000014 syn keyword phpFunctions posix_ctermid posix_get_last_error posix_getcwd posix_getegid posix_geteuid posix_getgid posix_getgrgid posix_getgrnam posix_getgroups posix_getlogin posix_getpgid posix_getpgrp posix_getpid posix_getppid posix_getpwnam posix_getpwuid posix_getrlimit posix_getsid posix_getuid posix_isatty posix_kill posix_mkfifo posix_setegid posix_seteuid posix_setgid posix_setpgid posix_setsid posix_setuid posix_strerror posix_times posix_ttyname posix_uname contained
1 0.000012 syn keyword phpFunctions printer_abort printer_close printer_create_brush printer_create_dc printer_create_font printer_create_pen printer_delete_brush printer_delete_dc printer_delete_font printer_delete_pen printer_draw_bmp printer_draw_chord printer_draw_elipse printer_draw_line printer_draw_pie printer_draw_rectangle printer_draw_roundrect printer_draw_text printer_end_doc printer_end_page printer_get_option printer_list printer_logical_fontheight printer_open printer_select_brush printer_select_font printer_select_pen printer_set_option printer_start_doc printer_start_page printer_write contained
1 0.000007 syn keyword phpFunctions pspell_add_to_personal pspell_add_to_session pspell_check pspell_clear_session pspell_config_create pspell_config_ignore pspell_config_mode pspell_config_personal pspell_config_repl pspell_config_runtogether pspell_config_save_repl pspell_new_config pspell_new_personal pspell_new pspell_save_wordlist pspell_store_replacement pspell_suggest contained
1 0.000002 syn keyword phpFunctions qdom_error qdom_tree contained
1 0.000005 syn keyword phpFunctions readline_add_history readline_clear_history readline_completion_function readline_info readline_list_history readline_read_history readline_write_history readline contained
1 0.000002 syn keyword phpFunctions recode_file recode_string recode contained
1 0.000006 syn keyword phpFunctions ereg_replace ereg eregi_replace eregi split spliti sql_regcase contained
1 0.000007 syn keyword phpFunctions ftok msg_get_queue msg_receive msg_remove_queue msg_send msg_set_queue msg_stat_queue sem_acquire sem_get sem_release sem_remove shm_attach shm_detach shm_get_var shm_put_var shm_remove_var shm_remove contained
1 0.000008 syn keyword phpFunctions sesam_affected_rows sesam_commit sesam_connect sesam_diagnostic sesam_disconnect sesam_errormsg sesam_execimm sesam_fetch_array sesam_fetch_result sesam_fetch_row sesam_field_array sesam_field_name sesam_free_result sesam_num_fields sesam_query sesam_rollback sesam_seek_row sesam_settransaction contained
1 0.000011 syn keyword phpFunctions session_cache_expire session_cache_limiter session_decode session_destroy session_encode session_get_cookie_params session_id session_is_registered session_module_name session_name session_regenerate_id session_register session_save_path session_set_cookie_params session_set_save_handler session_start session_unregister session_unset session_write_close contained
1 0.000004 syn keyword phpFunctions shmop_close shmop_delete shmop_open shmop_read shmop_size shmop_write contained
1 0.000004 syn keyword phpFunctions snmp_get_quick_print snmp_set_quick_print snmpget snmprealwalk snmpset snmpwalk snmpwalkoid contained
1 0.000016 syn keyword phpFunctions socket_accept socket_bind socket_clear_error socket_close socket_connect socket_create_listen socket_create_pair socket_create socket_get_option socket_getpeername socket_getsockname socket_iovec_add socket_iovec_alloc socket_iovec_delete socket_iovec_fetch socket_iovec_free socket_iovec_set socket_last_error socket_listen socket_read socket_readv socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_shutdown socket_strerror socket_write socket_writev contained
1 0.000013 syn keyword phpFunctions sqlite_array_query sqlite_busy_timeout sqlite_changes sqlite_close sqlite_column sqlite_create_aggregate sqlite_create_function sqlite_current sqlite_error_string sqlite_escape_string sqlite_fetch_array sqlite_fetch_single sqlite_fetch_string sqlite_field_name sqlite_has_more sqlite_last_error sqlite_last_insert_rowid sqlite_libencoding sqlite_libversion sqlite_next sqlite_num_fields sqlite_num_rows sqlite_open sqlite_popen sqlite_query sqlite_rewind sqlite_seek sqlite_udf_decode_binary sqlite_udf_encode_binary sqlite_unbuffered_query contained
1 0.000014 syn keyword phpFunctions stream_context_create stream_context_get_options stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_register_wrapper stream_select stream_set_blocking stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_get_name stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_wrapper_register contained
1 0.000030 syn keyword phpFunctions addcslashes addslashes bin2hex chop chr chunk_split convert_cyr_string count_chars crc32 crypt explode fprintf get_html_translation_table hebrev hebrevc html_entity_decode htmlentities htmlspecialchars implode join levenshtein localeconv ltrim md5_file md5 metaphone money_format nl_langinfo nl2br number_format ord parse_str print printf quoted_printable_decode quotemeta rtrim setlocale sha1_file sha1 similar_text soundex sprintf sscanf str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpos strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr substr_compare substr_count substr_replace substr trim ucfirst ucwords vprintf vsprintf wordwrap contained
1 0.000026 syn keyword phpFunctions swf_actiongeturl swf_actiongotoframe swf_actiongotolabel swf_actionnextframe swf_actionplay swf_actionprevframe swf_actionsettarget swf_actionstop swf_actiontogglequality swf_actionwaitforframe swf_addbuttonrecord swf_addcolor swf_closefile swf_definebitmap swf_definefont swf_defineline swf_definepoly swf_definerect swf_definetext swf_endbutton swf_enddoaction swf_endshape swf_endsymbol swf_fontsize swf_fontslant swf_fonttracking swf_getbitmapinfo swf_getfontinfo swf_getframe swf_labelframe swf_lookat swf_modifyobject swf_mulcolor swf_nextid swf_oncondition swf_openfile swf_ortho2 swf_ortho swf_perspective swf_placeobject swf_polarview swf_popmatrix swf_posround swf_pushmatrix swf_removeobject swf_rotate swf_scale swf_setfont swf_setframe swf_shapearc swf_shapecurveto3 swf_shapecurveto swf_shapefillbitmapclip swf_shapefillbitmaptile swf_shapefilloff swf_shapefillsolid swf_shapelinesolid swf_shapelineto swf_shapemoveto swf_showframe swf_startbutton swf_startdoaction swf_startshape swf_ 1 0.000014 syn keyword phpFunctions sybase_affected_rows sybase_close sybase_connect sybase_data_seek sybase_deadlock_retry_count sybase_fetch_array sybase_fetch_assoc sybase_fetch_field sybase_fetch_object sybase_fetch_row sybase_field_seek sybase_free_result sybase_get_last_message sybase_min_client_severity sybase_min_error_severity sybase_min_message_severity sybase_min_server_severity sybase_num_fields sybase_num_rows sybase_pconnect sybase_query sybase_result sybase_select_db sybase_set_message_handler sybase_unbuffered_query contained
1 0.000011 syn keyword phpFunctions tidy_access_count tidy_clean_repair tidy_config_count tidy_diagnose tidy_error_count tidy_get_body tidy_get_config tidy_get_error_buffer tidy_get_head tidy_get_html_ver tidy_get_html tidy_get_output tidy_get_release tidy_get_root tidy_get_status tidy_getopt tidy_is_xhtml tidy_load_config tidy_parse_file tidy_parse_string tidy_repair_file tidy_repair_string tidy_reset_config tidy_save_config tidy_set_encoding tidy_setopt tidy_warning_count contained
1 0.000006 syn keyword phpMethods attributes children get_attr get_nodes has_children has_siblings is_asp is_comment is_html is_jsp is_jste is_text is_xhtml is_xml next prev tidy_node contained
1 0.000004 syn keyword phpFunctions token_get_all token_name contained
1 0.000004 syn keyword phpFunctions base64_decode base64_encode get_meta_tags http_build_query parse_url rawurldecode rawurlencode urldecode urlencode contained
1 0.000013 syn keyword phpFunctions doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string isset print_r serialize settype strval unserialize unset var_dump var_export contained
1 0.000008 syn keyword phpFunctions vpopmail_add_alias_domain_ex vpopmail_add_alias_domain vpopmail_add_domain_ex vpopmail_add_domain vpopmail_add_user vpopmail_alias_add vpopmail_alias_del_domain vpopmail_alias_del vpopmail_alias_get_all vpopmail_alias_get vpopmail_auth_user vpopmail_del_domain_ex vpopmail_del_domain vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota contained
1 0.000003 syn keyword phpFunctions w32api_deftype w32api_init_dtype w32api_invoke_function w32api_register_function w32api_set_call_method contained
1 0.000007 syn keyword phpFunctions wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars contained
1 0.000012 syn keyword phpFunctions utf8_decode utf8_encode xml_error_string xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_parse_into_struct xml_parse xml_parser_create_ns xml_parser_create xml_parser_free xml_parser_get_option xml_parser_set_option xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler contained
1 0.000008 syn keyword phpFunctions xmlrpc_decode_request xmlrpc_decode xmlrpc_encode_request xmlrpc_encode xmlrpc_get_type xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type contained
1 0.000007 syn keyword phpFunctions xslt_create xslt_errno xslt_error xslt_free xslt_output_process xslt_set_base xslt_set_encoding xslt_set_error_handler xslt_set_log xslt_set_sax_handler xslt_set_sax_handlers xslt_set_scheme_handler xslt_set_scheme_handlers contained
1 0.000011 syn keyword phpFunctions yaz_addinfo yaz_ccl_conf yaz_ccl_parse yaz_close yaz_connect yaz_database yaz_element yaz_errno yaz_error yaz_es_result yaz_get_option yaz_hits yaz_itemorder yaz_present yaz_range yaz_record yaz_scan_result yaz_scan yaz_schema yaz_search yaz_set_option yaz_sort yaz_syntax yaz_wait contained
1 0.000005 syn keyword phpFunctions zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read contained
1 0.000007 syn keyword phpFunctions gzclose gzcompress gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite readgzfile zlib_get_coding_type contained
1 0.000008 if exists( "php_baselib" )
syn keyword phpMethods query next_record num_rows affected_rows nf f p np num_fields haltmsg seek link_id query_id metadata table_names nextid connect halt free register unregister is_registered delete url purl self_url pself_url hidden_session add_query padd_query reimport_get_vars reimport_post_vars reimport_cookie_vars set_container set_tokenname release_token put_headers get_id get_id put_id freeze thaw gc reimport_any_vars start url purl login_if is_authenticated auth_preauth auth_loginform auth_validatelogin auth_refreshlogin auth_registerform auth_doregister start check have_perm permsum perm_invalid contained
syn keyword phpFunctions page_open page_close sess_load sess_save contained
endif
" Conditional
1 0.000009 syn keyword phpConditional declare else enddeclare endswitch elseif endif if switch contained
" Repeat
1 0.000008 syn keyword phpRepeat as do endfor endforeach endwhile for foreach while contained
" Repeat
1 0.000006 syn keyword phpLabel case default switch contained
" Statement
1 0.000007 syn keyword phpStatement return break continue exit goto yield contained
" Keyword
1 0.000005 syn keyword phpKeyword var const contained
" Type
1 0.000010 syn keyword phpType bool boolean int integer real double float string array object NULL callable iterable contained
" Structure
1 0.000007 syn keyword phpStructure namespace extends implements instanceof parent self contained
" Operator
1 0.000013 syn match phpOperator "[-=+%^&|*!.~?:]" contained display
1 0.000004 syn match phpOperator "[-+*/%^&|.]=" contained display
1 0.000004 syn match phpOperator "/[^*/]"me=e-1 contained display
1 0.000003 syn match phpOperator "\$" contained display
1 0.000006 syn match phpOperator "&&\|\<and\>" contained display
1 0.000003 syn match phpOperator "||\|\<x\=or\>" contained display
1 0.000007 syn match phpRelation "[!=<>]=" contained display
1 0.000003 syn match phpRelation "[<>]" contained display
1 0.000006 syn match phpMemberSelector "->" contained display
1 0.000006 syn match phpVarSelector "\$" contained display
" Identifier
1 0.000010 syn match phpIdentifier "$\h\w*" contained contains=phpEnvVar,phpIntVar,phpVarSelector display
1 0.000012 syn match phpIdentifierSimply "${\h\w*}" contains=phpOperator,phpParent contained display
1 0.000021 syn region phpIdentifierComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend
1 0.000007 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained
" Interpolated indentifiers (inside strings)
1 0.000006 syn match phpBrackets "[][}{]" contained display
" errors
1 0.000007 syn match phpInterpSimpleError "\[[^]]*\]" contained display " fallback (if nothing else matches)
1 0.000003 syn match phpInterpSimpleError "->[^a-zA-Z_]" contained display
" make sure these stay above the correct DollarCurlies so they don't take priority
1 0.000006 syn match phpInterpBogusDollarCurley "${[^}]*}" contained display " fallback (if nothing else matches)
1 0.000009 syn match phpinterpSimpleBracketsInner "\w\+" contained
1 0.000009 syn match phpInterpSimpleBrackets "\[\h\w*]" contained contains=phpBrackets,phpInterpSimpleBracketsInner
1 0.000005 syn match phpInterpSimpleBrackets "\[\d\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner
1 0.000008 syn match phpInterpSimpleBrackets "\[0[xX]\x\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner
1 0.000014 syn match phpInterpSimple "\$\h\w*\(\[[^]]*\]\|->\h\w*\)\?" contained contains=phpInterpSimpleBrackets,phpIdentifier,phpInterpSimpleError,phpMethods,phpMemberSelector display
1 0.000006 syn match phpInterpVarname "\h\w*" contained
1 0.000006 syn match phpInterpMethodName "\h\w*" contained " default color
1 0.000007 syn match phpInterpSimpleCurly "\${\h\w*}" contains=phpInterpVarname contained extend
1 0.000010 syn region phpInterpDollarCurley1Helper matchgroup=phpParent start="{" end="\[" contains=phpInterpVarname contained
1 0.000012 syn region phpInterpDollarCurly1 matchgroup=phpParent start="\${\h\w*\["rs=s+1 end="]}" contains=phpInterpDollarCurley1Helper,@phpClConst contained extend
1 0.000014 syn match phpInterpDollarCurley2Helper "{\h\w*->" contains=phpBrackets,phpInterpVarname,phpMemberSelector contained
1 0.000011 syn region phpInterpDollarCurly2 matchgroup=phpParent start="\${\h\w*->"rs=s+1 end="}" contains=phpInterpDollarCurley2Helper,phpInterpMethodName contained
1 0.000003 syn match phpInterpBogusDollarCurley "${\h\w*->}" contained display
1 0.000003 syn match phpInterpBogusDollarCurley "${\h\w*\[]}" contained display
1 0.000013 syn region phpInterpComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend
1 0.000006 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained
" define a cluster to get all interpolation syntaxes for double-quoted strings
1 0.000008 syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex
" Methoden
1 0.000009 syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display
" Include
1 0.000007 syn keyword phpInclude include require include_once require_once use contained
" Define
1 0.000006 syn keyword phpDefine new clone contained
" Boolean
1 0.000006 syn keyword phpBoolean true false contained
" Number
1 0.000011 syn match phpNumber "-\=\<\d\+\>" contained display
1 0.000004 syn match phpNumber "\<0x\x\{1,8}\>" contained display
" Float
1 0.000007 syn match phpFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" contained display
" Backslash escapes
1 0.000001 syn case match
" for double quotes and heredoc
1 0.000007 syn match phpBackslashSequences "\\[fnrtv\\\"$]" contained display
1 0.000008 syn match phpBackslashSequences "\\\d\{1,3}" contained contains=phpOctalError display
1 0.000006 syn match phpBackslashSequences "\\x\x\{1,2}" contained display
" additional sequence for double quotes only
1 0.000007 syn match phpBackslashDoubleQuote "\\[\"]" contained display
" for single quotes only
1 0.000006 syn match phpBackslashSingleQuote "\\[\\']" contained display
1 0.000001 syn case ignore
" Error
1 0.000003 syn match phpOctalError "[89]" contained display
1 0.000003 if exists("php_parent_error_close")
syn match phpParentError "[)\]}]" contained display
endif
" Todo
1 0.000006 syn keyword phpTodo todo fixme xxx contained
" Comment
1 0.000003 if exists("php_parent_error_open")
syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell
else
1 0.000010 syn region phpComment start="/\*" end="\*/" contained contains=phpTodo,@Spell extend
1 0.000001 endif
1 0.000006 syn match phpComment "#.\{-}\(?>\|$\)\@=" contained contains=phpTodo,@Spell
1 0.000008 syn match phpComment "//.\{-}\(?>\|$\)\@=" contained contains=phpTodo,@Spell
" String
1 0.000003 if exists("php_parent_error_open")
syn region phpStringDouble matchgroup=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble,@Spell contained keepend
syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained keepend
syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote,@Spell contained keepend
else
1 0.000016 syn region phpStringDouble matchgroup=phpStringDouble start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble,@Spell contained extend keepend
1 0.000015 syn region phpBacktick matchgroup=phpBacktick start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex contained extend keepend
1 0.000012 syn region phpStringSingle matchgroup=phpStringSingle start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpBackslashSingleQuote,@Spell contained keepend extend
1 0.000001 endif
" HereDoc and NowDoc
1 0.000001 syn case match
" HereDoc
1 0.000026 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\I\i*\)\2$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend
" including HTML,JavaScript,SQL even if not enabled via options
1 0.000020 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend
1 0.000515 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend
1 0.000026 syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)\2$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar,@Spell keepend extend
" NowDoc
1 0.000032 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\I\i*\)'$" end="^\z1\(;\=$\)\@=" contained contains=@Spell keepend extend
" including HTML,JavaScript,SQL even if not enabled via options
1 0.000017 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,@Spell keepend extend
1 0.000014 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,@Spell keepend extend
1 0.000015 syn region phpNowDoc matchgroup=Delimiter start="\(<<<\)\@<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,@Spell keepend extend
1 0.000002 syn case ignore
" Parent
1 0.000010 if exists("php_parent_error_close") || exists("php_parent_error_open")
syn match phpParent "[{}]" contained
syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClInside transparent
syn region phpParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phpClInside transparent
if !exists("php_parent_error_close")
syn match phpParent "[\])]" contained
endif
else
1 0.000004 syn match phpParent "[({[\]})]" contained
1 0.000001 endif
1 0.000031 syn cluster phpClConst contains=phpFunctions,phpIdentifier,phpConditional,phpRepeat,phpStatement,phpOperator,phpRelation,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException
1 0.000014 syn cluster phpClInside contains=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc
1 0.000010 syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass
1 0.000026 syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch
" Php Region
1 0.000003 if exists("php_parent_error_open")
if exists("php_noShortTags")
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop
else
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop
endif
syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop
if exists("php_asp_tags")
syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop
endif
else
1 0.000003 if exists("php_noShortTags")
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop keepend
else
1 0.000013 syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop keepend
1 0.000001 endif
1 0.000014 syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop keepend
1 0.000002 if exists("php_asp_tags")
syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop keepend
endif
1 0.000001 endif
" Fold
1 0.000003 if exists("php_folding") && php_folding==1
" match one line constructs here and skip them at folding
syn keyword phpSCKeyword abstract final private protected public static contained
syn keyword phpFCKeyword function contained
syn keyword phpStorageClass global contained
syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained
syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)finally\(\s\+.*}\)\@=" contained
set foldmethod=syntax
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend
syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend
syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
else
1 0.000004 syn keyword phpDefine function contained
1 0.000004 syn keyword phpStructure abstract class trait interface contained
1 0.000003 syn keyword phpException catch throw try finally contained
1 0.000005 syn keyword phpStorageClass final global private protected public static contained
1 0.000003 if exists("php_folding") && php_folding==2
set foldmethod=syntax
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
syn region phpParent matchgroup=Delimiter start="{" end="}" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold
endif
1 0.000001 endif
" ================================================================
" Peter Hodge - June 9, 2006
" Some of these changes (highlighting isset/unset/echo etc) are not so
" critical, but they make things more colourful. :-)
" different syntax highlighting for 'echo', 'print', 'switch', 'die' and 'list' keywords
" to better indicate what they are.
1 0.000003 syntax keyword phpDefine echo print contained
1 0.000002 syntax keyword phpStructure list contained
1 0.000002 syntax keyword phpConditional switch contained
1 0.000002 syntax keyword phpStatement die contained
" Highlighting for PHP5's user-definable magic class methods
1 0.000023 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier
\ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo
" Highlighting for __autoload slightly different from line above
1 0.000012 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ __autoload
1 0.000003 hi def link phpSpecialFunction phpOperator
" Highlighting for PHP5's built-in classes
" - built-in classes harvested from get_declared_classes() in 5.1.4
1 0.000076 syntax keyword phpClasses containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ stdClass __PHP_Incomplete_Class php_user_filter Directory ArrayObject
\ Exception ErrorException LogicException BadFunctionCallException BadMethodCallException DomainException
\ RecursiveIteratorIterator IteratorIterator FilterIterator RecursiveFilterIterator ParentIterator LimitIterator
\ CachingIterator RecursiveCachingIterator NoRewindIterator AppendIterator InfiniteIterator EmptyIterator
\ ArrayIterator RecursiveArrayIterator DirectoryIterator RecursiveDirectoryIterator
\ InvalidArgumentException LengthException OutOfRangeException RuntimeException OutOfBoundsException
\ OverflowException RangeException UnderflowException UnexpectedValueException
\ PDO PDOException PDOStatement PDORow
\ Reflection ReflectionFunction ReflectionParameter ReflectionMethod ReflectionClass
\ ReflectionObject ReflectionProperty ReflectionExtension ReflectionException
\ SplFileInfo SplFileObject SplTempFileObject SplObjectStorage
\ XMLWriter LibXMLError XMLReader SimpleXMLElement SimpleXMLIterator
\ DOMException DOMStringList DOMNameList DOMDomError DOMErrorHandler
\ DOMImplementation DOMImplementationList DOMImplementationSource
\ DOMNode DOMNameSpaceNode DOMDocumentFragment DOMDocument DOMNodeList DOMNamedNodeMap
\ DOMCharacterData DOMAttr DOMElement DOMText DOMComment DOMTypeinfo DOMUserDataHandler
\ DOMLocator DOMConfiguration DOMCdataSection DOMDocumentType DOMNotation DOMEntity
\ DOMEntityReference DOMProcessingInstruction DOMStringExtend DOMXPath
1 0.000006 hi def link phpClasses phpFunctions
" Highlighting for PHP5's built-in interfaces
" - built-in classes harvested from get_declared_interfaces() in 5.1.4
1 0.000021 syntax keyword phpInterfaces containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ Iterator IteratorAggregate RecursiveIterator OuterIterator SeekableIterator
\ Traversable ArrayAccess Serializable Countable SplObserver SplSubject Reflector
1 0.000002 hi def link phpInterfaces phpConstant
" option defaults:
1 0.000004 if ! exists('php_special_functions')
1 0.000004 let php_special_functions = 1
1 0.000001 endif
1 0.000002 if ! exists('php_alt_comparisons')
1 0.000002 let php_alt_comparisons = 1
1 0.000001 endif
1 0.000002 if ! exists('php_alt_assignByReference')
1 0.000002 let php_alt_assignByReference = 1
1 0.000001 endif
1 0.000001 if php_special_functions
" Highlighting for PHP built-in functions which exhibit special behaviours
" - isset()/unset()/empty() are not real functions.
" - compact()/extract() directly manipulate variables in the local scope where
" regular functions would not be able to.
" - eval() is the token 'make_your_code_twice_as_complex()' function for PHP.
" - user_error()/trigger_error() can be overloaded by set_error_handler and also
" have the capacity to terminate your script when type is E_USER_ERROR.
1 0.000016 syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle
\ user_error trigger_error isset unset eval extract compact empty
1 0.000001 endif
1 0.000002 if php_alt_assignByReference
" special highlighting for '=&' operator
1 0.000024 syntax match phpAssignByRef /=\s*&/ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle
1 0.000013 hi def link phpAssignByRef Type
1 0.000001 endif
1 0.000055 if php_alt_comparisons
" highlight comparison operators differently
1 0.000032 syntax match phpComparison "\v[=!]\=\=?" contained containedin=phpRegion
1 0.000019 syntax match phpComparison "\v[=<>-]@<![<>]\=?[<>]@!" contained containedin=phpRegion
" highlight the 'instanceof' operator as a comparison operator rather than a structure
1 0.000002 syntax case ignore
1 0.000006 syntax keyword phpComparison instanceof contained containedin=phpRegion
1 0.000011 hi def link phpComparison Statement
1 0.000001 endif
" ================================================================
" Sync
1 0.000003 if php_sync_method==-1
if exists("php_noShortTags")
syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$"
else
syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\)\=\s*$"
endif
syn sync match phpRegionSync grouphere phpRegionSc +^\s*<script language="php">\s*$+
if exists("php_asp_tags")
syn sync match phpRegionSync grouphere phpRegionAsp "^\s*<%\(=\)\=\s*$"
endif
syn sync match phpRegionSync grouphere NONE "^\s*?>\s*$"
syn sync match phpRegionSync grouphere NONE "^\s*%>\s*$"
syn sync match phpRegionSync grouphere phpRegion "function\s.*(.*\$"
"syn sync match phpRegionSync grouphere NONE "/\i*>\s*$"
elseif php_sync_method>0
exec "syn sync minlines=" . php_sync_method
else
1 0.000005 exec "syn sync fromstart"
1 0.000001 endif
1 0.000017 syntax match phpDocCustomTags "@[a-zA-Z]*\(\s\+\|\n\|\r\)" containedin=phpComment
1 0.000017 syntax region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment
1 0.000019 syntax match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment
1 0.000009 syntax match phpDocTodo "@\(todo\|fixme\|xxx\)\(\s\+\)\?" containedin=phpComment
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
1 0.000005 hi def link phpConstant Constant
1 0.000005 hi def link phpCoreConstant Constant
1 0.000004 hi def link phpComment Comment
1 0.000004 hi def link phpDocTags PreProc
1 0.000005 hi def link phpDocCustomTags Type
1 0.000004 hi def link phpException Exception
1 0.000004 hi def link phpBoolean Boolean
1 0.000004 hi def link phpStorageClass StorageClass
1 0.000004 hi def link phpSCKeyword StorageClass
1 0.000004 hi def link phpFCKeyword Define
1 0.000004 hi def link phpStructure Structure
1 0.000004 hi def link phpStringSingle String
1 0.000004 hi def link phpStringDouble String
1 0.000004 hi def link phpBacktick String
1 0.000004 hi def link phpNumber Number
1 0.000004 hi def link phpFloat Float
1 0.000004 hi def link phpMethods Function
1 0.000004 hi def link phpFunctions Function
1 0.000008 hi def link phpBaselib Function
1 0.000004 hi def link phpRepeat Repeat
1 0.000004 hi def link phpConditional Conditional
1 0.000004 hi def link phpLabel Label
1 0.000004 hi def link phpStatement Statement
1 0.000007 hi def link phpKeyword Statement
1 0.000005 hi def link phpType Type
1 0.000004 hi def link phpInclude Include
1 0.000004 hi def link phpDefine Define
1 0.000005 hi def link phpBackslashSequences SpecialChar
1 0.000005 hi def link phpBackslashDoubleQuote SpecialChar
1 0.000005 hi def link phpBackslashSingleQuote SpecialChar
1 0.000005 hi def link phpParent Delimiter
1 0.000005 hi def link phpBrackets Delimiter
1 0.000009 hi def link phpIdentifierConst Delimiter
1 0.000004 hi def link phpParentError Error
1 0.000004 hi def link phpOctalError Error
1 0.000005 hi def link phpInterpSimpleError Error
1 0.000005 hi def link phpInterpBogusDollarCurley Error
1 0.000005 hi def link phpInterpDollarCurly1 Error
1 0.000004 hi def link phpInterpDollarCurly2 Error
1 0.000005 hi def link phpInterpSimpleBracketsInner String
1 0.000005 hi def link phpInterpSimpleCurly Delimiter
1 0.000005 hi def link phpInterpVarname Identifier
1 0.000004 hi def link phpTodo Todo
1 0.000004 hi def link phpDocTodo Todo
1 0.000004 hi def link phpMemberSelector Structure
1 0.000003 if exists("php_oldStyle")
hi def phpIntVar guifg=Red ctermfg=DarkRed
hi def phpEnvVar guifg=Red ctermfg=DarkRed
hi def phpOperator guifg=SeaGreen ctermfg=DarkGreen
hi def phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
hi def phpRelation guifg=SeaGreen ctermfg=DarkGreen
hi def phpIdentifier guifg=DarkGray ctermfg=Brown
hi def phpIdentifierSimply guifg=DarkGray ctermfg=Brown
else
1 0.000005 hi def link phpIntVar Identifier
1 0.000008 hi def link phpEnvVar Identifier
1 0.000005 hi def link phpOperator Operator
1 0.000005 hi def link phpVarSelector Operator
1 0.000005 hi def link phpRelation Operator
1 0.000005 hi def link phpIdentifier Identifier
1 0.000005 hi def link phpIdentifierSimply Identifier
1 0.000001 endif
1 0.000004 let b:current_syntax = "php"
1 0.000003 if main_syntax == 'php'
1 0.000003 unlet main_syntax
1 0.000001 endif
" put cpoptions back the way we found it
1 0.000010 let &cpo = s:cpo_save
1 0.000002 unlet s:cpo_save
" vim: ts=8 sts=2 sw=2 expandtab
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/html.vim
Sourced 1 time
Total time: 0.021998
Self time: 0.005507
count total (s) self (s)
" Vim syntax file
" Language: HTML
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
" Last Change: 2017 Sep 30
" included patch from Christian Brabandt to make use of the strikethrough attributes
"
" Please check :help html.vim for some comments and a description of the options
" quit when a syntax file was already loaded
1 0.000011 if !exists("main_syntax")
if exists("b:current_syntax")
finish
endif
let main_syntax = 'html'
endif
1 0.000008 let s:cpo_save = &cpo
1 0.000009 set cpo&vim
1 0.000003 syntax spell toplevel
1 0.000001 syn case ignore
" mark illegal characters
1 0.000033 syn match htmlError "[<>&]"
" tags
1 0.000025 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
1 0.000022 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
1 0.000013 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
1 0.000016 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
1 0.000038 syn region htmlTag start=+<[^/]+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
1 0.000019 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
1 0.000028 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
1 0.000007 syn match htmlTagError contained "[^>]<"ms=s+1
" tag names
1 0.000014 syn keyword htmlTagName contained address applet area a base basefont
1 0.000013 syn keyword htmlTagName contained big blockquote br caption center
1 0.000029 syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
1 0.000017 syn keyword htmlTagName contained form hr html img
1 0.000015 syn keyword htmlTagName contained input isindex kbd li link map menu
1 0.000012 syn keyword htmlTagName contained meta ol option param pre p samp span
1 0.000016 syn keyword htmlTagName contained select small sub sup
1 0.000019 syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
1 0.000013 syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
" new html 4.0 tags
1 0.000005 syn keyword htmlTagName contained abbr acronym bdo button col label
1 0.000005 syn keyword htmlTagName contained colgroup fieldset iframe ins legend
1 0.000005 syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
" new html 5 tags
1 0.000020 syn keyword htmlTagName contained article aside audio bdi canvas data
1 0.000006 syn keyword htmlTagName contained datalist details embed figcaption figure
1 0.000005 syn keyword htmlTagName contained footer header hgroup keygen main mark
1 0.000004 syn keyword htmlTagName contained menuitem meter nav output picture
1 0.000005 syn keyword htmlTagName contained progress rb rp rt rtc ruby section
1 0.000005 syn keyword htmlTagName contained slot source template time track video wbr
" legal arg names
1 0.000004 syn keyword htmlArg contained action
1 0.000005 syn keyword htmlArg contained align alink alt archive background bgcolor
1 0.000004 syn keyword htmlArg contained border bordercolor cellpadding
1 0.000005 syn keyword htmlArg contained cellspacing checked class clear code codebase color
1 0.000005 syn keyword htmlArg contained cols colspan content coords enctype face
1 0.000004 syn keyword htmlArg contained gutter height hspace id
1 0.000004 syn keyword htmlArg contained link lowsrc marginheight
1 0.000009 syn keyword htmlArg contained marginwidth maxlength method name prompt
1 0.000006 syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
1 0.000005 syn keyword htmlArg contained size src start target text type url
1 0.000005 syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
1 0.000012 syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
" Netscape extensions
1 0.000005 syn keyword htmlTagName contained frame noframes frameset nobr blink
1 0.000004 syn keyword htmlTagName contained layer ilayer nolayer spacer
1 0.000022 syn keyword htmlArg contained frameborder noresize pagex pagey above below
1 0.000013 syn keyword htmlArg contained left top visibility clip id noshade
1 0.000005 syn match htmlArg contained "\<z-index\>"
" Microsoft extensions
1 0.000005 syn keyword htmlTagName contained marquee
" html 4.0 arg names
1 0.000014 syn match htmlArg contained "\<\(accept-charset\|label\)\>"
1 0.000015 syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
1 0.000012 syn keyword htmlArg contained cite classid codetype compact data datetime
1 0.000011 syn keyword htmlArg contained declare defer dir disabled for frame
1 0.000012 syn keyword htmlArg contained headers hreflang lang language longdesc
1 0.000009 syn keyword htmlArg contained multiple nohref nowrap object profile readonly
1 0.000005 syn keyword htmlArg contained rules scheme scope span standby style
1 0.000004 syn keyword htmlArg contained summary tabindex valuetype version
" html 5 arg names
1 0.000005 syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
1 0.000004 syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
1 0.000005 syn keyword htmlArg contained controls crossorigin default dirname download
1 0.000004 syn keyword htmlArg contained draggable dropzone form formaction formenctype
1 0.000004 syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
1 0.000005 syn keyword htmlArg contained high icon inputmode keytype kind list loop low
1 0.000009 syn keyword htmlArg contained max min minlength muted nonce novalidate open
1 0.000005 syn keyword htmlArg contained optimum pattern placeholder poster preload
1 0.000004 syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
1 0.000005 syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
1 0.000003 syn keyword htmlArg contained typemustmatch
" special characters
1 0.000010 syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
" Comments (the real ones or the old netscape ones)
1 0.000007 if exists("html_wrong_comments")
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
else
1 0.000025 syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
1 0.000004 syn match htmlCommentError contained "[^><!]"
1 0.000012 syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
1 0.000004 endif
1 0.000006 syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
" server-parsed commands
1 0.000075 syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
1 0.000010 syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
1 0.000003 syn match htmlPreError contained "<!--#\S*"ms=s+4
1 0.000013 syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
1 0.000013 syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
1 0.000003 syn match htmlPreProcAttrError contained "\w\+="he=e-1
1 0.000006 syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
1 0.000004 if !exists("html_no_rendering")
" rendering
1 0.000027 syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
1 0.000010 syn region htmlStrike start="<del\>" end="</del>"me=e-6 contains=@htmlTop
1 0.000006 syn region htmlStrike start="<strike\>" end="</strike>"me=e-9 contains=@htmlTop
1 0.000021 syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
1 0.000016 syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
1 0.000019 syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
1 0.000012 syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline
1 0.000008 syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline
1 0.000013 syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
1 0.000011 syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
1 0.000015 syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
1 0.000024 syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
1 0.000059 syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic
1 0.000012 syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic
1 0.000012 syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold
1 0.000012 syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold
1 0.000005 syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
1 0.000009 syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
1 0.000006 syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
1 0.000005 syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
1 0.000015 syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
1 0.000007 syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop
1 0.000013 syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline
1 0.000015 syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline
1 0.000006 syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop
1 0.000010 syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold
1 0.000009 syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
1 0.000006 syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
1 0.000007 syn match htmlLeadingSpace "^\s\+" contained
1 0.000026 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc
1 0.000013 syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
1 0.000008 syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
1 0.000008 syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
1 0.000028 syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop
1 0.000010 syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
1 0.000012 syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
1 0.000038 syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
1 0.000021 syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
1 0.000001 endif
1 0.000004 syn keyword htmlTagName contained noscript
1 0.000004 syn keyword htmlSpecialTagName contained script style
1 0.000005 if main_syntax != 'java' || exists("java_javascript")
" JAVA SCRIPT
1 0.001650 0.000545 syn include @htmlJavaScript syntax/javascript.vim
1 0.000003 unlet b:current_syntax
1 0.000034 syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
1 0.000023 syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
1 0.000005 hi def link htmlScriptTag htmlTag
" html events (i.e. arguments that include javascript commands)
1 0.000005 if exists("html_extended_events")
syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ
syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ
else
1 0.000007 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ
1 0.000014 syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ
1 0.000001 endif
1 0.000009 syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript
1 0.000006 syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript
1 0.000002 hi def link htmlEventSQ htmlEvent
1 0.000001 hi def link htmlEventDQ htmlEvent
" a javascript expression is used as an arg value
1 0.000007 syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
1 0.000001 endif
1 0.000004 if main_syntax != 'java' || exists("java_vb")
" VB SCRIPT
1 0.003116 0.000485 syn include @htmlVbScript syntax/vb.vim
1 0.000003 unlet b:current_syntax
1 0.000019 syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
1 0.000001 endif
1 0.000004 syn cluster htmlJavaScript add=@htmlPreproc
1 0.000004 if main_syntax != 'java' || exists("java_css")
" embedded style sheets
1 0.000004 syn keyword htmlArg contained media
1 0.013177 0.000422 syn include @htmlCss syntax/css.vim
1 0.000002 unlet b:current_syntax
1 0.000028 syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
1 0.000005 syn match htmlCssStyleComment contained "\(<!--\|-->\)"
1 0.001556 syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
1 0.000006 hi def link htmlStyleArg htmlString
1 0.000001 endif
1 0.000002 if main_syntax == "html"
" synchronizing (does not always work if a comment includes legal
" html tags, but doing it right would mean to always start
" at the first line, which is too slow)
syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
syn sync match htmlHighlight groupthere javaScript "<script"
syn sync match htmlHighlightSkip "^.*['\"].*$"
syn sync minlines=10
endif
" The default highlighting.
1 0.000006 hi def link htmlTag Function
1 0.000006 hi def link htmlEndTag Identifier
1 0.000006 hi def link htmlArg Type
1 0.000006 hi def link htmlTagName htmlStatement
1 0.000006 hi def link htmlSpecialTagName Exception
1 0.000004 hi def link htmlValue String
1 0.000005 hi def link htmlSpecialChar Special
1 0.000004 if !exists("html_no_rendering")
1 0.000005 hi def link htmlH1 Title
1 0.000002 hi def link htmlH2 htmlH1
1 0.000002 hi def link htmlH3 htmlH2
1 0.000002 hi def link htmlH4 htmlH3
1 0.000002 hi def link htmlH5 htmlH4
1 0.000002 hi def link htmlH6 htmlH5
1 0.000004 hi def link htmlHead PreProc
1 0.000005 hi def link htmlTitle Title
1 0.000004 hi def link htmlBoldItalicUnderline htmlBoldUnderlineItalic
1 0.000004 hi def link htmlUnderlineBold htmlBoldUnderline
1 0.000004 hi def link htmlUnderlineItalicBold htmlBoldUnderlineItalic
1 0.000006 hi def link htmlUnderlineBoldItalic htmlBoldUnderlineItalic
1 0.000004 hi def link htmlItalicUnderline htmlUnderlineItalic
1 0.000004 hi def link htmlItalicBold htmlBoldItalic
1 0.000004 hi def link htmlItalicBoldUnderline htmlBoldUnderlineItalic
1 0.000004 hi def link htmlItalicUnderlineBold htmlBoldUnderlineItalic
1 0.000006 hi def link htmlLink Underlined
1 0.000005 hi def link htmlLeadingSpace None
1 0.000002 if !exists("html_my_rendering")
1 0.000004 hi def htmlBold term=bold cterm=bold gui=bold
1 0.000003 hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
1 0.000003 hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
1 0.000003 hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
1 0.000003 hi def htmlUnderline term=underline cterm=underline gui=underline
1 0.000003 hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
1 0.000003 hi def htmlItalic term=italic cterm=italic gui=italic
1 0.000006 if v:version > 800 || v:version == 800 && has("patch1038")
hi def htmlStrike term=strikethrough cterm=strikethrough gui=strikethrough
else
1 0.000005 hi def htmlStrike term=underline cterm=underline gui=underline
1 0.000001 endif
1 0.000001 endif
1 0.000001 endif
1 0.000004 hi def link htmlPreStmt PreProc
1 0.000004 hi def link htmlPreError Error
1 0.000004 hi def link htmlPreProc PreProc
1 0.000004 hi def link htmlPreAttr String
1 0.000004 hi def link htmlPreProcAttrName PreProc
1 0.000004 hi def link htmlPreProcAttrError Error
1 0.000007 hi def link htmlSpecial Special
1 0.000005 hi def link htmlSpecialChar Special
1 0.000004 hi def link htmlString String
1 0.000006 hi def link htmlStatement Statement
1 0.000004 hi def link htmlComment Comment
1 0.000004 hi def link htmlCommentPart Comment
1 0.000004 hi def link htmlValue String
1 0.000002 hi def link htmlCommentError htmlError
1 0.000002 hi def link htmlTagError htmlError
1 0.000002 hi def link htmlEvent javaScript
1 0.000004 hi def link htmlError Error
1 0.000004 hi def link javaScript Special
1 0.000002 hi def link javaScriptExpression javaScript
1 0.000004 hi def link htmlCssStyleComment Comment
1 0.000004 hi def link htmlCssDefinition Special
1 0.000002 let b:current_syntax = "html"
1 0.000002 if main_syntax == 'html'
unlet main_syntax
endif
1 0.000006 let &cpo = s:cpo_save
1 0.000001 unlet s:cpo_save
" vim: ts=8
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/javascript.vim
Sourced 1 time
Total time: 0.001084
Self time: 0.001084
count total (s) self (s)
" Vim syntax file
" Language: JavaScript
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Updaters: Scott Shattuck (ss) <ss@technicalpursuit.com>
" URL: http://www.fleiner.com/vim/syntax/javascript.vim
" Changes: (ss) added keywords, reserved words, and other identifiers
" (ss) repaired several quoting and grouping glitches
" (ss) fixed regex parsing issue with multiple qualifiers [gi]
" (ss) additional factoring of keywords, globals, and members
" Last Change: 2012 Oct 05
" 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke)
" tuning parameters:
" unlet javaScript_fold
1 0.000012 if !exists("main_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let main_syntax = 'javascript'
elseif exists("b:current_syntax") && b:current_syntax == "javascript"
finish
endif
1 0.000008 let s:cpo_save = &cpo
1 0.000009 set cpo&vim
1 0.000020 syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
1 0.000018 syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo
1 0.000012 syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
1 0.000013 syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo
1 0.000027 syn match javaScriptSpecial "\\\d\d\d\|\\."
1 0.000018 syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc
1 0.000013 syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc
1 0.000007 syn match javaScriptSpecialCharacter "'\\.'"
1 0.000013 syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
1 0.000019 syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*$+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
1 0.000008 syn keyword javaScriptConditional if else switch
1 0.000007 syn keyword javaScriptRepeat while for do in
1 0.000006 syn keyword javaScriptBranch break continue
1 0.000005 syn keyword javaScriptOperator new delete instanceof typeof
1 0.000008 syn keyword javaScriptType Array Boolean Date Function Number Object String RegExp
1 0.000006 syn keyword javaScriptStatement return with
1 0.000051 syn keyword javaScriptBoolean true false
1 0.000006 syn keyword javaScriptNull null undefined
1 0.000005 syn keyword javaScriptIdentifier arguments this var let
1 0.000004 syn keyword javaScriptLabel case default
1 0.000011 syn keyword javaScriptException try catch finally throw
1 0.000010 syn keyword javaScriptMessage alert confirm prompt status
1 0.000005 syn keyword javaScriptGlobal self window top parent
1 0.000004 syn keyword javaScriptMember document event location
1 0.000008 syn keyword javaScriptDeprecated escape unescape
1 0.000015 syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile
1 0.000005 if exists("javaScript_fold")
syn match javaScriptFunction "\<function\>"
syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>"
syn sync match javaScriptSync grouphere NONE "^}"
setlocal foldmethod=syntax
setlocal foldtext=getline(v:foldstart)
else
1 0.000006 syn keyword javaScriptFunction function
1 0.000006 syn match javaScriptBraces "[{}\[\]]"
1 0.000005 syn match javaScriptParens "[()]"
1 0.000001 endif
1 0.000002 syn sync fromstart
1 0.000002 syn sync maxlines=100
1 0.000003 if main_syntax == "javascript"
syn sync ccomment javaScriptComment
endif
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
1 0.000005 hi def link javaScriptComment Comment
1 0.000004 hi def link javaScriptLineComment Comment
1 0.000008 hi def link javaScriptCommentTodo Todo
1 0.000004 hi def link javaScriptSpecial Special
1 0.000004 hi def link javaScriptStringS String
1 0.000004 hi def link javaScriptStringD String
1 0.000007 hi def link javaScriptCharacter Character
1 0.000002 hi def link javaScriptSpecialCharacter javaScriptSpecial
1 0.000006 hi def link javaScriptNumber javaScriptValue
1 0.000004 hi def link javaScriptConditional Conditional
1 0.000003 hi def link javaScriptRepeat Repeat
1 0.000004 hi def link javaScriptBranch Conditional
1 0.000005 hi def link javaScriptOperator Operator
1 0.000004 hi def link javaScriptType Type
1 0.000004 hi def link javaScriptStatement Statement
1 0.000005 hi def link javaScriptFunction Function
1 0.000005 hi def link javaScriptBraces Function
1 0.000007 hi def link javaScriptError Error
1 0.000005 hi def link javaScrParenError javaScriptError
1 0.000005 hi def link javaScriptNull Keyword
1 0.000004 hi def link javaScriptBoolean Boolean
1 0.000004 hi def link javaScriptRegexpString String
1 0.000005 hi def link javaScriptIdentifier Identifier
1 0.000004 hi def link javaScriptLabel Label
1 0.000003 hi def link javaScriptException Exception
1 0.000004 hi def link javaScriptMessage Keyword
1 0.000004 hi def link javaScriptGlobal Keyword
1 0.000005 hi def link javaScriptMember Keyword
1 0.000004 hi def link javaScriptDeprecated Exception
1 0.000003 hi def link javaScriptReserved Keyword
1 0.000006 hi def link javaScriptDebug Debug
1 0.000006 hi def link javaScriptConstant Label
1 0.000004 let b:current_syntax = "javascript"
1 0.000002 if main_syntax == 'javascript'
unlet main_syntax
endif
1 0.000008 let &cpo = s:cpo_save
1 0.000002 unlet s:cpo_save
" vim: ts=8
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/vb.vim
Sourced 1 time
Total time: 0.002609
Self time: 0.002609
count total (s) self (s)
" Vim syntax file
" Language: Visual Basic
" Maintainer: Tim Chase <vb.vim@tim.thechases.com>
" Former Maintainer: Robert M. Cortopassi <cortopar@mindspring.com>
" (tried multiple times to contact, but email bounced)
" Last Change:
" 2005 May 25 Synched with work by Thomas Barthel
" 2004 May 30 Added a few keywords
" This was thrown together after seeing numerous requests on the
" VIM and VIM-DEV mailing lists. It is by no means complete.
" Send comments, suggestions and requests to the maintainer.
" quit when a syntax file was already loaded
1 0.000006 if exists("b:current_syntax")
finish
endif
" VB is case insensitive
1 0.000002 syn case ignore
1 0.000013 syn keyword vbConditional If Then ElseIf Else Select Case
1 0.000013 syn keyword vbOperator AddressOf And ByRef ByVal Eqv Imp In
1 0.000004 syn keyword vbOperator Is Like Mod Not Or To Xor
1 0.000009 syn match vbOperator "[()+.,\-/*=&]"
1 0.000004 syn match vbOperator "[<>]=\="
1 0.000003 syn match vbOperator "<>"
1 0.000003 syn match vbOperator "\s\+_$"
1 0.000007 syn keyword vbBoolean True False
1 0.000006 syn keyword vbConst Null Nothing
1 0.000007 syn keyword vbRepeat Do For ForEach Loop Next
1 0.000004 syn keyword vbRepeat Step To Until Wend While
1 0.000006 syn keyword vbEvents AccessKeyPress Activate ActiveRowChanged
1 0.000003 syn keyword vbEvents AfterAddFile AfterChangeFileName AfterCloseFile
1 0.000007 syn keyword vbEvents AfterColEdit AfterColUpdate AfterDelete
1 0.000003 syn keyword vbEvents AfterInsert AfterLabelEdit AfterRemoveFile
1 0.000003 syn keyword vbEvents AfterUpdate AfterWriteFile AmbientChanged
1 0.000003 syn keyword vbEvents ApplyChanges Associate AsyncProgress
1 0.000003 syn keyword vbEvents AsyncReadComplete AsyncReadProgress AxisActivated
1 0.000002 syn keyword vbEvents AxisLabelActivated AxisLabelSelected
1 0.000003 syn keyword vbEvents AxisLabelUpdated AxisSelected AxisTitleActivated
1 0.000003 syn keyword vbEvents AxisTitleSelected AxisTitleUpdated AxisUpdated
1 0.000003 syn keyword vbEvents BeforeClick BeforeColEdit BeforeColUpdate
1 0.000002 syn keyword vbEvents BeforeConnect BeforeDelete BeforeInsert
1 0.000002 syn keyword vbEvents BeforeLabelEdit BeforeLoadFile BeforeUpdate
1 0.000002 syn keyword vbEvents BeginRequest BeginTrans ButtonClick
1 0.000003 syn keyword vbEvents ButtonCompleted ButtonDropDown ButtonGotFocus
1 0.000003 syn keyword vbEvents ButtonLostFocus CallbackKeyDown Change Changed
1 0.000003 syn keyword vbEvents ChartActivated ChartSelected ChartUpdated Click
1 0.000003 syn keyword vbEvents Close CloseQuery CloseUp ColEdit ColResize
1 0.000003 syn keyword vbEvents Collapse ColumnClick CommitTrans Compare
1 0.000003 syn keyword vbEvents ConfigChageCancelled ConfigChanged
1 0.000003 syn keyword vbEvents ConfigChangedCancelled Connect ConnectionRequest
1 0.000005 syn keyword vbEvents CurrentRecordChanged DECommandAdded
1 0.000005 syn keyword vbEvents DECommandPropertyChanged DECommandRemoved
1 0.000003 syn keyword vbEvents DEConnectionAdded DEConnectionPropertyChanged
1 0.000003 syn keyword vbEvents DEConnectionRemoved DataArrival DataChanged
1 0.000003 syn keyword vbEvents DataUpdated DateClicked DblClick Deactivate
1 0.000003 syn keyword vbEvents DevModeChange DeviceArrival DeviceOtherEvent
1 0.000002 syn keyword vbEvents DeviceQueryRemove DeviceQueryRemoveFailed
1 0.000002 syn keyword vbEvents DeviceRemoveComplete DeviceRemovePending
1 0.000003 syn keyword vbEvents Disconnect DisplayChanged Dissociate
1 0.000003 syn keyword vbEvents DoGetNewFileName Done DonePainting DownClick
1 0.000003 syn keyword vbEvents DragDrop DragOver DropDown EditProperty EditQuery
1 0.000003 syn keyword vbEvents EndRequest EnterCell EnterFocus ExitFocus Expand
1 0.000003 syn keyword vbEvents FontChanged FootnoteActivated FootnoteSelected
1 0.000003 syn keyword vbEvents FootnoteUpdated Format FormatSize GotFocus
1 0.000003 syn keyword vbEvents HeadClick HeightChanged Hide InfoMessage
1 0.000002 syn keyword vbEvents IniProperties InitProperties Initialize
1 0.000003 syn keyword vbEvents ItemActivated ItemAdded ItemCheck ItemClick
1 0.000002 syn keyword vbEvents ItemReloaded ItemRemoved ItemRenamed
1 0.000003 syn keyword vbEvents ItemSeletected KeyDown KeyPress KeyUp LeaveCell
1 0.000006 syn keyword vbEvents LegendActivated LegendSelected LegendUpdated
1 0.000003 syn keyword vbEvents LinkClose LinkError LinkExecute LinkNotify
1 0.000003 syn keyword vbEvents LinkOpen Load LostFocus MouseDown MouseMove
1 0.000003 syn keyword vbEvents MouseUp NodeCheck NodeClick OLECompleteDrag
1 0.000003 syn keyword vbEvents OLEDragDrop OLEDragOver OLEGiveFeedback OLESetData
1 0.000003 syn keyword vbEvents OLEStartDrag ObjectEvent ObjectMove OnAddNew
1 0.000003 syn keyword vbEvents OnComm Paint PanelClick PanelDblClick PathChange
1 0.000002 syn keyword vbEvents PatternChange PlotActivated PlotSelected
1 0.000003 syn keyword vbEvents PlotUpdated PointActivated PointLabelActivated
1 0.000003 syn keyword vbEvents PointLabelSelected PointLabelUpdated PointSelected
1 0.000003 syn keyword vbEvents PointUpdated PowerQuerySuspend PowerResume
1 0.000002 syn keyword vbEvents PowerStatusChanged PowerSuspend ProcessTag
1 0.000003 syn keyword vbEvents ProcessingTimeout QueryChangeConfig QueryClose
1 0.000004 syn keyword vbEvents QueryComplete QueryCompleted QueryTimeout
1 0.000003 syn keyword vbEvents QueryUnload ReadProperties RepeatedControlLoaded
1 0.000002 syn keyword vbEvents RepeatedControlUnloaded Reposition
1 0.000003 syn keyword vbEvents RequestChangeFileName RequestWriteFile Resize
1 0.000003 syn keyword vbEvents ResultsChanged RetainedProject RollbackTrans
1 0.000005 syn keyword vbEvents RowColChange RowCurrencyChange RowResize
1 0.000003 syn keyword vbEvents RowStatusChanged Scroll SelChange SelectionChanged
1 0.000003 syn keyword vbEvents SendComplete SendProgress SeriesActivated
1 0.000003 syn keyword vbEvents SeriesSelected SeriesUpdated SettingChanged Show
1 0.000003 syn keyword vbEvents SplitChange Start StateChanged StatusUpdate
1 0.000003 syn keyword vbEvents SysColorsChanged Terminate TimeChanged Timer
1 0.000003 syn keyword vbEvents TitleActivated TitleSelected TitleUpdated
1 0.000002 syn keyword vbEvents UnboundAddData UnboundDeleteRow
1 0.000003 syn keyword vbEvents UnboundGetRelativeBookmark UnboundReadData
1 0.000003 syn keyword vbEvents UnboundWriteData Unformat Unload UpClick Updated
1 0.000002 syn keyword vbEvents UserEvent Validate ValidationError
1 0.000003 syn keyword vbEvents VisibleRecordChanged WillAssociate WillChangeData
1 0.000002 syn keyword vbEvents WillDissociate WillExecute WillUpdateRows
1 0.000002 syn keyword vbEvents WriteProperties
1 0.000008 syn keyword vbFunction Abs Array Asc AscB AscW Atn Avg BOF CBool CByte
1 0.000004 syn keyword vbFunction CCur CDate CDbl CInt CLng CSng CStr CVDate CVErr
1 0.000007 syn keyword vbFunction CVar CallByName Cdec Choose Chr ChrB ChrW Command
1 0.000004 syn keyword vbFunction Cos Count CreateObject CurDir DDB Date DateAdd
1 0.000004 syn keyword vbFunction DateDiff DatePart DateSerial DateValue Day Dir
1 0.000004 syn keyword vbFunction DoEvents EOF Environ Error Exp FV FileAttr
1 0.000003 syn keyword vbFunction FileDateTime FileLen FilterFix Fix Format
1 0.000003 syn keyword vbFunction FormatCurrency FormatDateTime FormatNumber
1 0.000003 syn keyword vbFunction FormatPercent FreeFile GetAllStrings GetAttr
1 0.000003 syn keyword vbFunction GetAutoServerSettings GetObject GetSetting Hex
1 0.000003 syn keyword vbFunction Hour IIf IMEStatus IPmt InStr Input InputB
1 0.000005 syn keyword vbFunction InputBox InstrB Int IsArray IsDate IsEmpty IsError
1 0.000003 syn keyword vbFunction IsMissing IsNull IsNumeric IsObject Join LBound
1 0.000027 syn keyword vbFunction LCase LOF LTrim Left LeftB Len LenB LoadPicture
1 0.000046 syn keyword vbFunction LoadResData LoadResPicture LoadResString Loc Log
1 0.000045 syn keyword vbFunction MIRR Max Mid MidB Min Minute Month MonthName
1 0.000170 syn keyword vbFunction MsgBox NPV NPer Now Oct PPmt PV Partition Pmt
1 0.000067 syn keyword vbFunction QBColor RGB RTrim Rate Replace Right RightB Rnd
1 0.000066 syn keyword vbFunction Round SLN SYD Second Seek Sgn Shell Sin Space Spc
1 0.000047 syn keyword vbFunction Split Sqr StDev StDevP Str StrComp StrConv
1 0.000029 syn keyword vbFunction StrReverse String Sum Switch Tab Tan Time
1 0.000034 syn keyword vbFunction TimeSerial TimeValue Timer Trim TypeName UBound
1 0.000041 syn keyword vbFunction UCase Val Var VarP VarType Weekday WeekdayName
1 0.000009 syn keyword vbFunction Year
1 0.000084 syn keyword vbMethods AboutBox Accept Activate Add AddCustom AddFile
1 0.000023 syn keyword vbMethods AddFromFile AddFromGuid AddFromString
1 0.000029 syn keyword vbMethods AddFromTemplate AddItem AddNew AddToAddInToolbar
1 0.000022 syn keyword vbMethods AddToolboxProgID Append AppendAppendChunk
1 0.000035 syn keyword vbMethods AppendChunk Arrange Assert AsyncRead BatchUpdate
1 0.000022 syn keyword vbMethods BeginQueryEdit BeginTrans Bind BuildPath
1 0.000022 syn keyword vbMethods CanPropertyChange Cancel CancelAsyncRead
1 0.000028 syn keyword vbMethods CancelBatch CancelUpdate CaptureImage CellText
1 0.000029 syn keyword vbMethods CellValue Circle Clear ClearFields ClearSel
1 0.000034 syn keyword vbMethods ClearSelCols ClearStructure Clone Close Cls
1 0.000023 syn keyword vbMethods ColContaining CollapseAll ColumnSize CommitTrans
1 0.000029 syn keyword vbMethods CompactDatabase Compose Connect Copy CopyFile
1 0.000022 syn keyword vbMethods CopyFolder CopyQueryDef Count CreateDatabase
1 0.000022 syn keyword vbMethods CreateDragImage CreateEmbed CreateField
1 0.000028 syn keyword vbMethods CreateFolder CreateGroup CreateIndex CreateLink
1 0.000022 syn keyword vbMethods CreatePreparedStatement CreatePropery CreateQuery
1 0.000022 syn keyword vbMethods CreateQueryDef CreateRelation CreateTableDef
1 0.000022 syn keyword vbMethods CreateTextFile CreateToolWindow CreateUser
1 0.000027 syn keyword vbMethods CreateWorkspace Customize Cut Delete
1 0.000023 syn keyword vbMethods DeleteColumnLabels DeleteColumns DeleteFile
1 0.000026 syn keyword vbMethods DeleteFolder DeleteLines DeleteRowLabels
1 0.000029 syn keyword vbMethods DeleteRows DeselectAll DesignerWindow DoVerb Drag
1 0.000004 syn keyword vbMethods Draw DriveExists Edit EditCopy EditPaste EndDoc
1 0.000003 syn keyword vbMethods EnsureVisible EstablishConnection Execute Exists
1 0.000003 syn keyword vbMethods Expand Export ExportReport ExtractIcon Fetch
1 0.000006 syn keyword vbMethods FetchVerbs FileExists Files FillCache Find
1 0.000003 syn keyword vbMethods FindFirst FindItem FindLast FindNext FindPrevious
1 0.000003 syn keyword vbMethods FolderExists Forward GetAbsolutePathName
1 0.000003 syn keyword vbMethods GetBaseName GetBookmark GetChunk GetClipString
1 0.000003 syn keyword vbMethods GetData GetDrive GetDriveName GetFile GetFileName
1 0.000003 syn keyword vbMethods GetFirstVisible GetFolder GetFormat GetHeader
1 0.000003 syn keyword vbMethods GetLineFromChar GetNumTicks GetParentFolderName
1 0.000002 syn keyword vbMethods GetRows GetSelectedPart GetSelection
1 0.000002 syn keyword vbMethods GetSpecialFolder GetTempName GetText
1 0.000003 syn keyword vbMethods GetVisibleCount GoBack GoForward Hide HitTest
1 0.000003 syn keyword vbMethods HoldFields Idle Import InitializeLabels Insert
1 0.000002 syn keyword vbMethods InsertColumnLabels InsertColumns InsertFile
1 0.000002 syn keyword vbMethods InsertLines InsertObjDlg InsertRowLabels
1 0.000003 syn keyword vbMethods InsertRows Item Keys KillDoc Layout Line Lines
1 0.000003 syn keyword vbMethods LinkExecute LinkPoke LinkRequest LinkSend Listen
1 0.000005 syn keyword vbMethods LoadFile LoadResData LoadResPicture LoadResString
1 0.000003 syn keyword vbMethods LogEvent MakeCompileFile MakeCompiledFile
1 0.000003 syn keyword vbMethods MakeReplica MoreResults Move MoveData MoveFile
1 0.000002 syn keyword vbMethods MoveFirst MoveFolder MoveLast MoveNext
1 0.000003 syn keyword vbMethods MovePrevious NavigateTo NewPage NewPassword
1 0.000003 syn keyword vbMethods NextRecordset OLEDrag OnAddinsUpdate OnConnection
1 0.000003 syn keyword vbMethods OnDisconnection OnStartupComplete Open
1 0.000003 syn keyword vbMethods OpenAsTextStream OpenConnection OpenDatabase
1 0.000003 syn keyword vbMethods OpenQueryDef OpenRecordset OpenResultset OpenURL
1 0.000003 syn keyword vbMethods Overlay PSet PaintPicture PastSpecialDlg Paste
1 0.000005 syn keyword vbMethods PeekData Play Point PopulatePartial PopupMenu
1 0.000003 syn keyword vbMethods Print PrintForm PrintReport PropertyChanged Quit
1 0.000002 syn keyword vbMethods Raise RandomDataFill RandomFillColumns
1 0.000003 syn keyword vbMethods RandomFillRows ReFill Read ReadAll ReadFromFile
1 0.000003 syn keyword vbMethods ReadLine ReadProperty Rebind Refresh RefreshLink
1 0.000003 syn keyword vbMethods RegisterDatabase ReleaseInstance Reload Remove
1 0.000005 syn keyword vbMethods RemoveAddInFromToolbar RemoveAll RemoveItem Render
1 0.000003 syn keyword vbMethods RepairDatabase ReplaceLine Reply ReplyAll Requery
1 0.000002 syn keyword vbMethods ResetCustom ResetCustomLabel ResolveName
1 0.000003 syn keyword vbMethods RestoreToolbar Resync Rollback RollbackTrans
1 0.000003 syn keyword vbMethods RowBookmark RowContaining RowTop Save SaveAs
1 0.000003 syn keyword vbMethods SaveFile SaveToFile SaveToOle1File SaveToolbar
1 0.000003 syn keyword vbMethods Scale ScaleX ScaleY Scroll SelPrint SelectAll
1 0.000003 syn keyword vbMethods SelectPart Send SendData Set SetAutoServerSettings
1 0.000004 syn keyword vbMethods SetData SetFocus SetOption SetSelection SetSize
1 0.000003 syn keyword vbMethods SetText SetViewport Show ShowColor ShowFont
1 0.000003 syn keyword vbMethods ShowHelp ShowOpen ShowPrinter ShowSave
1 0.000003 syn keyword vbMethods ShowWhatsThis SignOff SignOn Size Skip SkipLine
1 0.000003 syn keyword vbMethods Span Split SplitContaining StartLabelEdit
1 0.000005 syn keyword vbMethods StartLogging Stop Synchronize Tag TextHeight
1 0.000003 syn keyword vbMethods TextWidth ToDefaults Trace TwipsToChartPart
1 0.000003 syn keyword vbMethods TypeByChartType URLFor Update UpdateControls
1 0.000003 syn keyword vbMethods UpdateRecord UpdateRow Upto ValidateControls Value
1 0.000003 syn keyword vbMethods WhatsThisMode Write WriteBlankLines WriteLine
1 0.000002 syn keyword vbMethods WriteProperty WriteTemplate ZOrder
1 0.000002 syn keyword vbMethods rdoCreateEnvironment rdoRegisterDataSource
1 0.000007 syn keyword vbStatement Alias AppActivate As Base Beep Begin Call ChDir
1 0.000004 syn keyword vbStatement ChDrive Close Const Date Declare DefBool DefByte
1 0.000003 syn keyword vbStatement DefCur DefDate DefDbl DefDec DefInt DefLng DefObj
1 0.000003 syn keyword vbStatement DefSng DefStr DefVar Deftype DeleteSetting Dim Do
1 0.000004 syn keyword vbStatement Each ElseIf End Enum Erase Error Event Exit
1 0.000008 syn keyword vbStatement Explicit FileCopy For ForEach Function Get GoSub
1 0.000004 syn keyword vbStatement GoTo Gosub Implements Kill LSet Let Lib LineInput
1 0.000004 syn keyword vbStatement Load Lock Loop Mid MkDir Name Next On OnError Open
1 0.000003 syn keyword vbStatement Option Preserve Private Property Public Put RSet
1 0.000003 syn keyword vbStatement RaiseEvent Randomize ReDim Redim Reset Resume
1 0.000003 syn keyword vbStatement Return RmDir SavePicture SaveSetting Seek SendKeys
1 0.000004 syn keyword vbStatement Sendkeys Set SetAttr Static Step Stop Sub Time
1 0.000003 syn keyword vbStatement Type Unload Unlock Until Wend While Width With
1 0.000002 syn keyword vbStatement Write
1 0.000010 syn keyword vbKeyword As Binary ByRef ByVal Date Empty Error Friend Get
1 0.000004 syn keyword vbKeyword Input Is Len Lock Me Mid New Nothing Null On
1 0.000003 syn keyword vbKeyword Option Optional ParamArray Print Private Property
1 0.000003 syn keyword vbKeyword Public PublicNotCreateable OnNewProcessSingleUse
1 0.000003 syn keyword vbKeyword InSameProcessMultiUse GlobalMultiUse Resume Seek
1 0.000003 syn keyword vbKeyword Set Static Step String Time WithEvents
1 0.000005 syn keyword vbTodo contained TODO
"Datatypes
1 0.000006 syn keyword vbTypes Boolean Byte Currency Date Decimal Double Empty
1 0.000003 syn keyword vbTypes Integer Long Object Single String Variant
"VB defined values
1 0.000006 syn keyword vbDefine dbBigInt dbBinary dbBoolean dbByte dbChar
1 0.000003 syn keyword vbDefine dbCurrency dbDate dbDecimal dbDouble dbFloat
1 0.000003 syn keyword vbDefine dbGUID dbInteger dbLong dbLongBinary dbMemo
1 0.000006 syn keyword vbDefine dbNumeric dbSingle dbText dbTime dbTimeStamp
1 0.000002 syn keyword vbDefine dbVarBinary
"VB defined values
1 0.000003 syn keyword vbDefine vb3DDKShadow vb3DFace vb3DHighlight vb3DLight
1 0.000004 syn keyword vbDefine vb3DShadow vbAbort vbAbortRetryIgnore
1 0.000002 syn keyword vbDefine vbActiveBorder vbActiveTitleBar vbAlias
1 0.000002 syn keyword vbDefine vbApplicationModal vbApplicationWorkspace
1 0.000003 syn keyword vbDefine vbAppTaskManager vbAppWindows vbArchive vbArray
1 0.000003 syn keyword vbDefine vbBack vbBinaryCompare vbBlack vbBlue vbBoolean
1 0.000003 syn keyword vbDefine vbButtonFace vbButtonShadow vbButtonText vbByte
1 0.000003 syn keyword vbDefine vbCalGreg vbCalHijri vbCancel vbCr vbCritical
1 0.000003 syn keyword vbDefine vbCrLf vbCurrency vbCyan vbDatabaseCompare
1 0.000003 syn keyword vbDefine vbDataObject vbDate vbDecimal vbDefaultButton1
1 0.000003 syn keyword vbDefine vbDefaultButton2 vbDefaultButton3 vbDefaultButton4
1 0.000003 syn keyword vbDefine vbDesktop vbDirectory vbDouble vbEmpty vbError
1 0.000002 syn keyword vbDefine vbExclamation vbFirstFourDays vbFirstFullWeek
1 0.000002 syn keyword vbDefine vbFirstJan1 vbFormCode vbFormControlMenu
1 0.000003 syn keyword vbDefine vbFormFeed vbFormMDIForm vbFriday vbFromUnicode
1 0.000005 syn keyword vbDefine vbGrayText vbGreen vbHidden vbHide vbHighlight
1 0.000003 syn keyword vbDefine vbHighlightText vbHiragana vbIgnore vbIMEAlphaDbl
1 0.000002 syn keyword vbDefine vbIMEAlphaSng vbIMEDisable vbIMEHiragana
1 0.000003 syn keyword vbDefine vbIMEKatakanaDbl vbIMEKatakanaSng vbIMEModeAlpha
1 0.000002 syn keyword vbDefine vbIMEModeAlphaFull vbIMEModeDisable
1 0.000002 syn keyword vbDefine vbIMEModeHangul vbIMEModeHangulFull
1 0.000002 syn keyword vbDefine vbIMEModeHiragana vbIMEModeKatakana
1 0.000002 syn keyword vbDefine vbIMEModeKatakanaHalf vbIMEModeNoControl
1 0.000003 syn keyword vbDefine vbIMEModeOff vbIMEModeOn vbIMENoOp vbIMEOff
1 0.000002 syn keyword vbDefine vbIMEOn vbInactiveBorder vbInactiveCaptionText
1 0.000002 syn keyword vbDefine vbInactiveTitleBar vbInfoBackground vbInformation
1 0.000003 syn keyword vbDefine vbInfoText vbInteger vbKatakana vbKey0 vbKey1
1 0.000003 syn keyword vbDefine vbKey2 vbKey3 vbKey4 vbKey5 vbKey6 vbKey7 vbKey8
1 0.000003 syn keyword vbDefine vbKey9 vbKeyA vbKeyAdd vbKeyB vbKeyBack vbKeyC
1 0.000003 syn keyword vbDefine vbKeyCancel vbKeyCapital vbKeyClear vbKeyControl
1 0.000003 syn keyword vbDefine vbKeyD vbKeyDecimal vbKeyDelete vbKeyDivide
1 0.000005 syn keyword vbDefine vbKeyDown vbKeyE vbKeyEnd vbKeyEscape vbKeyExecute
1 0.000003 syn keyword vbDefine vbKeyF vbKeyF1 vbKeyF10 vbKeyF11 vbKeyF12 vbKeyF13
1 0.000005 syn keyword vbDefine vbKeyF14 vbKeyF15 vbKeyF16 vbKeyF2 vbKeyF3 vbKeyF4
1 0.000003 syn keyword vbDefine vbKeyF5 vbKeyF6 vbKeyF7 vbKeyF8 vbKeyF9 vbKeyG
1 0.000003 syn keyword vbDefine vbKeyH vbKeyHelp vbKeyHome vbKeyI vbKeyInsert
1 0.000003 syn keyword vbDefine vbKeyJ vbKeyK vbKeyL vbKeyLButton vbKeyLeft vbKeyM
1 0.000003 syn keyword vbDefine vbKeyMButton vbKeyMenu vbKeyMultiply vbKeyN
1 0.000002 syn keyword vbDefine vbKeyNumlock vbKeyNumpad0 vbKeyNumpad1
1 0.000002 syn keyword vbDefine vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4
1 0.000002 syn keyword vbDefine vbKeyNumpad5 vbKeyNumpad6 vbKeyNumpad7
1 0.000002 syn keyword vbDefine vbKeyNumpad8 vbKeyNumpad9 vbKeyO vbKeyP
1 0.000003 syn keyword vbDefine vbKeyPageDown vbKeyPageUp vbKeyPause vbKeyPrint
1 0.000003 syn keyword vbDefine vbKeyQ vbKeyR vbKeyRButton vbKeyReturn vbKeyRight
1 0.000002 syn keyword vbDefine vbKeyS vbKeySelect vbKeySeparator vbKeyShift
1 0.000003 syn keyword vbDefine vbKeySnapshot vbKeySpace vbKeySubtract vbKeyT
1 0.000005 syn keyword vbDefine vbKeyTab vbKeyU vbKeyUp vbKeyV vbKeyW vbKeyX
1 0.000003 syn keyword vbDefine vbKeyY vbKeyZ vbLf vbLong vbLowerCase vbMagenta
1 0.000002 syn keyword vbDefine vbMaximizedFocus vbMenuBar vbMenuText
1 0.000002 syn keyword vbDefine vbMinimizedFocus vbMinimizedNoFocus vbMonday
1 0.000002 syn keyword vbDefine vbMsgBox vbMsgBoxHelpButton vbMsgBoxRight
1 0.000003 syn keyword vbDefine vbMsgBoxRtlReading vbMsgBoxSetForeground
1 0.000003 syn keyword vbDefine vbMsgBoxText vbNarrow vbNewLine vbNo vbNormal
1 0.000003 syn keyword vbDefine vbNormalFocus vbNormalNoFocus vbNull vbNullChar
1 0.000002 syn keyword vbDefine vbNullString vbObject vbObjectError vbOK
1 0.000002 syn keyword vbDefine vbOKCancel vbOKOnly vbProperCase vbQuestion
1 0.000003 syn keyword vbDefine vbReadOnly vbRed vbRetry vbRetryCancel vbSaturday
1 0.000003 syn keyword vbDefine vbScrollBars vbSingle vbString vbSunday vbSystem
1 0.000002 syn keyword vbDefine vbSystemModal vbTab vbTextCompare vbThursday
1 0.000003 syn keyword vbDefine vbTitleBarText vbTuesday vbUnicode vbUpperCase
1 0.000002 syn keyword vbDefine vbUseSystem vbUseSystemDayOfWeek vbVariant
1 0.000005 syn keyword vbDefine vbVerticalTab vbVolume vbWednesday vbWhite vbWide
1 0.000003 syn keyword vbDefine vbWindowBackground vbWindowFrame vbWindowText
1 0.000002 syn keyword vbDefine vbYellow vbYes vbYesNo vbYesNoCancel
"Numbers
"integer number, or floating point number without a dot.
1 0.000009 syn match vbNumber "\<\d\+\>"
"floating point number, with dot
1 0.000004 syn match vbNumber "\<\d\+\.\d*\>"
"floating point number, starting with a dot
1 0.000003 syn match vbNumber "\.\d\+\>"
"syn match vbNumber "{[[:xdigit:]-]\+}\|&[hH][[:xdigit:]]\+&"
"syn match vbNumber ":[[:xdigit:]]\+"
"syn match vbNumber "[-+]\=\<\d\+\>"
1 0.000008 syn match vbFloat "[-+]\=\<\d\+[eE][\-+]\=\d\+"
1 0.000005 syn match vbFloat "[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\="
1 0.000004 syn match vbFloat "[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\="
" String and Character contstants
1 0.000009 syn region vbString start=+"+ end=+"\|$+
1 0.000015 syn region vbComment start="\(^\|\s\)REM\s" end="$" contains=vbTodo
1 0.000007 syn region vbComment start="\(^\|\s\)\'" end="$" contains=vbTodo
1 0.000055 syn match vbLineNumber "^\d\+\(\s\|$\)"
1 0.000009 syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
1 0.000004 syn match vbTypeSpecifier "#[a-zA-Z0-9]"me=e-1
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
1 0.000005 hi def link vbBoolean Boolean
1 0.000003 hi def link vbLineNumber Comment
1 0.000003 hi def link vbComment Comment
1 0.000003 hi def link vbConditional Conditional
1 0.000003 hi def link vbConst Constant
1 0.000003 hi def link vbDefine Constant
1 0.000006 hi def link vbError Error
1 0.000006 hi def link vbFunction Identifier
1 0.000006 hi def link vbIdentifier Identifier
1 0.000003 hi def link vbNumber Number
1 0.000003 hi def link vbFloat Float
1 0.000003 hi def link vbMethods PreProc
1 0.000004 hi def link vbOperator Operator
1 0.000003 hi def link vbRepeat Repeat
1 0.000003 hi def link vbString String
1 0.000003 hi def link vbStatement Statement
1 0.000003 hi def link vbKeyword Statement
1 0.000003 hi def link vbEvents Special
1 0.000003 hi def link vbTodo Todo
1 0.000003 hi def link vbTypes Type
1 0.000004 hi def link vbTypeSpecifier Type
1 0.000004 let b:current_syntax = "vb"
" vim: ts=8
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/css.vim
Sourced 1 time
Total time: 0.012732
Self time: 0.012732
count total (s) self (s)
" Vim syntax file
" Language: Cascading Style Sheets
" Previous Contributor List:
" Claudio Fleiner <claudio@fleiner.com> (Maintainer)
" Yeti (Add full CSS2, HTML4 support)
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2017 Jan 14
" cssClassName updated by Ryuichi Hayashida Jan 2016
" quit when a syntax file was already loaded
1 0.000015 if !exists("main_syntax")
if exists("b:current_syntax")
finish
endif
let main_syntax = 'css'
elseif exists("b:current_syntax") && b:current_syntax == "css"
finish
endif
1 0.000011 let s:cpo_save = &cpo
1 0.000013 set cpo&vim
1 0.000003 syn case ignore
" HTML4 tags
1 0.000027 syn keyword cssTagName abbr address area a b base
1 0.000008 syn keyword cssTagName bdo blockquote body br button
1 0.000007 syn keyword cssTagName caption cite code col colgroup dd del
1 0.000006 syn keyword cssTagName dfn div dl dt em fieldset form
1 0.000014 syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i
1 0.000007 syn keyword cssTagName iframe input ins isindex kbd label legend li
1 0.000006 syn keyword cssTagName link map menu meta noscript ol optgroup
1 0.000019 syn keyword cssTagName option p param pre q s samp script small
1 0.000007 syn keyword cssTagName span strong sub sup tbody td
1 0.000006 syn keyword cssTagName textarea tfoot th thead title tr ul u var
1 0.000004 syn keyword cssTagName object svg
1 0.000019 syn match cssTagName /\<select\>\|\<style\>\|\<table\>/
" 34 HTML5 tags
1 0.000007 syn keyword cssTagName article aside audio bdi canvas command data
1 0.000007 syn keyword cssTagName datalist details dialog embed figcaption figure footer
1 0.000006 syn keyword cssTagName header hgroup keygen main mark menuitem meter nav
1 0.000005 syn keyword cssTagName output progress rt rp ruby section
1 0.000006 syn keyword cssTagName source summary time track video wbr
" Tags not supported in HTML5
" acronym applet basefont big center dir
" font frame frameset noframes strike tt
1 0.000005 syn match cssTagName "\*"
" selectors
1 0.000017 syn match cssSelectorOp "[,>+~]"
1 0.000011 syn match cssSelectorOp2 "[~|^$*]\?=" contained
1 0.000050 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
" .class and #id
1 0.000019 syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
1 0.000005 syn match cssClassNameDot contained '\.'
1 0.000002 try
1 0.000018 syn match cssIdentifier "#[A-Za-z¿-ˇ_@][A-Za-z¿-ˇ0-9_@-]*"
1 0.000002 catch /^.*/
syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
endtry
" digits
1 0.000039 syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
1 0.000016 syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
1 0.000018 syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
1 0.000015 syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
1 0.000014 syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
1 0.000013 syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
1 0.000028 syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
" @media
1 0.000076 syn region cssInclude start=/@media\>/ end=/\ze{/ skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock
1 0.000011 syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl
1 0.000006 syn keyword cssMediaKeyword only not and contained
1 0.002169 syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold
1 0.000005 syn match cssMediaComma "," skipwhite skipnl contained
" Reference: http://www.w3.org/TR/css3-mediaqueries/
1 0.000005 syn keyword cssMediaProp contained width height orientation scan grid
1 0.000007 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
1 0.000005 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
1 0.000015 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
1 0.000009 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
1 0.000004 syn keyword cssMediaAttr contained portrait landscape progressive interlace
" @page
" http://www.w3.org/TR/css3-page/
1 0.000027 syn match cssPage "@page\>[^{]*{\@=" contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap transparent skipwhite skipnl
1 0.000006 syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl
1 0.001323 syn region cssPageWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssPageMargin,cssPageProp,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
1 0.000012 syn match cssPageMargin /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
1 0.000003 syn keyword cssPageProp contained content size
" http://www.w3.org/TR/CSS2/page.html#break-inside
1 0.000003 syn keyword cssPageProp contained orphans widows
" @keyframe
" http://www.w3.org/TR/css3-animations/#keyframes
1 0.000021 syn match cssKeyFrame "@\(-[a-z]\+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent
1 0.000013 syn region cssKeyFrameWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector
1 0.000008 syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl nextgroup=cssDefinition
" @import
1 0.000029 syn region cssInclude start=/@import\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType
1 0.000012 syn region cssInclude start=/@charset\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
1 0.000011 syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
" @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
1 0.000012 syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
1 0.000499 syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssFontDescriptorAttr,cssNoise
1 0.000006 syn match cssFontDescriptorProp contained "\<font-family\>"
1 0.000006 syn keyword cssFontDescriptorProp contained src
1 0.000007 syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>"
1 0.000005 syn match cssFontDescriptorProp contained "\<unicode-range\>"
1 0.000006 syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>"
" src functions
1 0.000012 syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
" font-sytle and font-weight attributes
1 0.000003 syn keyword cssFontDescriptorAttr contained normal italic oblique bold
" font-stretch attributes
1 0.000005 syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" unicode-range attributes
1 0.000004 syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
1 0.000003 syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
" font-feature-settings attributes
1 0.000002 syn keyword cssFontDescriptorAttr contained on off
" The 16 basic color names
1 0.000009 syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
" 130 more color names
1 0.000008 syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
1 0.000006 syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
1 0.000006 syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
1 0.000007 syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/
1 0.000008 syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/
1 0.000006 syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/
1 0.000005 syn match cssColor contained /\<dark\(turquoise\|violet\)\>/
1 0.000006 syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
1 0.000005 syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
1 0.000008 syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
1 0.000005 syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
1 0.000004 syn keyword cssColor contained lemonchiffon limegreen linen magenta
1 0.000007 syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/
1 0.000010 syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/
1 0.000007 syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/
1 0.000007 syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/
1 0.000007 syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/
1 0.000006 syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
1 0.000005 syn keyword cssColor contained oldlace olivedrab orange orangered orchid
1 0.000006 syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
1 0.000005 syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
1 0.000005 syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
1 0.000005 syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
1 0.000005 syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
1 0.000005 syn keyword cssColor contained thistle tomato turquoise violet wheat
1 0.000004 syn keyword cssColor contained whitesmoke yellowgreen
" FIXME: These are actually case-insensitive too, but (a) specs recommend using
" mixed-case (b) it's hard to highlight the word `Background' correctly in
" all situations
1 0.000002 syn case match
1 0.000013 syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background
1 0.000002 syn case ignore
1 0.000006 syn match cssImportant contained "!\s*important\>"
1 0.000005 syn match cssColor contained "\<transparent\>"
1 0.000005 syn match cssColor contained "\<currentColor\>"
1 0.000004 syn match cssColor contained "\<white\>"
1 0.000008 syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators
1 0.000010 syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators
1 0.000011 syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
1 0.000018 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
1 0.000019 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
1 0.000023 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
1 0.000019 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
1 0.000006 syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at
1 0.000002 syn match cssFunctionComma contained ","
" Common Prop and Attr
1 0.000004 syn keyword cssCommonAttr contained auto none inherit all default normal
1 0.000007 syn keyword cssCommonAttr contained top bottom center stretch hidden visible
"------------------------------------------------
" CSS Animations
" http://www.w3.org/TR/css3-animations/
1 0.000010 syn match cssAnimationProp contained "\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>"
" animation-direction attributes
1 0.000006 syn keyword cssAnimationAttr contained alternate reverse
1 0.000004 syn match cssAnimationAttr contained "\<alternate-reverse\>"
" animation-fill-mode attributes
1 0.000003 syn keyword cssAnimationAttr contained forwards backwards both
" animation-play-state attributes
1 0.000002 syn keyword cssAnimationAttr contained running paused
" animation-iteration-count attributes
1 0.000002 syn keyword cssAnimationAttr contained infinite
"------------------------------------------------
" CSS Backgrounds and Borders Module Level 3
" http://www.w3.org/TR/css3-background/
1 0.000011 syn match cssBackgroundProp contained "\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>"
" background-attachment attributes
1 0.000011 syn keyword cssBackgroundAttr contained scroll fixed local
" background-position attributes
1 0.000003 syn keyword cssBackgroundAttr contained left center right top bottom
" background-repeat attributes
1 0.000006 syn match cssBackgroundAttr contained "\<no-repeat\>"
1 0.000007 syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
1 0.000003 syn keyword cssBackgroundAttr contained space round
" background-size attributes
1 0.000002 syn keyword cssBackgroundAttr contained cover contain
1 0.000010 syn match cssBorderProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>"
1 0.000005 syn match cssBorderProp contained "\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>"
1 0.000005 syn match cssBorderProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>"
1 0.000003 syn match cssBorderProp contained "\<box-decoration-break\>"
1 0.000003 syn match cssBorderProp contained "\<box-shadow\>"
" border-image attributes
1 0.000006 syn keyword cssBorderAttr contained stretch round space fill
" border-style attributes
1 0.000004 syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
" border-width attributes
1 0.000002 syn keyword cssBorderAttr contained thin thick medium
" box-decoration-break attributes
1 0.000002 syn keyword cssBorderAttr contained clone slice
"------------------------------------------------
1 0.000007 syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
1 0.000006 syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
1 0.000005 syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>"
1 0.000011 syn match cssBoxProp contained "\<rotation\(-point\)\=\>"
1 0.000007 syn keyword cssBoxAttr contained visible hidden scroll auto
1 0.000004 syn match cssBoxAttr contained "\<no-\(display\|content\)\>"
1 0.000004 syn keyword cssColorProp contained opacity
1 0.000005 syn match cssColorProp contained "\<color-profile\>"
1 0.000005 syn match cssColorProp contained "\<rendering-intent\>"
1 0.000006 syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
1 0.000003 syn keyword cssDimensionProp contained height
1 0.000003 syn keyword cssDimensionProp contained width
" shadow and sizing are in other property groups
1 0.000008 syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
1 0.000006 syn keyword cssFlexibleBoxAttr contained start end baseline
1 0.000002 syn keyword cssFlexibleBoxAttr contained reverse
1 0.000002 syn keyword cssFlexibleBoxAttr contained single multiple
1 0.000002 syn keyword cssFlexibleBoxAttr contained horizontal
1 0.000008 syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
1 0.000004 syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
" CSS Fonts Module Level 3
" http://www.w3.org/TR/css-fonts-3/
1 0.000014 syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
" font attributes
1 0.000009 syn keyword cssFontAttr contained icon menu caption
1 0.000004 syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
1 0.000003 syn match cssFontAttr contained "\<message-box\>"
1 0.000003 syn match cssFontAttr contained "\<status-bar\>"
1 0.000002 syn keyword cssFontAttr contained larger smaller
1 0.000004 syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
" font-family attributes
1 0.000010 syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
1 0.000012 syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
1 0.000003 syn keyword cssFontAttr contained cursive fantasy monospace
" font-feature-settings attributes
1 0.000002 syn keyword cssFontAttr contained on off
" font-stretch attributes
1 0.000005 syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" font-style attributes
1 0.000002 syn keyword cssFontAttr contained italic oblique
" font-synthesis attributes
1 0.000002 syn keyword cssFontAttr contained weight style
" font-weight attributes
1 0.000002 syn keyword cssFontAttr contained bold bolder lighter
" TODO: font-variant-* attributes
"------------------------------------------------
" Webkit specific property/attributes
1 0.000007 syn match cssFontProp contained "\<font-smooth\>"
1 0.000004 syn match cssFontAttr contained "\<\(subpixel-\)\=\antialiased\>"
" CSS Multi-column Layout Module
" http://www.w3.org/TR/css3-multicol/
1 0.000014 syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>"
1 0.000008 syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>"
1 0.000006 syn keyword cssMultiColumnProp contained columns
1 0.000011 syn keyword cssMultiColumnAttr contained balance medium
1 0.000004 syn keyword cssMultiColumnAttr contained always avoid left right page column
1 0.000004 syn match cssMultiColumnAttr contained "\<avoid-\(page\|column\)\>"
" http://www.w3.org/TR/css3-break/#page-break
1 0.000005 syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
" TODO find following items in w3c docs.
1 0.000004 syn keyword cssGeneratedContentProp contained quotes crop
1 0.000006 syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
1 0.000005 syn match cssGeneratedContentProp contained "\<move-to\>"
1 0.000004 syn match cssGeneratedContentProp contained "\<page-policy\>"
1 0.000008 syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
1 0.000012 syn match cssGridProp contained "\<grid-\(columns\|rows\)\>"
1 0.000063 syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
1 0.000007 syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
1 0.000009 syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
1 0.000004 syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
1 0.000005 syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
1 0.000004 syn keyword cssListAttr contained disc circle square hebrew armenian georgian
1 0.000002 syn keyword cssListAttr contained inside outside
1 0.000005 syn keyword cssPositioningProp contained bottom clear clip display float left
1 0.000005 syn keyword cssPositioningProp contained position right top visibility
1 0.000009 syn match cssPositioningProp contained "\<z-index\>"
1 0.000006 syn keyword cssPositioningAttr contained block compact
1 0.000007 syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
1 0.000002 syn keyword cssPositioningAttr contained left right both
1 0.000005 syn match cssPositioningAttr contained "\<list-item\>"
1 0.000004 syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\)\)\=\>"
1 0.000003 syn keyword cssPositioningAttr contained static relative absolute fixed
1 0.000007 syn keyword cssPrintAttr contained landscape portrait crop cross always avoid
1 0.000008 syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
1 0.000007 syn keyword cssTableAttr contained fixed collapse separate show hide once always
1 0.000004 syn keyword cssTextProp contained color direction
1 0.000012 syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
1 0.000009 syn match cssTextProp contained "\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>"
1 0.000009 syn match cssTextProp contained "\<word-\(break\|\wrap\)\>"
1 0.000005 syn match cssTextProp contained "\<white-space\>"
1 0.000005 syn match cssTextProp contained "\<hanging-punctuation\>"
1 0.000005 syn match cssTextProp contained "\<punctuation-trim\>"
1 0.000006 syn match cssTextAttr contained "\<line-through\>"
1 0.000004 syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
1 0.000003 syn keyword cssTextAttr contained ltr rtl embed nowrap
1 0.000003 syn keyword cssTextAttr contained underline overline blink sub super middle
1 0.000006 syn keyword cssTextAttr contained capitalize uppercase lowercase
1 0.000003 syn keyword cssTextAttr contained justify baseline sub super
1 0.000002 syn keyword cssTextAttr contained optimizeLegibility optimizeSpeed
1 0.000003 syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>"
1 0.000003 syn match cssTextAttr contained "\<\(allow\|force\)-end\>"
1 0.000002 syn keyword cssTextAttr contained start end adjacent
1 0.000004 syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>"
1 0.000003 syn keyword cssTextAttr contained distribute kashida first last
1 0.000003 syn keyword cssTextAttr contained clip ellipsis unrestricted suppress
1 0.000005 syn match cssTextAttr contained "\<break-all\>"
1 0.000003 syn match cssTextAttr contained "\<break-word\>"
1 0.000004 syn keyword cssTextAttr contained hyphenate
1 0.000003 syn match cssTextAttr contained "\<bidi-override\>"
1 0.000008 syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>"
1 0.000006 syn match cssTransformProp contained "\<perspective\(-origin\)\=\>"
1 0.000005 syn match cssTransformProp contained "\<backface-visibility\>"
" CSS Transitions
" http://www.w3.org/TR/css3-transitions/
1 0.000007 syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>"
" transition-time-function attributes
1 0.000008 syn match cssTransitionAttr contained "\<linear\(-gradient\)\@!\>"
1 0.000004 syn match cssTransitionAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>"
1 0.000003 syn match cssTransitionAttr contained "\<step\(-start\|-end\)\=\>"
"------------------------------------------------
" CSS Basic User Interface Module Level 3 (CSS3 UI)
" http://www.w3.org/TR/css3-ui/
1 0.000009 syn match cssUIProp contained "\<box-sizing\>"
1 0.000008 syn match cssUIAttr contained "\<\(content\|padding\|border\)\(-box\)\=\>"
1 0.000004 syn keyword cssUIProp contained cursor
1 0.000005 syn match cssUIAttr contained "\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>"
1 0.000004 syn keyword cssUIAttr contained crosshair help move pointer alias copy
1 0.000003 syn keyword cssUIAttr contained progress wait text cell move
1 0.000003 syn match cssUIAttr contained "\<context-menu\>"
1 0.000003 syn match cssUIAttr contained "\<no-drop\>"
1 0.000003 syn match cssUIAttr contained "\<not-allowed\>"
1 0.000007 syn match cssUIAttr contained "\<all-scroll\>"
1 0.000004 syn match cssUIAttr contained "\<\(vertical-\)\=text\>"
1 0.000003 syn match cssUIAttr contained "\<zoom\(-in\|-out\)\=\>"
1 0.000007 syn match cssUIProp contained "\<ime-mode\>"
1 0.000003 syn keyword cssUIAttr contained active inactive disabled
1 0.000006 syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>"
1 0.000010 syn match cssUIProp contained "\<outline\(-\(width\|style\|color\|offset\)\)\=\>"
1 0.000002 syn keyword cssUIAttr contained invert
1 0.000004 syn keyword cssUIProp contained icon resize
1 0.000002 syn keyword cssUIAttr contained both horizontal vertical
1 0.000005 syn match cssUIProp contained "\<text-overflow\>"
1 0.000002 syn keyword cssUIAttr contained clip ellipsis
" Already highlighted Props: font content
"------------------------------------------------
" Webkit/iOS specific attributes
1 0.000003 syn match cssUIAttr contained '\(preserve-3d\)'
" IE specific attributes
1 0.000006 syn match cssIEUIAttr contained '\(bicubic\)'
" Webkit/iOS specific properties
1 0.000007 syn match cssUIProp contained '\(tap-highlight-color\|user-select\|touch-callout\)'
" IE specific properties
1 0.000008 syn match cssIEUIProp contained '\(interpolation-mode\|zoom\|filter\)'
" Webkit/Firebox specific properties/attributes
1 0.000004 syn keyword cssUIProp contained appearance
1 0.000003 syn keyword cssUIAttr contained window button field icon document menu
1 0.000011 syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
1 0.000008 syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>"
1 0.000006 syn keyword cssAuralProp contained volume during azimuth elevation stress richness
1 0.000011 syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>"
1 0.000002 syn keyword cssAuralAttr contained silent
1 0.000003 syn match cssAuralAttr contained "\<spell-out\>"
1 0.000002 syn keyword cssAuralAttr contained non mix
1 0.000003 syn match cssAuralAttr contained "\<\(left\|right\)-side\>"
1 0.000004 syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>"
1 0.000002 syn keyword cssAuralAttr contained leftwards rightwards behind
1 0.000003 syn keyword cssAuralAttr contained below level above lower higher
1 0.000006 syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\|low\|high\)\>"
1 0.000002 syn keyword cssAuralAttr contained faster slower
1 0.000003 syn keyword cssAuralAttr contained male female child code digits continuous
" mobile text
1 0.000007 syn match cssMobileTextProp contained "\<text-size-adjust\>"
1 0.000009 syn match cssBraces contained "[{}]"
1 0.000004 syn match cssError contained "{@<>"
1 0.001223 syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
1 0.000008 syn match cssBraceError "}"
1 0.000007 syn match cssAttrComma ","
" Pseudo class
" http://www.w3.org/TR/css3-selectors/
1 0.000022 syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
1 0.000004 syn keyword cssPseudoClassId contained link visited active hover before after left right
1 0.000004 syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid
1 0.000008 syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
1 0.000005 syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>"
1 0.000011 syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")"
" ------------------------------------
" Vendor specific properties
1 0.000003 syn match cssPseudoClassId contained "\<selection\>"
1 0.000003 syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
1 0.000004 syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
" Misc highlight groups
1 0.000009 syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
1 0.000003 syntax match cssNoise contained /\(:\|;\|\/\)/
" Comment
1 0.000008 syn region cssComment start="/\*" end="\*/" contains=@Spell fold
1 0.000008 syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
1 0.000007 syn match cssSpecialCharQQ +\\\\\|\\"+ contained
1 0.000006 syn match cssSpecialCharQ +\\\\\|\\'+ contained
1 0.000010 syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
1 0.000009 syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
" Vendor Prefix
1 0.000006 syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
" Various CSS Hack characters
" In earlier versions of IE (6 and 7), one can prefix property names
" with a _ or * to isolate those definitions to particular versions of IE
" This is purely decorative and therefore we assign to the same highlight
" group to cssVendor, for more information:
" http://www.paulirish.com/2009/browser-specific-css-hacks/
1 0.000004 syn match cssHacks contained /\(_\|*\)/
" Attr Enhance
" Some keywords are both Prop and Attr, so we have to handle them
1 0.001832 syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
" Hack for transition
" 'transition' has Props after ':'.
1 0.002342 syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
1 0.000007 if main_syntax == "css"
syn sync minlines=10
endif
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
1 0.000006 hi def link cssComment Comment
1 0.000005 hi def link cssVendor Comment
1 0.000004 hi def link cssHacks Comment
1 0.000004 hi def link cssTagName Statement
1 0.000007 hi def link cssDeprecated Error
1 0.000005 hi def link cssSelectorOp Special
1 0.000005 hi def link cssSelectorOp2 Special
1 0.000003 hi def link cssAttrComma Special
1 0.000006 hi def link cssAnimationProp cssProp
1 0.000003 hi def link cssBackgroundProp cssProp
1 0.000001 hi def link cssBorderProp cssProp
1 0.000003 hi def link cssBoxProp cssProp
1 0.000003 hi def link cssColorProp cssProp
1 0.000005 hi def link cssContentForPagedMediaProp cssProp
1 0.000003 hi def link cssDimensionProp cssProp
1 0.000003 hi def link cssFlexibleBoxProp cssProp
1 0.000003 hi def link cssFontProp cssProp
1 0.000003 hi def link cssGeneratedContentProp cssProp
1 0.000001 hi def link cssGridProp cssProp
1 0.000001 hi def link cssHyerlinkProp cssProp
1 0.000004 hi def link cssLineboxProp cssProp
1 0.000003 hi def link cssListProp cssProp
1 0.000004 hi def link cssMarqueeProp cssProp
1 0.000001 hi def link cssMultiColumnProp cssProp
1 0.000007 hi def link cssPagedMediaProp cssProp
1 0.000003 hi def link cssPositioningProp cssProp
1 0.000003 hi def link cssPrintProp cssProp
1 0.000004 hi def link cssRubyProp cssProp
1 0.000004 hi def link cssSpeechProp cssProp
1 0.000003 hi def link cssTableProp cssProp
1 0.000003 hi def link cssTextProp cssProp
1 0.000003 hi def link cssTransformProp cssProp
1 0.000003 hi def link cssTransitionProp cssProp
1 0.000003 hi def link cssUIProp cssProp
1 0.000001 hi def link cssIEUIProp cssProp
1 0.000001 hi def link cssAuralProp cssProp
1 0.000002 hi def link cssRenderProp cssProp
1 0.000001 hi def link cssMobileTextProp cssProp
1 0.000004 hi def link cssAnimationAttr cssAttr
1 0.000001 hi def link cssBackgroundAttr cssAttr
1 0.000001 hi def link cssBorderAttr cssAttr
1 0.000001 hi def link cssBoxAttr cssAttr
1 0.000004 hi def link cssContentForPagedMediaAttr cssAttr
1 0.000004 hi def link cssDimensionAttr cssAttr
1 0.000001 hi def link cssFlexibleBoxAttr cssAttr
1 0.000001 hi def link cssFontAttr cssAttr
1 0.000001 hi def link cssGeneratedContentAttr cssAttr
1 0.000004 hi def link cssGridAttr cssAttr
1 0.000004 hi def link cssHyerlinkAttr cssAttr
1 0.000004 hi def link cssLineboxAttr cssAttr
1 0.000001 hi def link cssListAttr cssAttr
1 0.000004 hi def link cssMarginAttr cssAttr
1 0.000004 hi def link cssMarqueeAttr cssAttr
1 0.000001 hi def link cssMultiColumnAttr cssAttr
1 0.000004 hi def link cssPaddingAttr cssAttr
1 0.000007 hi def link cssPagedMediaAttr cssAttr
1 0.000001 hi def link cssPositioningAttr cssAttr
1 0.000001 hi def link cssGradientAttr cssAttr
1 0.000001 hi def link cssPrintAttr cssAttr
1 0.000004 hi def link cssRubyAttr cssAttr
1 0.000004 hi def link cssSpeechAttr cssAttr
1 0.000001 hi def link cssTableAttr cssAttr
1 0.000001 hi def link cssTextAttr cssAttr
1 0.000004 hi def link cssTransformAttr cssAttr
1 0.000001 hi def link cssTransitionAttr cssAttr
1 0.000001 hi def link cssUIAttr cssAttr
1 0.000001 hi def link cssIEUIAttr cssAttr
1 0.000001 hi def link cssAuralAttr cssAttr
1 0.000004 hi def link cssRenderAttr cssAttr
1 0.000001 hi def link cssCommonAttr cssAttr
1 0.000004 hi def link cssPseudoClassId PreProc
1 0.000007 hi def link cssPseudoClassLang Constant
1 0.000004 hi def link cssValueLength Number
1 0.000004 hi def link cssValueInteger Number
1 0.000004 hi def link cssValueNumber Number
1 0.000004 hi def link cssValueAngle Number
1 0.000004 hi def link cssValueTime Number
1 0.000004 hi def link cssValueFrequency Number
1 0.000004 hi def link cssFunction Constant
1 0.000004 hi def link cssURL String
1 0.000005 hi def link cssFunctionName Function
1 0.000004 hi def link cssFunctionComma Function
1 0.000005 hi def link cssColor Constant
1 0.000005 hi def link cssIdentifier Function
1 0.000004 hi def link cssInclude Include
1 0.000005 hi def link cssIncludeKeyword atKeyword
1 0.000008 hi def link cssImportant Special
1 0.000005 hi def link cssBraces Function
1 0.000004 hi def link cssBraceError Error
1 0.000004 hi def link cssError Error
1 0.000004 hi def link cssUnicodeEscape Special
1 0.000004 hi def link cssStringQQ String
1 0.000004 hi def link cssStringQ String
1 0.000004 hi def link cssAttributeSelector String
1 0.000004 hi def link cssMedia atKeyword
1 0.000004 hi def link cssMediaType Special
1 0.000004 hi def link cssMediaComma Normal
1 0.000004 hi def link cssMediaKeyword Statement
1 0.000001 hi def link cssMediaProp cssProp
1 0.000001 hi def link cssMediaAttr cssAttr
1 0.000001 hi def link cssPage atKeyword
1 0.000004 hi def link cssPagePseudo PreProc
1 0.000001 hi def link cssPageMargin atKeyword
1 0.000001 hi def link cssPageProp cssProp
1 0.000001 hi def link cssKeyFrame atKeyword
1 0.000004 hi def link cssKeyFrameSelector Constant
1 0.000004 hi def link cssFontDescriptor Special
1 0.000004 hi def link cssFontDescriptorFunction Constant
1 0.000003 hi def link cssFontDescriptorProp cssProp
1 0.000001 hi def link cssFontDescriptorAttr cssAttr
1 0.000007 hi def link cssUnicodeRange Constant
1 0.000005 hi def link cssClassName Function
1 0.000004 hi def link cssClassNameDot Function
1 0.000004 hi def link cssProp StorageClass
1 0.000003 hi def link cssAttr Constant
1 0.000004 hi def link cssUnitDecorators Number
1 0.000004 hi def link cssNoise Noise
1 0.000004 hi def link atKeyword PreProc
1 0.000004 let b:current_syntax = "css"
1 0.000002 if main_syntax == 'css'
unlet main_syntax
endif
1 0.000010 let &cpo = s:cpo_save
1 0.000002 unlet s:cpo_save
" vim: ts=8
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/sql.vim
Sourced 1 time
Total time: 0.002070
Self time: 0.000789
count total (s) self (s)
" Vim syntax file loader
" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Thu Sep 15 2005 10:30:02 AM
" Version: 1.0
" Description: Checks for a:
" buffer local variable,
" global variable,
" If the above exist, it will source the type specified.
" If none exist, it will source the default sql.vim file.
"
" quit when a syntax file was already loaded
1 0.000005 if exists("b:current_syntax")
finish
endif
" Default to the standard Vim distribution file
1 0.000007 let filename = 'sqloracle'
" Check for overrides. Buffer variables have the highest priority.
1 0.000002 if exists("b:sql_type_override")
" Check the runtimepath to see if the file exists
if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != ''
let filename = b:sql_type_override
endif
elseif exists("g:sql_type_default")
if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != ''
let filename = g:sql_type_default
endif
endif
" Source the appropriate file
1 0.001660 0.000380 exec 'runtime syntax/'.filename.'.vim'
" vim:sw=4:
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/syntax/sqloracle.vim
Sourced 1 time
Total time: 0.001260
Self time: 0.001260
count total (s) self (s)
" Vim syntax file
" Language: SQL, PL/SQL (Oracle 11g)
" Maintainer: Christian Brabandt
" Repository: https://github.com/chrisbra/vim-sqloracle-syntax
" License: Vim
" Previous Maintainer: Paul Moore
" Last Change: 2016 Jul 22
" Changes:
" 02.04.2016: Support for when keyword
" 03.04.2016: Support for join related keywords
" 22.07.2016: Support Oracle Q-Quote-Syntax
1 0.000014 if exists("b:current_syntax")
finish
endif
1 0.000004 syn case ignore
" The SQL reserved words, defined as keywords.
1 0.000031 syn keyword sqlSpecial false null true
1 0.000020 syn keyword sqlKeyword access add as asc begin by case check cluster column
1 0.000007 syn keyword sqlKeyword cache compress connect current cursor decimal default desc
1 0.000005 syn keyword sqlKeyword else elsif end exception exclusive file for from
1 0.000005 syn keyword sqlKeyword function group having identified if immediate increment
1 0.000005 syn keyword sqlKeyword index initial initrans into is level link logging loop
1 0.000004 syn keyword sqlKeyword maxextents maxtrans mode modify monitoring
1 0.000015 syn keyword sqlKeyword nocache nocompress nologging noparallel nowait of offline on online start
1 0.000006 syn keyword sqlKeyword parallel successful synonym table tablespace then to trigger uid
1 0.000004 syn keyword sqlKeyword unique user validate values view when whenever
1 0.000004 syn keyword sqlKeyword where with option order pctfree pctused privileges procedure
1 0.000004 syn keyword sqlKeyword public resource return row rowlabel rownum rows
1 0.000004 syn keyword sqlKeyword session share size smallint type using
1 0.000008 syn keyword sqlKeyword join cross inner outer left right
1 0.000015 syn keyword sqlOperator not and or
1 0.000005 syn keyword sqlOperator in any some all between exists
1 0.000003 syn keyword sqlOperator like escape
1 0.000003 syn keyword sqlOperator union intersect minus
1 0.000002 syn keyword sqlOperator prior distinct
1 0.000003 syn keyword sqlOperator sysdate out
1 0.000015 syn keyword sqlStatement analyze audit comment commit
1 0.000005 syn keyword sqlStatement delete drop execute explain grant lock noaudit
1 0.000003 syn keyword sqlStatement rename revoke rollback savepoint set
1 0.000002 syn keyword sqlStatement truncate
" next ones are contained, so folding works.
1 0.000003 syn keyword sqlStatement create update alter select insert contained
1 0.000011 syn keyword sqlType boolean char character date float integer long
1 0.000004 syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray
" Strings:
1 0.000111 syn region sqlString matchgroup=Quote start=+"+ skip=+\\\\\|\\"+ end=+"+
1 0.000015 syn region sqlString matchgroup=Quote start=+'+ skip=+\\\\\|\\'+ end=+'+
1 0.000009 syn region sqlString matchgroup=Quote start=+n\?q'\z([^[(<{]\)+ end=+\z1'+
1 0.000005 syn region sqlString matchgroup=Quote start=+n\?q'<+ end=+>'+
1 0.000005 syn region sqlString matchgroup=Quote start=+n\?q'{+ end=+}'+
1 0.000008 syn region sqlString matchgroup=Quote start=+n\?q'(+ end=+)'+
1 0.000005 syn region sqlString matchgroup=Quote start=+n\?q'\[+ end=+]'+
" Numbers:
1 0.000013 syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>"
" Comments:
1 0.000024 syn region sqlComment start="/\*" end="\*/" contains=sqlTodo,@Spell fold
1 0.000007 syn match sqlComment "--.*$" contains=sqlTodo,@Spell
" Setup Folding:
" this is a hack, to get certain statements folded.
" the keywords create/update/alter/select/insert need to
" have contained option.
1 0.000026 syn region sqlFold start='^\s*\zs\c\(Create\|Update\|Alter\|Select\|Insert\)' end=';$\|^$' transparent fold contains=ALL
1 0.000003 syn sync ccomment sqlComment
" Functions:
" (Oracle 11g)
" Aggregate Functions
1 0.000013 syn keyword sqlFunction avg collect corr corr_s corr_k count covar_pop covar_samp cume_dist dense_rank first
1 0.000013 syn keyword sqlFunction group_id grouping grouping_id last max median min percentile_cont percentile_disc percent_rank rank
1 0.000006 syn keyword sqlFunction regr_slope regr_intercept regr_count regr_r2 regr_avgx regr_avgy regr_sxx regr_syy regr_sxy
1 0.000005 syn keyword sqlFunction stats_binomial_test stats_crosstab stats_f_test stats_ks_test stats_mode stats_mw_test
1 0.000004 syn keyword sqlFunction stats_one_way_anova stats_t_test_one stats_t_test_paired stats_t_test_indep stats_t_test_indepu
1 0.000004 syn keyword sqlFunction stats_wsr_test stddev stddev_pop stddev_samp sum
1 0.000004 syn keyword sqlFunction sys_xmlagg var_pop var_samp variance xmlagg
" Char Functions
1 0.000005 syn keyword sqlFunction ascii chr concat initcap instr length lower lpad ltrim
1 0.000004 syn keyword sqlFunction nls_initcap nls_lower nlssort nls_upper regexp_instr regexp_replace
1 0.000005 syn keyword sqlFunction regexp_substr replace rpad rtrim soundex substr translate treat trim upper
" Comparison Functions
1 0.000006 syn keyword sqlFunction greatest least
" Conversion Functions
1 0.000004 syn keyword sqlFunction asciistr bin_to_num cast chartorowid compose convert
1 0.000005 syn keyword sqlFunction decompose hextoraw numtodsinterval numtoyminterval rawtohex rawtonhex rowidtochar
1 0.000004 syn keyword sqlFunction rowidtonchar scn_to_timestamp timestamp_to_scn to_binary_double to_binary_float
1 0.000004 syn keyword sqlFunction to_char to_char to_char to_clob to_date to_dsinterval to_lob to_multi_byte
1 0.000036 syn keyword sqlFunction to_nchar to_nchar to_nchar to_nclob to_number to_dsinterval to_single_byte
1 0.000004 syn keyword sqlFunction to_timestamp to_timestamp_tz to_yminterval to_yminterval translate unistr
" DataMining Functions
1 0.000004 syn keyword sqlFunction cluster_id cluster_probability cluster_set feature_id feature_set
1 0.000003 syn keyword sqlFunction feature_value prediction prediction_bounds prediction_cost
1 0.000003 syn keyword sqlFunction prediction_details prediction_probability prediction_set
" Datetime Functions
1 0.000003 syn keyword sqlFunction add_months current_date current_timestamp dbtimezone extract
1 0.000007 syn keyword sqlFunction from_tz last_day localtimestamp months_between new_time
1 0.000004 syn keyword sqlFunction next_day numtodsinterval numtoyminterval round sessiontimezone
1 0.000003 syn keyword sqlFunction sys_extract_utc sysdate systimestamp to_char to_timestamp
1 0.000003 syn keyword sqlFunction to_timestamp_tz to_dsinterval to_yminterval trunc tz_offset
" Numeric Functions
1 0.000005 syn keyword sqlFunction abs acos asin atan atan2 bitand ceil cos cosh exp
1 0.000004 syn keyword sqlFunction floor ln log mod nanvl power remainder round sign
1 0.000004 syn keyword sqlFunction sin sinh sqrt tan tanh trunc width_bucket
" NLS Functions
1 0.000003 syn keyword sqlFunction ls_charset_decl_len nls_charset_id nls_charset_name
" Various Functions
1 0.000004 syn keyword sqlFunction bfilename cardin coalesce collect decode dump empty_blob empty_clob
1 0.000004 syn keyword sqlFunction lnnvl nullif nvl nvl2 ora_hash powermultiset powermultiset_by_cardinality
1 0.000008 syn keyword sqlFunction sys_connect_by_path sys_context sys_guid sys_typeid uid user userenv vsizeality
" XML Functions
1 0.000004 syn keyword sqlFunction appendchildxml deletexml depth extract existsnode extractvalue insertchildxml
1 0.000004 syn keyword sqlFunction insertxmlbefore path sys_dburigen sys_xmlagg sys_xmlgen updatexml xmlagg xmlcast
1 0.000004 syn keyword sqlFunction xmlcdata xmlcolattval xmlcomment xmlconcat xmldiff xmlelement xmlexists xmlforest
1 0.000004 syn keyword sqlFunction xmlparse xmlpatch xmlpi xmlquery xmlroot xmlsequence xmlserialize xmltable xmltransform
" Todo:
1 0.000004 syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE contained
" Define the default highlighting.
1 0.000009 hi def link Quote Special
1 0.000009 hi def link sqlComment Comment
1 0.000004 hi def link sqlFunction Function
1 0.000001 hi def link sqlKeyword sqlSpecial
1 0.000004 hi def link sqlNumber Number
1 0.000001 hi def link sqlOperator sqlStatement
1 0.000004 hi def link sqlSpecial Special
1 0.000004 hi def link sqlStatement Statement
1 0.000004 hi def link sqlString String
1 0.000004 hi def link sqlType Type
1 0.000004 hi def link sqlTodo Todo
1 0.000005 let b:current_syntax = "sql"
" vim: ts=8
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/tagbar/autoload/tagbar/prototypes/fileinfo.vim
Sourced 1 time
Total time: 0.000402
Self time: 0.000402
count total (s) self (s)
1 0.000010 function! tagbar#prototypes#fileinfo#new(fname, ftype, typeinfo) abort
let newobj = {}
" The complete file path
let newobj.fpath = a:fname
let newobj.bufnr = bufnr(a:fname)
" File modification time
let newobj.mtime = getftime(a:fname)
" The vim file type
let newobj.ftype = a:ftype
" List of the tags that are present in the file, sorted according to the
" value of 'g:tagbar_sort'
let newobj._taglist = []
let newobj._tagdict = {}
" Dictionary of the tags, indexed by line number in the file
let newobj.fline = {}
" Dictionary of the tags, indexed by line number in the tagbar
let newobj.tline = {}
" Dictionary of the folding state of 'kind's, indexed by short name
let newobj.kindfolds = {}
let newobj.typeinfo = a:typeinfo
" copy the default fold state from the type info
for kind in a:typeinfo.kinds
let newobj.kindfolds[kind.short] =
\ g:tagbar_foldlevel == 0 ? 1 : kind.fold
endfor
" Dictionary of dictionaries of the folding state of individual tags,
" indexed by kind and full path
let newobj.tagfolds = {}
for kind in a:typeinfo.kinds
let newobj.tagfolds[kind.short] = {}
endfor
" The current foldlevel of the file
let newobj.foldlevel = g:tagbar_foldlevel
let newobj.addTag = function(s:add_snr('s:addTag'))
let newobj.getTags = function(s:add_snr('s:getTags'))
let newobj.getTagsByName = function(s:add_snr('s:getTagsByName'))
let newobj.removeTag = function(s:add_snr('s:removeTag'))
let newobj.reset = function(s:add_snr('s:reset'))
let newobj.clearOldFolds = function(s:add_snr('s:clearOldFolds'))
let newobj.sortTags = function(s:add_snr('s:sortTags'))
let newobj.openKindFold = function(s:add_snr('s:openKindFold'))
let newobj.closeKindFold = function(s:add_snr('s:closeKindFold'))
return newobj
endfunction
" s:addTag() {{{1
1 0.000003 function! s:addTag(tag) abort dict
call add(self._taglist, a:tag)
if has_key(self._tagdict, a:tag.name)
call add(self._tagdict[a:tag.name], a:tag)
else
let self._tagdict[a:tag.name] = [a:tag]
endif
endfunction
" s:getTags() {{{1
1 0.000002 function! s:getTags() dict abort
return self._taglist
endfunction
" s:getTagsByName() {{{1
1 0.000001 function! s:getTagsByName(tagname) dict abort
return get(self._tagdict, a:tagname, [])
endfunction
" s:removeTag() {{{1
1 0.000001 function! s:removeTag(tag) dict abort
let idx = index(self._taglist, a:tag)
if idx >= 0
call remove(self._taglist, idx)
endif
let namelist = get(self._tagdict, a:tag.name, [])
let idx = index(namelist, a:tag)
if idx >= 0
call remove(namelist, idx)
endif
endfunction
" s:reset() {{{1
" Reset stuff that gets regenerated while processing a file and save the old
" tag folds
1 0.000001 function! s:reset() abort dict
let self.mtime = getftime(self.fpath)
let self._taglist = []
let self._tagdict = {}
let self.fline = {}
let self.tline = {}
let self._tagfolds_old = self.tagfolds
let self.tagfolds = {}
for kind in self.typeinfo.kinds
let self.tagfolds[kind.short] = {}
endfor
endfunction
" s:clearOldFolds() {{{1
1 0.000001 function! s:clearOldFolds() abort dict
if exists('self._tagfolds_old')
unlet self._tagfolds_old
endif
endfunction
" s:sortTags() {{{1
1 0.000001 function! s:sortTags(compare_typeinfo) abort dict
if get(a:compare_typeinfo, 'sort', g:tagbar_sort)
call tagbar#sorting#sort(self._taglist, 'kind', a:compare_typeinfo)
else
call tagbar#sorting#sort(self._taglist, 'line', a:compare_typeinfo)
endif
endfunction
" s:openKindFold() {{{1
1 0.000001 function! s:openKindFold(kind) abort dict
let self.kindfolds[a:kind.short] = 0
endfunction
" s:closeKindFold() {{{1
1 0.000001 function! s:closeKindFold(kind) abort dict
let self.kindfolds[a:kind.short] = 1
endfunction
" s:add_snr() {{{1
1 0.000001 function! s:add_snr(funcname) abort
if !exists("s:snr")
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/tagbar/autoload/tagbar/prototypes/splittag.vim
Sourced 1 time
Total time: 0.000371
Self time: 0.000371
count total (s) self (s)
" A tag that was created because of a tag name that covers multiple scopes
" Inherits the fields of the "main" tag it was split from.
" May be replaced during tag processing if it appears as a normal tag later,
" just like a pseudo tag.
1 0.000006 function! tagbar#prototypes#splittag#new(name) abort
let newobj = tagbar#prototypes#normaltag#new(a:name)
let newobj.isSplitTag = function(s:add_snr('s:isSplitTag'))
return newobj
endfunction
1 0.000003 function! s:isSplitTag() abort dict
return 1
endfunction
1 0.000002 function! s:add_snr(funcname) abort
if !exists("s:snr")
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/tagbar/autoload/tagbar/prototypes/normaltag.vim
Sourced 1 time
Total time: 0.000626
Self time: 0.000626
count total (s) self (s)
1 0.000014 function! tagbar#prototypes#normaltag#new(name) abort
let newobj = tagbar#prototypes#basetag#new(a:name)
let newobj.isNormalTag = function(s:add_snr('s:isNormalTag'))
let newobj.strfmt = function(s:add_snr('s:strfmt'))
let newobj.str = function(s:add_snr('s:str'))
let newobj.getPrototype = function(s:add_snr('s:getPrototype'))
return newobj
endfunction
" s:isNormalTag() {{{1
1 0.000005 function! s:isNormalTag() abort dict
return 1
endfunction
" s:strfmt() {{{1
1 0.000002 function! s:strfmt() abort dict
let typeinfo = self.typeinfo
let suffix = get(self.fields, 'signature', '')
if has_key(self.fields, 'type')
let suffix .= ' : ' . self.fields.type
elseif has_key(get(typeinfo, 'kind2scope', {}), self.fields.kind)
let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
endif
return self._getPrefix() . self.name . suffix
endfunction
" s:str() {{{1
1 0.000002 function! s:str(longsig, full) abort dict
if a:full && self.path != ''
let str = self.path . self.typeinfo.sro . self.name
else
let str = self.name
endif
if has_key(self.fields, 'signature')
if a:longsig
let str .= self.fields.signature
else
let str .= '()'
endif
endif
return str
endfunction
" s:getPrototype() {{{1
1 0.000002 function! s:getPrototype(short) abort dict
if self.prototype != ''
let prototype = self.prototype
else
let bufnr = self.fileinfo.bufnr
if self.fields.line == 0 || !bufloaded(bufnr)
" No linenumber available or buffer not loaded (probably due to
" 'nohidden'), try the pattern instead
return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '')
endif
let line = getbufline(bufnr, self.fields.line)[0]
let list = split(line, '\zs')
let start = index(list, '(')
if start == -1
return substitute(line, '^\s\+', '', '')
endif
let opening = count(list, '(', 0, start)
let closing = count(list, ')', 0, start)
if closing >= opening
return substitute(line, '^\s\+', '', '')
endif
let balance = opening - closing
let prototype = line
let curlinenr = self.fields.line + 1
while balance > 0
let curline = getbufline(bufnr, curlinenr)[0]
let curlist = split(curline, '\zs')
let balance += count(curlist, '(')
let balance -= count(curlist, ')')
let prototype .= "\n" . curline
let curlinenr += 1
endwhile
let self.prototype = prototype
endif
if a:short
" join all lines and remove superfluous spaces
let prototype = substitute(prototype, '^\s\+', '', '')
let prototype = substitute(prototype, '\_s\+', ' ', 'g')
let prototype = substitute(prototype, '(\s\+', '(', 'g')
let prototype = substitute(prototype, '\s\+)', ')', 'g')
" Avoid hit-enter prompts
let maxlen = &columns - 12
if len(prototype) > maxlen
let prototype = prototype[:maxlen - 1 - 3]
let prototype .= '...'
endif
endif
return prototype
endfunction
" s:add_snr() {{{1
1 0.000002 function! s:add_snr(funcname) abort
if !exists("s:snr")
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/tagbar/autoload/tagbar/prototypes/basetag.vim
Sourced 1 time
Total time: 0.000655
Self time: 0.000655
count total (s) self (s)
1 0.000019 let s:visibility_symbols = {
\ 'public' : '+',
\ 'protected' : '#',
\ 'private' : '-'
\ }
1 0.000006 function! tagbar#prototypes#basetag#new(name) abort
let newobj = {}
let newobj.name = a:name
let newobj.fields = {}
let newobj.fields.line = 0
let newobj.fields.column = 0
let newobj.prototype = ''
let newobj.path = ''
let newobj.fullpath = a:name
let newobj.depth = 0
let newobj.parent = {}
let newobj.tline = -1
let newobj.fileinfo = {}
let newobj.typeinfo = {}
let newobj._childlist = []
let newobj._childdict = {}
let newobj.isNormalTag = function(s:add_snr('s:isNormalTag'))
let newobj.isPseudoTag = function(s:add_snr('s:isPseudoTag'))
let newobj.isSplitTag = function(s:add_snr('s:isSplitTag'))
let newobj.isKindheader = function(s:add_snr('s:isKindheader'))
let newobj.getPrototype = function(s:add_snr('s:getPrototype'))
let newobj._getPrefix = function(s:add_snr('s:_getPrefix'))
let newobj.initFoldState = function(s:add_snr('s:initFoldState'))
let newobj.getClosedParentTline = function(s:add_snr('s:getClosedParentTline'))
let newobj.isFoldable = function(s:add_snr('s:isFoldable'))
let newobj.isFolded = function(s:add_snr('s:isFolded'))
let newobj.openFold = function(s:add_snr('s:openFold'))
let newobj.closeFold = function(s:add_snr('s:closeFold'))
let newobj.setFolded = function(s:add_snr('s:setFolded'))
let newobj.openParents = function(s:add_snr('s:openParents'))
let newobj.addChild = function(s:add_snr('s:addChild'))
let newobj.getChildren = function(s:add_snr('s:getChildren'))
let newobj.getChildrenByName = function(s:add_snr('s:getChildrenByName'))
let newobj.removeChild = function(s:add_snr('s:removeChild'))
return newobj
endfunction
" s:isNormalTag() {{{1
1 0.000005 function! s:isNormalTag() abort dict
return 0
endfunction
" s:isPseudoTag() {{{1
1 0.000001 function! s:isPseudoTag() abort dict
return 0
endfunction
" s:isSplitTag {{{1
1 0.000001 function! s:isSplitTag() abort dict
return 0
endfunction
" s:isKindheader() {{{1
1 0.000001 function! s:isKindheader() abort dict
return 0
endfunction
" s:getPrototype() {{{1
1 0.000001 function! s:getPrototype(short) abort dict
return self.prototype
endfunction
" s:_getPrefix() {{{1
1 0.000001 function! s:_getPrefix() abort dict
let fileinfo = self.fileinfo
if !empty(self._childlist)
if fileinfo.tagfolds[self.fields.kind][self.fullpath]
let prefix = g:tagbar#icon_closed
else
let prefix = g:tagbar#icon_open
endif
else
let prefix = ' '
endif
" Visibility is called 'access' in the ctags output
if g:tagbar_show_visibility
if has_key(self.fields, 'access')
let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
elseif has_key(self.fields, 'file')
let prefix .= s:visibility_symbols.private
else
let prefix .= ' '
endif
endif
return prefix
endfunction
" s:initFoldState() {{{1
1 0.000002 function! s:initFoldState(known_files) abort dict
let fileinfo = self.fileinfo
if a:known_files.has(fileinfo.fpath) &&
\ has_key(fileinfo, '_tagfolds_old') &&
\ has_key(fileinfo._tagfolds_old[self.fields.kind], self.fullpath)
" The file has been updated and the tag was there before, so copy its
" old fold state
let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
\ fileinfo._tagfolds_old[self.fields.kind][self.fullpath]
elseif self.depth >= fileinfo.foldlevel
let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
else
let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
\ fileinfo.kindfolds[self.fields.kind]
endif
endfunction
" s:getClosedParentTline() {{{1
1 0.000001 function! s:getClosedParentTline() abort dict
let tagline = self.tline
" Find the first closed parent, starting from the top of the hierarchy.
let parents = []
let curparent = self.parent
while !empty(curparent)
call add(parents, curparent)
let curparent = curparent.parent
endwhile
for parent in reverse(parents)
if parent.isFolded()
let tagline = parent.tline
break
endif
endfor
return tagline
endfunction
" s:isFoldable() {{{1
1 0.000001 function! s:isFoldable() abort dict
return !empty(self._childlist)
endfunction
" s:isFolded() {{{1
1 0.000001 function! s:isFolded() abort dict
return self.fileinfo.tagfolds[self.fields.kind][self.fullpath]
endfunction
" s:openFold() {{{1
1 0.000001 function! s:openFold() abort dict
if self.isFoldable()
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 0
endif
endfunction
" s:closeFold() {{{1
1 0.000001 function! s:closeFold() abort dict
let newline = line('.')
if !empty(self.parent) && self.parent.isKindheader()
" Tag is child of generic 'kind'
call self.parent.closeFold()
let newline = self.parent.tline
elseif self.isFoldable() && !self.isFolded()
" Tag is parent of a scope and is not folded
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
let newline = self.tline
elseif !empty(self.parent)
" Tag is normal child, so close parent
let parent = self.parent
let self.fileinfo.tagfolds[parent.fields.kind][parent.fullpath] = 1
let newline = parent.tline
endif
return newline
endfunction
" s:setFolded() {{{1
1 0.000002 function! s:setFolded(folded) abort dict
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = a:folded
endfunction
" s:openParents() {{{1
1 0.000001 function! s:openParents() abort dict
let parent = self.parent
while !empty(parent)
call parent.openFold()
let parent = parent.parent
endwhile
endfunction
" s:addChild() {{{1
1 0.000001 function! s:addChild(tag) abort dict
call add(self._childlist, a:tag)
if has_key(self._childdict, a:tag.name)
call add(self._childdict[a:tag.name], a:tag)
else
let self._childdict[a:tag.name] = [a:tag]
endif
endfunction
" s:getChildren() {{{1
1 0.000001 function! s:getChildren() dict abort
return self._childlist
endfunction
" s:getChildrenByName() {{{1
1 0.000001 function! s:getChildrenByName(tagname) dict abort
return get(self._childdict, a:tagname, [])
endfunction
" s:removeChild() {{{1
1 0.000001 function! s:removeChild(tag) dict abort
let idx = index(self._childlist, a:tag)
if idx >= 0
call remove(self._childlist, idx)
endif
let namelist = get(self._childdict, a:tag.name, [])
let idx = index(namelist, a:tag)
if idx >= 0
call remove(namelist, idx)
endif
endfunction
" s:add_snr() {{{1
1 0.000001 function! s:add_snr(funcname) abort
if !exists("s:snr")
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/tagbar/autoload/tagbar/sorting.vim
Sourced 1 time
Total time: 0.001682
Self time: 0.001682
count total (s) self (s)
" Script-local variable needed since compare functions can't
" take additional arguments
1 0.000009 let s:compare_typeinfo = {}
1 0.000006 function! tagbar#sorting#sort(tags, compareby, compare_typeinfo) abort
let s:compare_typeinfo = a:compare_typeinfo
let comparemethod =
\ a:compareby == 'kind' ? 's:compare_by_kind' : 's:compare_by_line'
call sort(a:tags, comparemethod)
for tag in a:tags
if !empty(tag.getChildren())
call tagbar#sorting#sort(tag.getChildren(), a:compareby,
\ a:compare_typeinfo)
endif
endfor
endfunction
1 0.000006 function! s:compare_by_kind(tag1, tag2) abort
let typeinfo = s:compare_typeinfo
if typeinfo.kinddict[a:tag1.fields.kind] <#
\ typeinfo.kinddict[a:tag2.fields.kind]
return -1
elseif typeinfo.kinddict[a:tag1.fields.kind] >#
\ typeinfo.kinddict[a:tag2.fields.kind]
return 1
else
" Ignore '~' prefix for C++ destructors to sort them directly under
" the constructors
if a:tag1.name[0] ==# '~'
let name1 = a:tag1.name[1:]
else
let name1 = a:tag1.name
endif
if a:tag2.name[0] ==# '~'
let name2 = a:tag2.name[1:]
else
let name2 = a:tag2.name
endif
let ci = g:tagbar_case_insensitive
if (((!ci) && (name1 <=# name2)) || (ci && (name1 <=? name2)))
return -1
else
return 1
endif
endif
endfunction
1 0.000002 function! s:compare_by_line(tag1, tag2) abort
return a:tag1.fields.line - a:tag2.fields.line
endfunction
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/vim-signify/autoload/sy/util.vim
Sourced 1 time
Total time: 0.000664
Self time: 0.000664
count total (s) self (s)
" vim: et sw=2 sts=2
1 0.000007 scriptencoding utf-8
" Function: #escape {{{1
1 0.000007 function! sy#util#escape(path) abort
if exists('+shellslash')
let old_ssl = &shellslash
if fnamemodify(&shell, ':t') == 'cmd.exe'
set noshellslash
else
set shellslash
endif
endif
let path = shellescape(a:path)
if exists('old_ssl')
let &shellslash = old_ssl
endif
return path
endfunction
" Function: #refresh_windows {{{1
1 0.000007 function! sy#util#refresh_windows() abort
if exists('*win_getid')
let winid = win_getid()
else
let winnr = winnr()
endif
if !get(g:, 'signify_cmdwin_active')
windo if exists('b:sy') | call sy#start() | endif
endif
if exists('winid')
call win_gotoid(winid)
else
execute winnr .'wincmd w'
endif
endfunction
" Function: #hunk_text_object {{{1
1 0.000005 function! sy#util#hunk_text_object(emptylines) abort
execute sy#util#return_if_no_changes()
let lnum = line('.')
let hunks = filter(copy(b:sy.hunks), 'v:val.start <= lnum && v:val.end >= lnum')
if empty(hunks)
echomsg 'signify: Here is no hunk.'
return
endif
execute hunks[0].start
normal! V
if a:emptylines
let lnum = hunks[0].end
while getline(lnum+1) =~ '^$'
let lnum += 1
endwhile
execute lnum
else
execute hunks[0].end
endif
endfunction
" Function: #shell_redirect {{{1
1 0.000003 function! sy#util#shell_redirect(path) abort
" if shellredir contains a %s it is replaced with the path
" otherwise, just append it (from :help shellredir:
" The name of the temporary file can be represented by '%s' if necessary
" (the file name is appended automatically if no %s appears in the value
" of this option)
if &shellredir =~# '%s'
return substitute(&shellredir, '\C%s', a:path, 'g')
else
return &shellredir .' '. a:path
endif
endfunction
" Function: #chdir {{{1
1 0.000003 function! sy#util#chdir() abort
let chdir = haslocaldir()
\ ? 'lcd'
\ : (exists(':tcd') && haslocaldir(-1, 0)) ? 'tcd' : 'cd'
return [getcwd(), chdir]
endfunction
" Function: #has_changes {{{1
1 0.000003 function! sy#util#return_if_no_changes() abort
if !exists('b:sy') || empty(b:sy.hunks)
echomsg 'signify: There are no changes.'
return 'return'
endif
return ''
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/vim-signify/autoload/sy/repo.vim
Sourced 1 time
Total time: 0.001575
Self time: 0.001536
count total (s) self (s)
" vim: et sw=2 sts=2
1 0.000012 scriptencoding utf-8
" Function: #detect {{{1
1 0.000007 function! sy#repo#detect() abort
for vcs in s:vcs_list
let b:sy.detecting += 1
call sy#repo#get_diff_start(vcs)
endfor
endfunction
" Function: s:callback_nvim_stdout{{{1
1 0.000006 function! s:callback_nvim_stdout(_job_id, data, _event) dict abort
if empty(self.stdoutbuf) || empty(self.stdoutbuf[-1])
let self.stdoutbuf += a:data
else
let self.stdoutbuf = self.stdoutbuf[:-2]
\ + [self.stdoutbuf[-1] . get(a:data, 0, '')]
\ + a:data[1:]
endif
endfunction
" Function: s:callback_nvim_exit {{{1
1 0.000002 function! s:callback_nvim_exit(_job_id, exitval, _event) dict abort
call s:job_exit(self.bufnr, self.vcs, a:exitval, self.stdoutbuf)
endfunction
" Function: s:callback_vim_stdout {{{1
1 0.000002 function! s:callback_vim_stdout(_job_id, data) dict abort
let self.stdoutbuf += [a:data]
endfunction
" Function: s:callback_vim_close {{{1
1 0.000004 function! s:callback_vim_close(channel) dict abort
let job = ch_getjob(a:channel)
while 1
if job_status(job) == 'dead'
let exitval = job_info(job).exitval
break
endif
sleep 10m
endwhile
call s:job_exit(self.bufnr, self.vcs, exitval, self.stdoutbuf)
endfunction
" Function: s:job_exit {{{1
1 0.000002 function! s:job_exit(bufnr, vcs, exitval, diff) abort
call sy#verbose('job_exit()', a:vcs)
let sy = getbufvar(a:bufnr, 'sy')
if empty(sy)
call sy#verbose(printf('No b:sy found for %s', bufname(a:bufnr)), a:vcs)
return
elseif !empty(sy.updated_by) && sy.updated_by != a:vcs
call sy#verbose(printf('Signs already got updated by %s.', sy.updated_by), a:vcs)
return
elseif empty(sy.vcs) && sy.active
let sy.detecting -= 1
endif
call sy#repo#get_diff_{a:vcs}(sy, a:exitval, a:diff)
call setbufvar(a:bufnr, 'sy_job_id_'.a:vcs, 0)
endfunction
" Function: sy#get_diff_start {{{1
1 0.000002 function! sy#repo#get_diff_start(vcs) abort
call sy#verbose('get_diff_start()', a:vcs)
let job_id = get(b:, 'sy_job_id_'.a:vcs)
" Neovim
if has('nvim')
if job_id
silent! call jobstop(job_id)
endif
let [cmd, options] = s:initialize_job(a:vcs)
call sy#verbose(printf('CMD: %s | CWD: %s', string(cmd), b:sy.info.dir), a:vcs)
let b:sy_job_id_{a:vcs} = jobstart(cmd, extend(options, {
\ 'cwd': b:sy.info.dir,
\ 'on_stdout': function('s:callback_nvim_stdout'),
\ 'on_exit': function('s:callback_nvim_exit'),
\ }))
" Newer Vim
elseif has('patch-7.4.1967')
if type(job_id) != type(0)
silent! call job_stop(job_id)
endif
let [cmd, options] = s:initialize_job(a:vcs)
let [cwd, chdir] = sy#util#chdir()
try
execute chdir fnameescape(b:sy.info.dir)
call sy#verbose(printf('CMD: %s | CWD: %s', string(cmd), getcwd()), a:vcs)
let opts = {
\ 'in_io': 'null',
\ 'out_cb': function('s:callback_vim_stdout', options),
\ 'close_cb': function('s:callback_vim_close', options),
\ }
let b:sy_job_id_{a:vcs} = job_start(cmd, opts)
finally
execute chdir fnameescape(cwd)
endtry
" Older Vim
else
let diff = split(s:run(a:vcs), '\n')
call sy#repo#get_diff_{a:vcs}(b:sy, v:shell_error, diff)
endif
endfunction
" Function: s:get_diff_end {{{1
1 0.000002 function! s:get_diff_end(sy, found_diff, vcs, diff) abort
call sy#verbose('get_diff_end()', a:vcs)
if a:found_diff
if index(a:sy.vcs, a:vcs) == -1
let a:sy.vcs += [a:vcs]
endif
call sy#set_signs(a:sy, a:vcs, a:diff)
else
call sy#verbose('No valid diff found. Disabling this VCS.', a:vcs)
endif
endfunction
" Function: #get_diff_git {{{1
1 0.000002 function! sy#repo#get_diff_git(sy, exitval, diff) abort
call sy#verbose('get_diff_git()', 'git')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'git', diff)
endfunction
" Function: #get_diff_hg {{{1
1 0.000002 function! sy#repo#get_diff_hg(sy, exitval, diff) abort
call sy#verbose('get_diff_hg()', 'hg')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'hg', diff)
endfunction
" Function: #get_diff_svn {{{1
1 0.000002 function! sy#repo#get_diff_svn(sy, exitval, diff) abort
call sy#verbose('get_diff_svn()', 'svn')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'svn', diff)
endfunction
" Function: #get_diff_bzr {{{1
1 0.000002 function! sy#repo#get_diff_bzr(sy, exitval, diff) abort
call sy#verbose('get_diff_bzr()', 'bzr')
let [found_diff, diff] = (a:exitval =~ '[012]') ? [1, a:diff] : [0, []]
call s:get_diff_end(a:sy, found_diff, 'bzr', diff)
endfunction
" Function: #get_diff_darcs {{{1
1 0.000002 function! sy#repo#get_diff_darcs(sy, exitval, diff) abort
call sy#verbose('get_diff_darcs()', 'darcs')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'darcs', diff)
endfunction
" Function: #get_diff_fossil {{{1
1 0.000002 function! sy#repo#get_diff_fossil(sy, exitval, diff) abort
call sy#verbose('get_diff_fossil()', 'fossil')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'fossil', diff)
endfunction
" Function: #get_diff_cvs {{{1
1 0.000002 function! sy#repo#get_diff_cvs(sy, exitval, diff) abort
call sy#verbose('get_diff_cvs()', 'cvs')
let [found_diff, diff] = [0, []]
if a:exitval == 1
for diffline in a:diff
if diffline =~ '^+++'
let [found_diff, diff] = [1, a:diff]
break
endif
endfor
endif
call s:get_diff_end(a:sy, found_diff, 'cvs', diff)
endfunction
" Function: #get_diff_rcs {{{1
1 0.000002 function! sy#repo#get_diff_rcs(sy, exitval, diff) abort
call sy#verbose('get_diff_rcs()', 'rcs')
let [found_diff, diff] = a:exitval == 2 ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'rcs', diff)
endfunction
" Function: #get_diff_accurev {{{1
1 0.000002 function! sy#repo#get_diff_accurev(sy, exitval, diff) abort
call sy#verbose('get_diff_accurev()', 'accurev')
let [found_diff, diff] = (a:exitval >= 2) ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'accurev', diff)
endfunction
" Function: #get_diff_perforce {{{1
1 0.000002 function! sy#repo#get_diff_perforce(sy, exitval, diff) abort
call sy#verbose('get_diff_perforce()', 'perforce')
let [found_diff, diff] = a:exitval ? [0, []] : [1, a:diff]
call s:get_diff_end(a:sy, found_diff, 'perforce', diff)
endfunction
" Function: #get_diff_tfs {{{1
1 0.000002 function! sy#repo#get_diff_tfs(sy, exitval, diff) abort
call sy#verbose('get_diff_tfs()', 'tfs')
let [found_diff, diff] = a:exitval ? [0, []] : [1, s:strip_context(a:diff)]
call s:get_diff_end(a:sy, found_diff, 'tfs', diff)
endfunction
" Function: #get_stats {{{1
1 0.000002 function! sy#repo#get_stats() abort
return exists('b:sy') ? b:sy.stats : [-1, -1, -1]
endfunction
" Function: #debug_detection {{{1
1 0.000002 function! sy#repo#debug_detection()
if !exists('b:sy')
echomsg 'signify: I cannot detect any changes!'
return
endif
for vcs in s:vcs_list
let cmd = s:expand_cmd(vcs, g:signify_vcs_cmds)
echohl Statement
echo cmd
echo repeat('=', len(cmd))
echohl NONE
let diff = s:run(vcs)
if v:shell_error
echohl ErrorMsg
echo diff
echohl NONE
else
echo empty(diff) ? "<none>" : diff
endif
echo "\n"
endfor
endfunction
" Function: #diffmode {{{1
1 0.000002 function! sy#repo#diffmode() abort
execute sy#util#return_if_no_changes()
let vcs = b:sy.updated_by
if !has_key(g:signify_vcs_cmds_diffmode, vcs)
echomsg 'SignifyDiff has no support for: '. vcs
echomsg 'Open an issue for it at: https://github.com/mhinz/vim-signify/issues'
return
endif
let cmd = s:expand_cmd(vcs, g:signify_vcs_cmds_diffmode)
call sy#verbose('SignifyDiff: '. cmd, vcs)
let ft = &filetype
tabedit %
diffthis
let [cwd, chdir] = sy#util#chdir()
try
execute chdir fnameescape(b:sy.info.dir)
leftabove vnew
silent put =system(cmd)
finally
execute chdir fnameescape(cwd)
endtry
silent 1delete
diffthis
set buftype=nofile bufhidden=wipe nomodified
let &filetype = ft
wincmd p
normal! ]czt
endfunction
" Function: s:initialize_job {{{1
1 0.000002 function! s:initialize_job(vcs) abort
let vcs_cmd = s:expand_cmd(a:vcs, g:signify_vcs_cmds)
if has('win32')
if has('nvim')
let cmd = &shell =~ 'cmd' ? vcs_cmd : ['sh', '-c', vcs_cmd]
else
let cmd = join([&shell, &shellcmdflag, vcs_cmd])
endif
else
let cmd = ['sh', '-c', vcs_cmd]
endif
let options = {
\ 'stdoutbuf': [],
\ 'vcs': a:vcs,
\ 'bufnr': bufnr('%'),
\ }
return [cmd, options]
endfunction
" Function: s:get_vcs_path {{{1
1 0.000002 function! s:get_vcs_path(vcs) abort
return (a:vcs =~# '\v(git|cvs|accurev|tfs)') ? b:sy.info.file : b:sy.info.path
endfunction
" Function: s:expand_cmd {{{1
1 0.000002 function! s:expand_cmd(vcs, vcs_cmds) abort
let cmd = a:vcs_cmds[a:vcs]
let cmd = s:replace(cmd, '%f', s:get_vcs_path(a:vcs))
let cmd = s:replace(cmd, '%d', s:difftool)
let cmd = s:replace(cmd, '%n', s:devnull)
return cmd
endfunction
" Function: s:run {{{1
1 0.000001 function! s:run(vcs)
let [cwd, chdir] = sy#util#chdir()
try
execute chdir fnameescape(b:sy.info.dir)
let ret = system(s:expand_cmd(a:vcs, g:signify_vcs_cmds))
catch
" This exception message can be seen via :SignifyDebugUnknown.
" E.g. unquoted VCS programs in vcd_cmds can lead to E484.
let ret = v:exception .' at '. v:throwpoint
finally
execute chdir fnameescape(cwd)
return ret
endtry
endfunction
" Function: s:replace {{{1
1 0.000002 function! s:replace(cmd, pat, sub)
let parts = split(a:cmd, a:pat, 1)
return join(parts, a:sub)
endfunction
" Function: s:strip_context {{{1
1 0.000001 function! s:strip_context(context)
let diff = []
let hunk = []
let state = 0
let lines = a:context
let linenr = 0
while linenr < len(lines)
let line = lines[linenr]
if state == 0
if line =~ "^@@ "
let tokens = matchlist(line, '^@@ -\v(\d+),?(\d*) \+(\d+),?(\d*)')
let old_line = str2nr(tokens[1])
let new_line = str2nr(tokens[3])
let old_count = empty(tokens[2]) ? 1 : str2nr(tokens[2])
let new_count = empty(tokens[4]) ? 1 : str2nr(tokens[4])
let hunk = []
let state = 1
else
call add(diff,line)
endif
let linenr += 1
elseif index([1,2,3],state) >= 0 && index(['\','/'],line[0]) >= 0
let linenr += 1
call add(hunk,line)
elseif state == 1
if line[0] == ' '
let old_line += 1
let new_line += 1
let old_count -= 1
let new_count -= 1
let linenr += 1
else
let old_count_part = 0
let new_count_part = 0
let state = 2
endif
elseif state == 2
if line[0] == '-'
call add(hunk,line)
let old_count_part += 1
let linenr += 1
else
let state = 3
endif
elseif state == 3
if line[0] == '+'
call add(hunk,line)
let new_count_part += 1
let linenr += 1
else
call add(diff, printf("@@ -%d%s +%d%s @@",(old_count_part == 0 && old_line > 0) ? old_line -1 : old_line, old_count_part == 1 ? "" : printf(",%d", old_count_part), (new_count_part == 0 && new_line > 0) ? new_line - 1 : new_line, new_count_part == 1 ? "" : printf(",%d", new_count_part)))
let diff += hunk
let hunk = []
let old_count -= old_count_part
let new_count -= new_count_part
let old_line += old_count_part
let new_line += new_count_part
let state = 1
endif
endif
if state > 0 && new_count <= 0 && old_count <= 0
if len(hunk) > 0
call add(diff, printf("@@ -%d%s +%d%s @@",(old_count_part == 0 && old_line > 0) ? old_line -1 : old_line, old_count_part == 1 ? "" : printf(",%d", old_count_part), (new_count_part == 0 && new_line > 0) ? new_line - 1 : new_line, new_count_part == 1 ? "" : printf(",%d", new_count_part)))
let diff = diff + hunk
let hunk = []
endif
let state = 0
endif
endwhile
if len(hunk) > 0
call add(diff, printf("@@ -%d%s +%d%s @@",(old_count_part == 0 && old_line > 0) ? old_line -1 : old_line, old_count_part == 1 ? "" : printf(",%d", old_count_part), (new_count_part == 0 && new_line > 0) ? new_line - 1 : new_line, new_count_part == 1 ? "" : printf(",%d", new_count_part)))
let diff = diff + hunk
let hunk = []
endif
return diff
endfunction
" Variables {{{1
1 0.000009 let s:difftool = get(g:, 'signify_difftool', 'diff')
1 0.000604 if executable(s:difftool)
1 0.000030 let s:vcs_dict = {
\ 'git': 'git',
\ 'hg': 'hg',
\ 'svn': 'svn',
\ 'darcs': 'darcs',
\ 'bzr': 'bzr',
\ 'fossil': 'fossil',
\ 'cvs': 'cvs',
\ 'rcs': 'rcsdiff',
\ 'accurev': 'accurev',
\ 'perforce': 'p4',
\ 'tfs': 'tf'
\ }
1 0.000002 else
call sy#verbose('No "diff" executable found. Disable support for svn, darcs, bzr, fossil.')
let s:vcs_dict = {
\ 'git': 'git',
\ 'hg': 'hg',
\ 'cvs': 'cvs',
\ 'rcs': 'rcsdiff',
\ 'accurev': 'accurev',
\ 'perforce': 'p4',
\ 'tfs': 'tf'
\ }
endif
1 0.000013 let s:vcs_list = get(g:, 'signify_vcs_list', [])
1 0.000003 if empty(s:vcs_list)
let s:vcs_list = keys(filter(s:vcs_dict, 'executable(v:val)'))
endif
1 0.000059 0.000039 let s:default_vcs_cmds = {
\ 'git': 'git diff --no-color --no-ext-diff -U0 -- %f',
\ 'hg': 'hg diff --config extensions.color=! --config defaults.diff= --nodates -U0 -- %f',
\ 'svn': 'svn diff --diff-cmd %d -x -U0 -- %f',
\ 'bzr': 'bzr diff --using %d --diff-options=-U0 -- %f',
\ 'darcs': 'darcs diff --no-pause-for-gui --no-unified --diff-opts=-U0 -- %f',
\ 'fossil': 'fossil set diff-command "%d -U 0" && fossil diff --unified -c 0 -- %f',
\ 'cvs': 'cvs diff -U0 -- %f',
\ 'rcs': 'rcsdiff -U0 %f 2>%n',
\ 'accurev': 'accurev diff %f -- -U0',
\ 'perforce': 'p4 info '. sy#util#shell_redirect('%n') . (has('win32') ? ' &&' : ' && env P4DIFF= P4COLORS=') .' p4 diff -du0 %f',
\ 'tfs': 'tf diff -version:W -noprompt -format:Unified %f'
\ }
1 0.000012 let s:default_vcs_cmds_diffmode = {
\ 'git': 'git show HEAD:./%f',
\ 'hg': 'hg cat %f',
\ 'svn': 'svn cat %f',
\ 'bzr': 'bzr cat %f',
\ 'darcs': 'darcs show contents -- %f',
\ 'cvs': 'cvs up -p -- %f 2>%n',
\ 'perforce': 'p4 print %f',
\ }
1 0.000003 if exists('g:signify_vcs_cmds')
call extend(g:signify_vcs_cmds, s:default_vcs_cmds, 'keep')
else
1 0.000006 let g:signify_vcs_cmds = s:default_vcs_cmds
1 0.000001 endif
1 0.000003 if exists('g:signify_vcs_cmds_diffmode')
call extend(g:signify_vcs_cmds_diffmode, s:default_vcs_cmds_diffmode, 'keep')
else
1 0.000002 let g:signify_vcs_cmds_diffmode = s:default_vcs_cmds_diffmode
1 0.000001 endif
1 0.000026 0.000006 let s:difftool = sy#util#escape(s:difftool)
1 0.000013 let s:devnull = has('win32') || has ('win64') ? 'NUL' : '/dev/null'
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/langserver.vim
Sourced 1 time
Total time: 0.001795
Self time: 0.001067
count total (s) self (s)
" Author: Eric Stern <eric@ericstern.com>
" Description: PHP Language server integration for ALE
1 0.000029 0.000015 call ale#Set('php_langserver_executable', 'php-language-server.php')
1 0.000012 0.000006 call ale#Set('php_langserver_use_global', get(g:, 'ale_use_global_executables', 0))
1 0.000496 function! ale_linters#php#langserver#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
1 0.001050 0.000342 call ale#linter#Define('php', {
\ 'name': 'langserver',
\ 'lsp': 'stdio',
\ 'executable_callback': ale#node#FindExecutableFunc('php_langserver', [
\ 'vendor/bin/php-language-server.php',
\ ]),
\ 'command': 'php %e',
\ 'project_root_callback': 'ale_linters#php#langserver#GetProjectRoot',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/node.vim
Sourced 1 time
Total time: 0.000320
Self time: 0.000296
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Functions for working with Node executables.
1 0.000040 0.000016 call ale#Set('windows_node_executable_path', 'node.exe')
" Given a buffer number, a base variable name, and a list of paths to search
" for in ancestor directories, detect the executable path for a Node program.
"
" The use_global and executable options for the relevant program will be used.
1 0.000006 function! ale#node#FindExecutable(buffer, base_var_name, path_list) abort
if ale#Var(a:buffer, a:base_var_name . '_use_global')
return ale#Var(a:buffer, a:base_var_name . '_executable')
endif
for l:path in a:path_list
let l:executable = ale#path#FindNearestFile(a:buffer, l:path)
if !empty(l:executable)
return l:executable
endif
endfor
return ale#Var(a:buffer, a:base_var_name . '_executable')
endfunction
" As above, but curry the arguments so only the buffer number is required.
1 0.000004 function! ale#node#FindExecutableFunc(base_var_name, path_list) abort
return {buf -> ale#node#FindExecutable(buf, a:base_var_name, a:path_list)}
endfunction
" Create a executable string which executes a Node.js script command with a
" Node.js executable if needed.
"
" The executable string should not be escaped before passing it to this
" function, the executable string will be escaped when returned by this
" function.
"
" The executable is only prefixed for Windows machines
1 0.000003 function! ale#node#Executable(buffer, executable) abort
if ale#Has('win32') && a:executable =~? '\.js$'
let l:node = ale#Var(a:buffer, 'windows_node_executable_path')
return ale#Escape(l:node) . ' ' . ale#Escape(a:executable)
endif
return ale#Escape(a:executable)
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/phan.vim
Sourced 1 time
Total time: 0.000872
Self time: 0.000618
count total (s) self (s)
" Author: diegoholiveira <https://github.com/diegoholiveira>, haginaga <https://github.com/haginaga>
" Description: static analyzer for PHP
" Define the minimum severity
1 0.000007 let g:ale_php_phan_minimum_severity = get(g:, 'ale_php_phan_minimum_severity', 0)
1 0.000008 let g:ale_php_phan_executable = get(g:, 'ale_php_phan_executable', 'phan')
1 0.000003 let g:ale_php_phan_use_client = get(g:, 'ale_php_phan_use_client', 0)
1 0.000344 function! ale_linters#php#phan#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'php_phan_executable')
if ale#Var(a:buffer, 'php_phan_use_client') == 1 && l:executable is# 'phan'
let l:executable = 'phan_client'
endif
return l:executable
endfunction
1 0.000003 function! ale_linters#php#phan#GetCommand(buffer) abort
if ale#Var(a:buffer, 'php_phan_use_client') == 1
let l:args = '-l '
\ . ' %s'
else
let l:args = '-y '
\ . ale#Var(a:buffer, 'php_phan_minimum_severity')
\ . ' %s'
endif
let l:executable = ale_linters#php#phan#GetExecutable(a:buffer)
return ale#Escape(l:executable) . ' ' . l:args
endfunction
1 0.000002 function! ale_linters#php#phan#Handle(buffer, lines) abort
" Matches against lines like the following:
if ale#Var(a:buffer, 'php_phan_use_client') == 1
" Phan error: ERRORTYPE: message in /path/to/some-filename.php on line nnn
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
else
" /path/to/some-filename.php:18 ERRORTYPE message
let l:pattern = '^.*:\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
endif
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if ale#Var(a:buffer, 'php_phan_use_client') == 1
let l:dict = {
\ 'lnum': l:match[4] + 0,
\ 'text': l:match[2],
\ 'type': 'W',
\}
else
let l:dict = {
\ 'lnum': l:match[1] + 0,
\ 'text': l:match[3],
\ 'type': 'W',
\}
endif
call add(l:output, l:dict)
endfor
return l:output
endfunction
1 0.000273 0.000019 call ale#linter#Define('php', {
\ 'name': 'phan',
\ 'executable_callback': 'ale_linters#php#phan#GetExecutable',
\ 'command_callback': 'ale_linters#php#phan#GetCommand',
\ 'callback': 'ale_linters#php#phan#Handle',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/php.vim
Sourced 1 time
Total time: 0.000866
Self time: 0.000624
count total (s) self (s)
" Author: Spencer Wood <https://github.com/scwood>, Adriaan Zonnenberg <amz@adriaan.xyz>
" Description: This file adds support for checking PHP with php-cli
1 0.000411 function! ale_linters#php#php#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" PHP 7.1<= - Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
" PHP 7.2>= - Parse error: syntax error, unexpected ';', expecting ']' in Standard input code on line 15
let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in %(-|Standard input code) on line (\d+)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:col = empty(l:match[2]) ? 0 : stridx(getline(l:match[3]), l:match[2]) + 1
let l:obj = {
\ 'lnum': l:match[3] + 0,
\ 'col': l:col,
\ 'text': l:match[1],
\}
if l:col != 0
let l:obj.end_col = l:col + strlen(l:match[2]) - 1
endif
call add(l:output, l:obj)
endfor
return l:output
endfunction
1 0.000261 0.000019 call ale#linter#Define('php', {
\ 'name': 'php',
\ 'executable': 'php',
\ 'output_stream': 'stdout',
\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
\ 'callback': 'ale_linters#php#php#Handle',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/phpcs.vim
Sourced 1 time
Total time: 0.000833
Self time: 0.000555
count total (s) self (s)
" Author: jwilliams108 <https://github.com/jwilliams108>, Eric Stern <https://github.com/firehed>
" Description: phpcs for PHP files
1 0.000008 let g:ale_php_phpcs_standard = get(g:, 'ale_php_phpcs_standard', '')
1 0.000020 0.000010 call ale#Set('php_phpcs_options', '')
1 0.000014 0.000004 call ale#Set('php_phpcs_executable', 'phpcs')
1 0.000011 0.000005 call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
1 0.000309 function! ale_linters#php#phpcs#GetCommand(buffer) abort
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
let l:standard_option = !empty(l:standard)
\ ? '--standard=' . l:standard
\ : ''
let l:options = ale#Var(a:buffer, 'php_phpcs_options')
return '%e -s --report=emacs --stdin-path=%s'
\ . ale#Pad(l:standard_option)
\ . ale#Pad(l:options)
endfunction
1 0.000003 function! ale_linters#php#phpcs#Handle(buffer, lines) abort
" Matches against lines like the following:
"
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\))$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[5]
let l:text = l:match[4] . ' (' . l:code . ')'
let l:type = l:match[3]
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:text,
\ 'type': l:type is# 'error' ? 'E' : 'W',
\})
endfor
return l:output
endfunction
1 0.000272 0.000020 call ale#linter#Define('php', {
\ 'name': 'phpcs',
\ 'executable_callback': ale#node#FindExecutableFunc('php_phpcs', [
\ 'vendor/bin/phpcs',
\ 'phpcs'
\ ]),
\ 'command_callback': 'ale_linters#php#phpcs#GetCommand',
\ 'callback': 'ale_linters#php#phpcs#Handle',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/phpmd.vim
Sourced 1 time
Total time: 0.001233
Self time: 0.000909
count total (s) self (s)
" Author: medains <https://github.com/medains>, David Sierra <https://github.com/davidsierradz>
" Description: phpmd for PHP files
1 0.000015 let g:ale_php_phpmd_executable = get(g:, 'ale_php_phpmd_executable', 'phpmd')
" Set to change the ruleset
1 0.000004 let g:ale_php_phpmd_ruleset = get(g:, 'ale_php_phpmd_ruleset', 'cleancode,codesize,controversial,design,naming,unusedcode')
1 0.000481 function! ale_linters#php#phpmd#GetCommand(buffer) abort
return '%e %s text'
\ . ale#Pad(ale#Var(a:buffer, 'php_phpmd_ruleset'))
\ . ' --ignore-violations-on-exit %t'
endfunction
1 0.000006 function! ale_linters#php#phpmd#Handle(buffer, lines) abort
" Matches against lines like the following:
"
" /path/to/some-filename.php:18 message
let l:pattern = '^.*:\(\d\+\)\s\+\(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'text': l:match[2],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
1 0.000372 0.000049 call ale#linter#Define('php', {
\ 'name': 'phpmd',
\ 'executable_callback': ale#VarFunc('php_phpmd_executable'),
\ 'command_callback': 'ale_linters#php#phpmd#GetCommand',
\ 'callback': 'ale_linters#php#phpmd#Handle',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/ale_linters/php/phpstan.vim
Sourced 1 time
Total time: 0.001038
Self time: 0.000682
count total (s) self (s)
" Author: medains <https://github.com/medains>, ardis <https://github.com/ardisdreelath>
" Description: phpstan for PHP files
" Set to change the ruleset
1 0.000010 let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan')
1 0.000005 let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
1 0.000003 let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
1 0.000353 function! ale_linters#php#phpstan#GetCommand(buffer) abort
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
let l:configuration_option = !empty(l:configuration)
\ ? ' -c ' . l:configuration
\ : ''
return '%e analyze -l'
\ . ale#Var(a:buffer, 'php_phpstan_level')
\ . ' --errorFormat raw'
\ . l:configuration_option
\ . ' %s'
endfunction
1 0.000003 function! ale_linters#php#phpstan#Handle(buffer, lines) abort
" Matches against lines like the following:
"
" filename.php:15:message
" C:\folder\filename.php:15:message
let l:pattern = '^\([a-zA-Z]:\)\?[^:]\+:\(\d\+\):\(.*\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[3],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
1 0.000379 0.000023 call ale#linter#Define('php', {
\ 'name': 'phpstan',
\ 'executable_callback': ale#VarFunc('php_phpstan_executable'),
\ 'command_callback': 'ale_linters#php#phpstan#GetCommand',
\ 'callback': 'ale_linters#php#phpstan#Handle',
\})
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/engine.vim
Sourced 1 time
Total time: 0.000937
Self time: 0.000937
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Backend execution and job management
" Executes linters in the background, using NeoVim or Vim 8 jobs
" Remapping of linter problems.
1 0.000011 let g:ale_type_map = get(g:, 'ale_type_map', {})
" Stores information for each job including:
"
" linter: The linter dictionary for the job.
" buffer: The buffer number for the job.
" output: The array of lines for the output of the job.
1 0.000003 if !has_key(s:, 'job_info_map')
1 0.000002 let s:job_info_map = {}
1 0.000001 endif
1 0.000002 if !has_key(s:, 'executable_cache_map')
1 0.000002 let s:executable_cache_map = {}
1 0.000001 endif
1 0.000005 function! ale#engine#ResetExecutableCache() abort
let s:executable_cache_map = {}
endfunction
" Check if files are executable, and if they are, remember that they are
" for subsequent calls. We'll keep checking until programs can be executed.
1 0.000003 function! ale#engine#IsExecutable(buffer, executable) abort
if empty(a:executable)
" Don't log the executable check if the executable string is empty.
return 0
endif
" Check for a cached executable() check.
let l:result = get(s:executable_cache_map, a:executable, v:null)
if l:result isnot v:null
return l:result
endif
" Check if the file is executable, and convert -1 to 1.
let l:result = executable(a:executable) isnot 0
" Cache the executable check if we found it, or if the option to cache
" failing checks is on.
if l:result || get(g:, 'ale_cache_executable_check_failures', 0)
let s:executable_cache_map[a:executable] = l:result
endif
if g:ale_history_enabled
call ale#history#Add(a:buffer, l:result, 'executable', a:executable)
endif
return l:result
endfunction
1 0.000002 function! ale#engine#InitBufferInfo(buffer) abort
if !has_key(g:ale_buffer_info, a:buffer)
" job_list will hold the list of job IDs
" active_linter_list will hold the list of active linter names
" loclist holds the loclist items after all jobs have completed.
" temporary_file_list holds temporary files to be cleaned up
" temporary_directory_list holds temporary directories to be cleaned up
let g:ale_buffer_info[a:buffer] = {
\ 'job_list': [],
\ 'active_linter_list': [],
\ 'loclist': [],
\ 'temporary_file_list': [],
\ 'temporary_directory_list': [],
\}
return 1
endif
return 0
endfunction
" This function is documented and part of the public API.
"
" Return 1 if ALE is busy checking a given buffer
1 0.000002 function! ale#engine#IsCheckingBuffer(buffer) abort
let l:info = get(g:ale_buffer_info, a:buffer, {})
return !empty(get(l:info, 'active_linter_list', []))
endfunction
" Register a temporary file to be managed with the ALE engine for
" a current job run.
1 0.000002 function! ale#engine#ManageFile(buffer, filename) abort
call ale#engine#InitBufferInfo(a:buffer)
call add(g:ale_buffer_info[a:buffer].temporary_file_list, a:filename)
endfunction
" Same as the above, but manage an entire directory.
1 0.000002 function! ale#engine#ManageDirectory(buffer, directory) abort
call ale#engine#InitBufferInfo(a:buffer)
call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory)
endfunction
1 0.000002 function! ale#engine#CreateFile(buffer) abort
" This variable can be set to 1 in tests to stub this out.
if get(g:, 'ale_create_dummy_temporary_file')
return 'TEMP'
endif
let l:temporary_file = ale#util#Tempname()
call ale#engine#ManageFile(a:buffer, l:temporary_file)
return l:temporary_file
endfunction
" Create a new temporary directory and manage it in one go.
1 0.000002 function! ale#engine#CreateDirectory(buffer) abort
" This variable can be set to 1 in tests to stub this out.
if get(g:, 'ale_create_dummy_temporary_file')
return 'TEMP_DIR'
endif
let l:temporary_directory = ale#util#Tempname()
" Create the temporary directory for the file, unreadable by 'other'
" users.
call mkdir(l:temporary_directory, '', 0750)
call ale#engine#ManageDirectory(a:buffer, l:temporary_directory)
return l:temporary_directory
endfunction
1 0.000002 function! ale#engine#RemoveManagedFiles(buffer) abort
let l:info = get(g:ale_buffer_info, a:buffer, {})
" We can't delete anything in a sandbox, so wait until we escape from
" it to delete temporary files and directories.
if ale#util#InSandbox()
return
endif
" Delete files with a call akin to a plan `rm` command.
if has_key(l:info, 'temporary_file_list')
for l:filename in l:info.temporary_file_list
call delete(l:filename)
endfor
let l:info.temporary_file_list = []
endif
" Delete directories like `rm -rf`.
" Directories are handled differently from files, so paths that are
" intended to be single files can be set up for automatic deletion without
" accidentally deleting entire directories.
if has_key(l:info, 'temporary_directory_list')
for l:directory in l:info.temporary_directory_list
call delete(l:directory, 'rf')
endfor
let l:info.temporary_directory_list = []
endif
endfunction
1 0.000003 function! s:GatherOutput(job_id, line) abort
if has_key(s:job_info_map, a:job_id)
call add(s:job_info_map[a:job_id].output, a:line)
endif
endfunction
1 0.000002 function! ale#engine#HandleLoclist(linter_name, buffer, loclist) abort
let l:info = get(g:ale_buffer_info, a:buffer, {})
if empty(l:info)
return
endif
" Remove this linter from the list of active linters.
" This may have already been done when the job exits.
call filter(l:info.active_linter_list, 'v:val isnot# a:linter_name')
" Make some adjustments to the loclists to fix common problems, and also
" to set default values for loclist items.
let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist)
" Remove previous items for this linter.
call filter(l:info.loclist, 'v:val.linter_name isnot# a:linter_name')
" We don't need to add items or sort the list when this list is empty.
if !empty(l:linter_loclist)
" Add the new items.
call extend(l:info.loclist, l:linter_loclist)
" Sort the loclist again.
" We need a sorted list so we can run a binary search against it
" for efficient lookup of the messages in the cursor handler.
call sort(l:info.loclist, 'ale#util#LocItemCompare')
endif
if ale#ShouldDoNothing(a:buffer)
return
endif
call ale#engine#SetResults(a:buffer, l:info.loclist)
endfunction
1 0.000002 function! s:HandleExit(job_id, exit_code) abort
if !has_key(s:job_info_map, a:job_id)
return
endif
let l:job_info = s:job_info_map[a:job_id]
let l:linter = l:job_info.linter
let l:output = l:job_info.output
let l:buffer = l:job_info.buffer
let l:executable = l:job_info.executable
let l:next_chain_index = l:job_info.next_chain_index
if g:ale_history_enabled
call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code)
endif
" Remove this job from the list.
call ale#job#Stop(a:job_id)
call remove(s:job_info_map, a:job_id)
call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id')
call filter(g:ale_buffer_info[l:buffer].active_linter_list, 'v:val isnot# l:linter.name')
" Stop here if we land in the handle for a job completing if we're in
" a sandbox.
if ale#util#InSandbox()
return
endif
if has('nvim') && !empty(l:output) && empty(l:output[-1])
call remove(l:output, -1)
endif
if l:next_chain_index < len(get(l:linter, 'command_chain', []))
call s:InvokeChain(l:buffer, l:executable, l:linter, l:next_chain_index, l:output)
return
endif
" Log the output of the command for ALEInfo if we should.
if g:ale_history_enabled && g:ale_history_log_output
call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:])
endif
try
let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output)
" Handle the function being unknown, or being deleted.
catch /E700/
let l:loclist = []
endtry
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist)
endfunction
1 0.000002 function! ale#engine#SetResults(buffer, loclist) abort
let l:linting_is_done = !ale#engine#IsCheckingBuffer(a:buffer)
" Set signs first. This could potentially fix some line numbers.
" The List could be sorted again here by SetSigns.
if g:ale_set_signs
call ale#sign#SetSigns(a:buffer, a:loclist)
endif
if g:ale_set_quickfix || g:ale_set_loclist
call ale#list#SetLists(a:buffer, a:loclist)
endif
if exists('*ale#statusline#Update')
" Don't load/run if not already loaded.
call ale#statusline#Update(a:buffer, a:loclist)
endif
if g:ale_set_highlights
call ale#highlight#SetHighlights(a:buffer, a:loclist)
endif
if l:linting_is_done
if g:ale_echo_cursor
" Try and echo the warning now.
" This will only do something meaningful if we're in normal mode.
call ale#cursor#EchoCursorWarning()
endif
" Reset the save event marker, used for opening windows, etc.
call setbufvar(a:buffer, 'ale_save_event_fired', 0)
" Set a marker showing how many times a buffer has been checked.
call setbufvar(
\ a:buffer,
\ 'ale_linted',
\ getbufvar(a:buffer, 'ale_linted', 0) + 1
\)
" Automatically remove all managed temporary files and directories
" now that all jobs have completed.
call ale#engine#RemoveManagedFiles(a:buffer)
" Call user autocommands. This allows users to hook into ALE's lint cycle.
silent doautocmd <nomodeline> User ALELintPost
endif
endfunction
1 0.000002 function! s:RemapItemTypes(type_map, loclist) abort
for l:item in a:loclist
let l:key = l:item.type
\ . (get(l:item, 'sub_type', '') is# 'style' ? 'S' : '')
let l:new_key = get(a:type_map, l:key, '')
if l:new_key is# 'E'
\|| l:new_key is# 'ES'
\|| l:new_key is# 'W'
\|| l:new_key is# 'WS'
\|| l:new_key is# 'I'
let l:item.type = l:new_key[0]
if l:new_key is# 'ES' || l:new_key is# 'WS'
let l:item.sub_type = 'style'
elseif has_key(l:item, 'sub_type')
call remove(l:item, 'sub_type')
endif
endif
endfor
endfunction
1 0.000002 function! ale#engine#FixLocList(buffer, linter_name, loclist) abort
let l:bufnr_map = {}
let l:new_loclist = []
" Some errors have line numbers beyond the end of the file,
" so we need to adjust them so they set the error at the last line
" of the file instead.
let l:last_line_number = ale#util#GetLineCount(a:buffer)
for l:old_item in a:loclist
" Copy the loclist item with some default values and corrections.
"
" line and column numbers will be converted to numbers.
" The buffer will default to the buffer being checked.
" The vcol setting will default to 0, a byte index.
" The error type will default to 'E' for errors.
" The error number will default to -1.
"
" The line number and text are the only required keys.
"
" The linter_name will be set on the errors so it can be used in
" output, filtering, etc..
let l:item = {
\ 'bufnr': a:buffer,
\ 'text': l:old_item.text,
\ 'lnum': str2nr(l:old_item.lnum),
\ 'col': str2nr(get(l:old_item, 'col', 0)),
\ 'vcol': 0,
\ 'type': get(l:old_item, 'type', 'E'),
\ 'nr': get(l:old_item, 'nr', -1),
\ 'linter_name': a:linter_name,
\}
if has_key(l:old_item, 'code')
let l:item.code = l:old_item.code
endif
if has_key(l:old_item, 'filename')
\&& !ale#path#IsTempName(l:old_item.filename)
" Use the filename given.
" Temporary files are assumed to be for this buffer,
" and the filename is not included then, because it looks bad
" in the loclist window.
let l:filename = l:old_item.filename
let l:item.filename = l:filename
if has_key(l:old_item, 'bufnr')
" If a buffer number is also given, include that too.
" If Vim detects that he buffer number is valid, it will
" be used instead of the filename.
let l:item.bufnr = l:old_item.bufnr
elseif has_key(l:bufnr_map, l:filename)
" Get the buffer number from the map, which can be faster.
let l:item.bufnr = l:bufnr_map[l:filename]
else
" Look up the buffer number.
let l:item.bufnr = bufnr(l:filename)
let l:bufnr_map[l:filename] = l:item.bufnr
endif
elseif has_key(l:old_item, 'bufnr')
let l:item.bufnr = l:old_item.bufnr
endif
if has_key(l:old_item, 'detail')
let l:item.detail = l:old_item.detail
endif
" Pass on a end_col key if set, used for highlights.
if has_key(l:old_item, 'end_col')
let l:item.end_col = str2nr(l:old_item.end_col)
endif
if has_key(l:old_item, 'end_lnum')
let l:item.end_lnum = str2nr(l:old_item.end_lnum)
endif
if has_key(l:old_item, 'sub_type')
let l:item.sub_type = l:old_item.sub_type
endif
if l:item.lnum < 1
" When errors appear before line 1, put them at line 1.
let l:item.lnum = 1
elseif l:item.bufnr == a:buffer && l:item.lnum > l:last_line_number
" When errors go beyond the end of the file, put them at the end.
" This is only done for the current buffer.
let l:item.lnum = l:last_line_number
elseif get(l:old_item, 'vcol', 0)
" Convert virtual column positions to byte positions.
" The positions will be off if the buffer has changed recently.
let l:line = getbufline(a:buffer, l:item.lnum)[0]
let l:item.col = ale#util#Col(l:line, l:item.col)
if has_key(l:item, 'end_col')
let l:end_line = get(l:item, 'end_lnum', l:line) != l:line
\ ? getbufline(a:buffer, l:item.end_lnum)[0]
\ : l:line
let l:item.end_col = ale#util#Col(l:end_line, l:item.end_col)
endif
endif
call add(l:new_loclist, l:item)
endfor
let l:type_map = get(ale#Var(a:buffer, 'type_map'), a:linter_name, {})
if !empty(l:type_map)
call s:RemapItemTypes(l:type_map, l:new_loclist)
endif
return l:new_loclist
endfunction
" Given part of a command, replace any % with %%, so that no characters in
" the string will be replaced with filenames, etc.
1 0.000002 function! ale#engine#EscapeCommandPart(command_part) abort
return substitute(a:command_part, '%', '%%', 'g')
endfunction
1 0.000002 function! s:CreateTemporaryFileForJob(buffer, temporary_file) abort
if empty(a:temporary_file)
" There is no file, so we didn't create anything.
return 0
endif
let l:temporary_directory = fnamemodify(a:temporary_file, ':h')
" Create the temporary directory for the file, unreadable by 'other'
" users.
call mkdir(l:temporary_directory, '', 0750)
" Automatically delete the directory later.
call ale#engine#ManageDirectory(a:buffer, l:temporary_directory)
" Write the buffer out to a file.
let l:lines = getbufline(a:buffer, 1, '$')
call ale#util#Writefile(a:buffer, l:lines, a:temporary_file)
return 1
endfunction
" Run a job.
"
" Returns 1 when the job was started successfully.
1 0.000001 function! s:RunJob(options) abort
let l:command = a:options.command
if empty(l:command)
return 0
endif
let l:executable = a:options.executable
let l:buffer = a:options.buffer
let l:linter = a:options.linter
let l:output_stream = a:options.output_stream
let l:next_chain_index = a:options.next_chain_index
let l:read_buffer = a:options.read_buffer
let l:info = g:ale_buffer_info[l:buffer]
let [l:temporary_file, l:command] = ale#command#FormatCommand(
\ l:buffer,
\ l:executable,
\ l:command,
\ l:read_buffer,
\)
if s:CreateTemporaryFileForJob(l:buffer, l:temporary_file)
" If a temporary filename has been formatted in to the command, then
" we do not need to send the Vim buffer to the command.
let l:read_buffer = 0
endif
" Add a newline to commands which need it.
" This is only used for Flow for now, and is not documented.
if l:linter.add_newline
if has('win32')
let l:command = l:command . '; echo.'
else
let l:command = l:command . '; echo'
endif
endif
let l:command = ale#job#PrepareCommand(l:buffer, l:command)
let l:job_options = {
\ 'mode': 'nl',
\ 'exit_cb': function('s:HandleExit'),
\}
if l:output_stream is# 'stderr'
let l:job_options.err_cb = function('s:GatherOutput')
elseif l:output_stream is# 'both'
let l:job_options.out_cb = function('s:GatherOutput')
let l:job_options.err_cb = function('s:GatherOutput')
else
let l:job_options.out_cb = function('s:GatherOutput')
endif
if get(g:, 'ale_run_synchronously') == 1
" Find a unique Job value to use, which will be the same as the ID for
" running commands synchronously. This is only for test code.
let l:job_id = len(s:job_info_map) + 1
while has_key(s:job_info_map, l:job_id)
let l:job_id += 1
endwhile
else
let l:job_id = ale#job#Start(l:command, l:job_options)
endif
let l:status = 'failed'
" Only proceed if the job is being run.
if l:job_id
" Add the job to the list of jobs, so we can track them.
call add(l:info.job_list, l:job_id)
if index(l:info.active_linter_list, l:linter.name) < 0
call add(l:info.active_linter_list, l:linter.name)
endif
let l:status = 'started'
" Store the ID for the job in the map to read back again.
let s:job_info_map[l:job_id] = {
\ 'linter': l:linter,
\ 'buffer': l:buffer,
\ 'executable': l:executable,
\ 'output': [],
\ 'next_chain_index': l:next_chain_index,
\}
silent doautocmd <nomodeline> User ALEJobStarted
endif
if g:ale_history_enabled
call ale#history#Add(l:buffer, l:status, l:job_id, l:command)
endif
if get(g:, 'ale_run_synchronously') == 1
" Run a command synchronously if this test option is set.
let s:job_info_map[l:job_id].output = systemlist(
\ type(l:command) is v:t_list
\ ? join(l:command[0:1]) . ' ' . ale#Escape(l:command[2])
\ : l:command
\)
call l:job_options.exit_cb(l:job_id, v:shell_error)
endif
return l:job_id != 0
endfunction
" Determine which commands to run for a link in a command chain, or
" just a regular command.
1 0.000003 function! ale#engine#ProcessChain(buffer, linter, chain_index, input) abort
let l:output_stream = get(a:linter, 'output_stream', 'stdout')
let l:read_buffer = a:linter.read_buffer
let l:chain_index = a:chain_index
let l:input = a:input
if has_key(a:linter, 'command_chain')
while l:chain_index < len(a:linter.command_chain)
" Run a chain of commands, one asynchronous command after the other,
" so that many programs can be run in a sequence.
let l:chain_item = a:linter.command_chain[l:chain_index]
if l:chain_index == 0
" The first callback in the chain takes only a buffer number.
let l:command = ale#util#GetFunction(l:chain_item.callback)(
\ a:buffer
\)
else
" The second callback in the chain takes some input too.
let l:command = ale#util#GetFunction(l:chain_item.callback)(
\ a:buffer,
\ l:input
\)
endif
if !empty(l:command)
" We hit a command to run, so we'll execute that
" The chain item can override the output_stream option.
if has_key(l:chain_item, 'output_stream')
let l:output_stream = l:chain_item.output_stream
endif
" The chain item can override the read_buffer option.
if has_key(l:chain_item, 'read_buffer')
let l:read_buffer = l:chain_item.read_buffer
elseif l:chain_index != len(a:linter.command_chain) - 1
" Don't read the buffer for commands besides the last one
" in the chain by default.
let l:read_buffer = 0
endif
break
endif
" Command chain items can return an empty string to indicate that
" a command should be skipped, so we should try the next item
" with no input.
let l:input = []
let l:chain_index += 1
endwhile
else
let l:command = ale#linter#GetCommand(a:buffer, a:linter)
endif
return {
\ 'command': l:command,
\ 'buffer': a:buffer,
\ 'linter': a:linter,
\ 'output_stream': l:output_stream,
\ 'next_chain_index': l:chain_index + 1,
\ 'read_buffer': l:read_buffer,
\}
endfunction
1 0.000002 function! s:InvokeChain(buffer, executable, linter, chain_index, input) abort
let l:options = ale#engine#ProcessChain(a:buffer, a:linter, a:chain_index, a:input)
let l:options.executable = a:executable
return s:RunJob(l:options)
endfunction
1 0.000002 function! s:StopCurrentJobs(buffer, include_lint_file_jobs) abort
let l:info = get(g:ale_buffer_info, a:buffer, {})
let l:new_job_list = []
let l:new_active_linter_list = []
for l:job_id in get(l:info, 'job_list', [])
let l:job_info = get(s:job_info_map, l:job_id, {})
if !empty(l:job_info)
if a:include_lint_file_jobs || !l:job_info.linter.lint_file
call ale#job#Stop(l:job_id)
call remove(s:job_info_map, l:job_id)
else
call add(l:new_job_list, l:job_id)
" Linters with jobs still running are still active.
call add(l:new_active_linter_list, l:job_info.linter.name)
endif
endif
endfor
" Remove duplicates from the active linter list.
call uniq(sort(l:new_active_linter_list))
" Update the List, so it includes only the jobs we still need.
let l:info.job_list = l:new_job_list
" Update the active linter list, clearing out anything not running.
let l:info.active_linter_list = l:new_active_linter_list
endfunction
1 0.000002 function! s:RemoveProblemsForDisabledLinters(buffer, linters) abort
" Figure out which linters are still enabled, and remove
" problems for linters which are no longer enabled.
let l:name_map = {}
for l:linter in a:linters
let l:name_map[l:linter.name] = 1
endfor
call filter(
\ get(g:ale_buffer_info[a:buffer], 'loclist', []),
\ 'get(l:name_map, get(v:val, ''linter_name''))',
\)
endfunction
1 0.000002 function! s:AddProblemsFromOtherBuffers(buffer, linters) abort
let l:filename = expand('#' . a:buffer . ':p')
let l:loclist = []
let l:name_map = {}
" Build a map of the active linters.
for l:linter in a:linters
let l:name_map[l:linter.name] = 1
endfor
" Find the items from other buffers, for the linters that are enabled.
for l:info in values(g:ale_buffer_info)
for l:item in l:info.loclist
if has_key(l:item, 'filename')
\&& l:item.filename is# l:filename
\&& has_key(l:name_map, l:item.linter_name)
" Copy the items and set the buffer numbers to this one.
let l:new_item = copy(l:item)
let l:new_item.bufnr = a:buffer
call add(l:loclist, l:new_item)
endif
endfor
endfor
if !empty(l:loclist)
call sort(l:loclist, function('ale#util#LocItemCompareWithText'))
call uniq(l:loclist, function('ale#util#LocItemCompareWithText'))
" Set the loclist variable, used by some parts of ALE.
let g:ale_buffer_info[a:buffer].loclist = l:loclist
call ale#engine#SetResults(a:buffer, l:loclist)
endif
endfunction
" Run a linter for a buffer.
"
" Returns 1 if the linter was successfully run.
1 0.000002 function! s:RunLinter(buffer, linter) abort
if !empty(a:linter.lsp)
return ale#lsp_linter#CheckWithLSP(a:buffer, a:linter)
else
let l:executable = ale#linter#GetExecutable(a:buffer, a:linter)
if ale#engine#IsExecutable(a:buffer, l:executable)
return s:InvokeChain(a:buffer, l:executable, a:linter, 0, [])
endif
endif
return 0
endfunction
1 0.000002 function! ale#engine#RunLinters(buffer, linters, should_lint_file) abort
" Initialise the buffer information if needed.
let l:new_buffer = ale#engine#InitBufferInfo(a:buffer)
call s:StopCurrentJobs(a:buffer, a:should_lint_file)
call s:RemoveProblemsForDisabledLinters(a:buffer, a:linters)
" We can only clear the results if we aren't checking the buffer.
let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer)
silent doautocmd <nomodeline> User ALELintPre
for l:linter in a:linters
" Only run lint_file linters if we should.
if !l:linter.lint_file || a:should_lint_file
if s:RunLinter(a:buffer, l:linter)
" If a single linter ran, we shouldn't clear everything.
let l:can_clear_results = 0
endif
else
" If we skipped running a lint_file linter still in the list,
" we shouldn't clear everything.
let l:can_clear_results = 0
endif
endfor
" Clear the results if we can. This needs to be done when linters are
" disabled, or ALE itself is disabled.
if l:can_clear_results
call ale#engine#SetResults(a:buffer, [])
elseif l:new_buffer
call s:AddProblemsFromOtherBuffers(a:buffer, a:linters)
endif
endfunction
" Clean up a buffer.
"
" This function will stop all current jobs for the buffer,
" clear the state of everything, and remove the Dictionary for managing
" the buffer.
1 0.000002 function! ale#engine#Cleanup(buffer) abort
" Don't bother with cleanup code when newer NeoVim versions are exiting.
if get(v:, 'exiting', v:null) isnot v:null
return
endif
if !has_key(g:ale_buffer_info, a:buffer)
return
endif
call ale#engine#RunLinters(a:buffer, [], 1)
call remove(g:ale_buffer_info, a:buffer)
endfunction
" Given a buffer number, return the warnings and errors for a given buffer.
1 0.000002 function! ale#engine#GetLoclist(buffer) abort
if !has_key(g:ale_buffer_info, a:buffer)
return []
endif
return g:ale_buffer_info[a:buffer].loclist
endfunction
" This function can be called with a timeout to wait for all jobs to finish.
" If the jobs to not finish in the given number of milliseconds,
" an exception will be thrown.
"
" The time taken will be a very rough approximation, and more time may be
" permitted than is specified.
1 0.000002 function! ale#engine#WaitForJobs(deadline) abort
let l:start_time = ale#events#ClockMilliseconds()
if l:start_time == 0
throw 'Failed to read milliseconds from the clock!'
endif
let l:job_list = []
" Gather all of the jobs from every buffer.
for l:info in values(g:ale_buffer_info)
call extend(l:job_list, get(l:info, 'job_list', []))
endfor
" NeoVim has a built-in API for this, so use that.
if has('nvim')
let l:nvim_code_list = jobwait(l:job_list, a:deadline)
if index(l:nvim_code_list, -1) >= 0
throw 'Jobs did not complete on time!'
endif
return
endif
let l:should_wait_more = 1
while l:should_wait_more
let l:should_wait_more = 0
for l:job_id in l:job_list
if ale#job#IsRunning(l:job_id)
let l:now = ale#events#ClockMilliseconds()
if l:now - l:start_time > a:deadline
" Stop waiting after a timeout, so we don't wait forever.
throw 'Jobs did not complete on time!'
endif
" Wait another 10 milliseconds
let l:should_wait_more = 1
sleep 10ms
break
endif
endfor
endwhile
" Sleep for a small amount of time after all jobs finish.
" This seems to be enough to let handlers after jobs end run, and
" prevents the occasional failure where this function exits after jobs
" end, but before handlers are run.
sleep 10ms
" We must check the buffer data again to see if new jobs started
" for command_chain linters.
let l:has_new_jobs = 0
" Check again to see if any jobs are running.
for l:info in values(g:ale_buffer_info)
for l:job_id in get(l:info, 'job_list', [])
if ale#job#IsRunning(l:job_id)
let l:has_new_jobs = 1
break
endif
endfor
endfor
if l:has_new_jobs
" We have to wait more. Offset the timeout by the time taken so far.
let l:now = ale#events#ClockMilliseconds()
let l:new_deadline = a:deadline - (l:now - l:start_time)
if l:new_deadline <= 0
" Enough time passed already, so stop immediately.
throw 'Jobs did not complete on time!'
endif
call ale#engine#WaitForJobs(l:new_deadline)
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/lsp_linter.vim
Sourced 1 time
Total time: 0.000313
Self time: 0.000313
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Integration between linters and LSP/tsserver.
" This code isn't loaded if a user never users LSP features or linters.
" Associates LSP connection IDs with linter names.
1 0.000008 if !has_key(s:, 'lsp_linter_map')
1 0.000004 let s:lsp_linter_map = {}
1 0.000005 endif
" Check if diagnostics for a particular linter should be ignored.
1 0.000005 function! s:ShouldIgnore(buffer, linter_name) abort
let l:config = ale#Var(a:buffer, 'linters_ignore')
" Don't load code for ignoring diagnostics if there's nothing to ignore.
if empty(l:config)
return 0
endif
let l:filetype = getbufvar(a:buffer, '&filetype')
let l:ignore_list = ale#engine#ignore#GetList(l:filetype, l:config)
return index(l:ignore_list, a:linter_name) >= 0
endfunction
1 0.000003 function! s:HandleLSPDiagnostics(conn_id, response) abort
let l:linter_name = s:lsp_linter_map[a:conn_id]
let l:filename = ale#path#FromURI(a:response.params.uri)
let l:buffer = bufnr(l:filename)
if s:ShouldIgnore(l:buffer, l:linter_name)
return
endif
if l:buffer <= 0
return
endif
let l:loclist = ale#lsp#response#ReadDiagnostics(a:response)
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist)
endfunction
1 0.000003 function! s:HandleTSServerDiagnostics(response, error_type) abort
let l:linter_name = 'tsserver'
let l:buffer = bufnr(a:response.body.file)
let l:info = get(g:ale_buffer_info, l:buffer, {})
if empty(l:info)
return
endif
if s:ShouldIgnore(l:buffer, l:linter_name)
return
endif
let l:thislist = ale#lsp#response#ReadTSServerDiagnostics(a:response)
" tsserver sends syntax and semantic errors in separate messages, so we
" have to collect the messages separately for each buffer and join them
" back together again.
if a:error_type is# 'syntax'
let l:info.syntax_loclist = l:thislist
else
let l:info.semantic_loclist = l:thislist
endif
let l:loclist = get(l:info, 'semantic_loclist', [])
\ + get(l:info, 'syntax_loclist', [])
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist)
endfunction
1 0.000004 function! s:HandleLSPErrorMessage(linter_name, response) abort
if !g:ale_history_enabled || !g:ale_history_log_output
return
endif
if empty(a:linter_name)
return
endif
let l:message = ale#lsp#response#GetErrorMessage(a:response)
if empty(l:message)
return
endif
" This global variable is set here so we don't load the debugging.vim file
" until someone uses :ALEInfo.
let g:ale_lsp_error_messages = get(g:, 'ale_lsp_error_messages', {})
if !has_key(g:ale_lsp_error_messages, a:linter_name)
let g:ale_lsp_error_messages[a:linter_name] = []
endif
call add(g:ale_lsp_error_messages[a:linter_name], l:message)
endfunction
1 0.000005 function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
let l:method = get(a:response, 'method', '')
let l:linter_name = get(s:lsp_linter_map, a:conn_id, '')
if get(a:response, 'jsonrpc', '') is# '2.0' && has_key(a:response, 'error')
call s:HandleLSPErrorMessage(l:linter_name, a:response)
elseif l:method is# 'textDocument/publishDiagnostics'
call s:HandleLSPDiagnostics(a:conn_id, a:response)
elseif get(a:response, 'type', '') is# 'event'
\&& get(a:response, 'event', '') is# 'semanticDiag'
call s:HandleTSServerDiagnostics(a:response, 'semantic')
elseif get(a:response, 'type', '') is# 'event'
\&& get(a:response, 'event', '') is# 'syntaxDiag'
call s:HandleTSServerDiagnostics(a:response, 'syntax')
endif
endfunction
1 0.000003 function! ale#lsp_linter#GetOptions(buffer, linter) abort
let l:initialization_options = {}
if has_key(a:linter, 'initialization_options_callback')
let l:initialization_options = ale#util#GetFunction(a:linter.initialization_options_callback)(a:buffer)
elseif has_key(a:linter, 'initialization_options')
let l:initialization_options = a:linter.initialization_options
endif
return l:initialization_options
endfunction
" Given a buffer, an LSP linter, start up an LSP linter and get ready to
" receive messages for the document.
1 0.000002 function! ale#lsp_linter#StartLSP(buffer, linter) abort
let l:command = ''
let l:address = ''
let l:root = ale#util#GetFunction(a:linter.project_root_callback)(a:buffer)
if empty(l:root) && a:linter.lsp isnot# 'tsserver'
" If there's no project root, then we can't check files with LSP,
" unless we are using tsserver, which doesn't use project roots.
return {}
endif
let l:init_options = ale#lsp_linter#GetOptions(a:buffer, a:linter)
if a:linter.lsp is# 'socket'
let l:address = ale#linter#GetAddress(a:buffer, a:linter)
let l:conn_id = ale#lsp#Register(l:address, l:root, l:init_options)
let l:ready = ale#lsp#ConnectToAddress(l:conn_id, l:address)
else
let l:executable = ale#linter#GetExecutable(a:buffer, a:linter)
if empty(l:executable) || !executable(l:executable)
return {}
endif
let l:conn_id = ale#lsp#Register(l:executable, l:root, l:init_options)
let l:command = ale#linter#GetCommand(a:buffer, a:linter)
" Format the command, so %e can be formatted into it.
let l:command = ale#command#FormatCommand(a:buffer, l:executable, l:command, 0)[1]
let l:command = ale#job#PrepareCommand(a:buffer, l:command)
let l:ready = ale#lsp#StartProgram(l:conn_id, l:executable, l:command)
endif
if !l:ready
if g:ale_history_enabled && !empty(l:command)
call ale#history#Add(a:buffer, 'failed', l:conn_id, l:command)
endif
return {}
endif
" tsserver behaves differently, so tell the LSP API that it is tsserver.
if a:linter.lsp is# 'tsserver'
call ale#lsp#MarkConnectionAsTsserver(l:conn_id)
endif
let l:language_id = ale#util#GetFunction(a:linter.language_callback)(a:buffer)
let l:details = {
\ 'buffer': a:buffer,
\ 'connection_id': l:conn_id,
\ 'command': l:command,
\ 'project_root': l:root,
\ 'language_id': l:language_id,
\}
if ale#lsp#OpenDocument(l:conn_id, a:buffer, l:language_id)
if g:ale_history_enabled && !empty(l:command)
call ale#history#Add(a:buffer, 'started', l:conn_id, l:command)
endif
endif
" The change message needs to be sent for tsserver before doing anything.
if a:linter.lsp is# 'tsserver'
call ale#lsp#NotifyForChanges(l:conn_id, a:buffer)
endif
return l:details
endfunction
1 0.000004 function! ale#lsp_linter#CheckWithLSP(buffer, linter) abort
let l:info = g:ale_buffer_info[a:buffer]
let l:lsp_details = ale#lsp_linter#StartLSP(a:buffer, a:linter)
if empty(l:lsp_details)
return 0
endif
let l:id = l:lsp_details.connection_id
" Register a callback now for handling errors now.
let l:Callback = function('ale#lsp_linter#HandleLSPResponse')
call ale#lsp#RegisterCallback(l:id, l:Callback)
" Remember the linter this connection is for.
let s:lsp_linter_map[l:id] = a:linter.name
if a:linter.lsp is# 'tsserver'
let l:message = ale#lsp#tsserver_message#Geterr(a:buffer)
let l:notified = ale#lsp#Send(l:id, l:message) != 0
else
let l:notified = ale#lsp#NotifyForChanges(l:id, a:buffer)
endif
" If this was a file save event, also notify the server of that.
if a:linter.lsp isnot# 'tsserver'
\&& getbufvar(a:buffer, 'ale_save_event_fired', 0)
let l:save_message = ale#lsp#message#DidSave(a:buffer)
let l:notified = ale#lsp#Send(l:id, l:save_message) != 0
endif
if l:notified
if index(l:info.active_linter_list, a:linter.name) < 0
call add(l:info.active_linter_list, a:linter.name)
endif
endif
return l:notified
endfunction
" Clear LSP linter data for the linting engine.
1 0.000002 function! ale#lsp_linter#ClearLSPData() abort
let s:lsp_linter_map = {}
endfunction
" Just for tests.
1 0.000002 function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
let s:lsp_linter_map = a:replacement_map
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/path.vim
Sourced 1 time
Total time: 0.000493
Self time: 0.000450
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Functions for working with paths in the filesystem.
" simplify a path, and fix annoying issues with paths on Windows.
"
" Forward slashes are changed to back slashes so path equality works better.
"
" Paths starting with more than one forward slash are changed to only one
" forward slash, to prevent the paths being treated as special MSYS paths.
1 0.000006 function! ale#path#Simplify(path) abort
if has('unix')
return substitute(simplify(a:path), '^//\+', '/', 'g') " no-custom-checks
endif
let l:win_path = substitute(a:path, '/', '\\', 'g')
return substitute(simplify(l:win_path), '^\\\+', '\', 'g') " no-custom-checks
endfunction
" Given a buffer and a filename, find the nearest file by searching upwards
" through the paths relative to the given buffer.
1 0.000003 function! ale#path#FindNearestFile(buffer, filename) abort
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
let l:buffer_filename = fnameescape(l:buffer_filename)
let l:relative_path = findfile(a:filename, l:buffer_filename . ';')
if !empty(l:relative_path)
return fnamemodify(l:relative_path, ':p')
endif
return ''
endfunction
" Given a buffer and a directory name, find the nearest directory by searching upwards
" through the paths relative to the given buffer.
1 0.000005 function! ale#path#FindNearestDirectory(buffer, directory_name) abort
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
let l:buffer_filename = fnameescape(l:buffer_filename)
let l:relative_path = finddir(a:directory_name, l:buffer_filename . ';')
if !empty(l:relative_path)
return fnamemodify(l:relative_path, ':p')
endif
return ''
endfunction
" Given a buffer, a string to search for, an a global fallback for when
" the search fails, look for a file in parent paths, and if that fails,
" use the global fallback path instead.
1 0.000002 function! ale#path#ResolveLocalPath(buffer, search_string, global_fallback) abort
" Search for a locally installed file first.
let l:path = ale#path#FindNearestFile(a:buffer, a:search_string)
" If the serach fails, try the global executable instead.
if empty(l:path)
let l:path = a:global_fallback
endif
return l:path
endfunction
" Output 'cd <directory> && '
" This function can be used changing the directory for a linter command.
1 0.000002 function! ale#path#CdString(directory) abort
return 'cd ' . ale#Escape(a:directory) . ' && '
endfunction
" Output 'cd <buffer_filename_directory> && '
" This function can be used changing the directory for a linter command.
1 0.000002 function! ale#path#BufferCdString(buffer) abort
return ale#path#CdString(fnamemodify(bufname(a:buffer), ':p:h'))
endfunction
" Return 1 if a path is an absolute path.
1 0.000004 function! ale#path#IsAbsolute(filename) abort
if has('win32') && a:filename[:0] is# '\'
return 1
endif
" Check for /foo and C:\foo, etc.
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
endfunction
1 0.000070 0.000027 let s:temp_dir = ale#path#Simplify(fnamemodify(ale#util#Tempname(), ':h'))
" Given a filename, return 1 if the file represents some temporary file
" created by Vim.
1 0.000005 function! ale#path#IsTempName(filename) abort
return ale#path#Simplify(a:filename)[:len(s:temp_dir) - 1] is# s:temp_dir
endfunction
" Given a base directory, which must not have a trailing slash, and a
" filename, which may have an absolute path a path relative to the base
" directory, return the absolute path to the file.
1 0.000002 function! ale#path#GetAbsPath(base_directory, filename) abort
if ale#path#IsAbsolute(a:filename)
return ale#path#Simplify(a:filename)
endif
let l:sep = has('win32') ? '\' : '/'
return ale#path#Simplify(a:base_directory . l:sep . a:filename)
endfunction
" Given a path, return the directory name for that path, with no trailing
" slashes. If the argument is empty(), return an empty string.
1 0.000002 function! ale#path#Dirname(path) abort
if empty(a:path)
return ''
endif
" For /foo/bar/ we need :h:h to get /foo
if a:path[-1:] is# '/'
return fnamemodify(a:path, ':h:h')
endif
return fnamemodify(a:path, ':h')
endfunction
" Given a buffer number and a relative or absolute path, return 1 if the
" two paths represent the same file on disk.
1 0.000002 function! ale#path#IsBufferPath(buffer, complex_filename) abort
" If the path is one of many different names for stdin, we have a match.
if a:complex_filename is# '-'
\|| a:complex_filename is# 'stdin'
\|| a:complex_filename[:0] is# '<'
return 1
endif
let l:test_filename = ale#path#Simplify(a:complex_filename)
if l:test_filename[:1] is# './'
let l:test_filename = l:test_filename[2:]
endif
if l:test_filename[:1] is# '..'
" Remove ../../ etc. from the front of the path.
let l:test_filename = substitute(l:test_filename, '\v^(\.\.[/\\])+', '/', '')
endif
" Use the basename for temporary files, as they are likely our files.
if ale#path#IsTempName(l:test_filename)
let l:test_filename = fnamemodify(l:test_filename, ':t')
endif
let l:buffer_filename = expand('#' . a:buffer . ':p')
return l:buffer_filename is# l:test_filename
\ || l:buffer_filename[-len(l:test_filename):] is# l:test_filename
endfunction
" Given a path, return every component of the path, moving upwards.
1 0.000002 function! ale#path#Upwards(path) abort
let l:pattern = has('win32') ? '\v/+|\\+' : '\v/+'
let l:sep = has('win32') ? '\' : '/'
let l:parts = split(ale#path#Simplify(a:path), l:pattern)
let l:path_list = []
while !empty(l:parts)
call add(l:path_list, join(l:parts, l:sep))
let l:parts = l:parts[:-2]
endwhile
if has('win32') && a:path =~# '^[a-zA-z]:\'
" Add \ to C: for C:\, etc.
let l:path_list[-1] .= '\'
elseif a:path[0] is# '/'
" If the path starts with /, even on Windows, add / and / to all paths.
call map(l:path_list, '''/'' . v:val')
call add(l:path_list, '/')
endif
return l:path_list
endfunction
" Convert a filesystem path to a file:// URI
" relatives paths will not be prefixed with the protocol.
" For Windows paths, the `:` in C:\ etc. will not be percent-encoded.
1 0.000002 function! ale#path#ToURI(path) abort
let l:has_drive_letter = a:path[1:2] is# ':\'
return substitute(
\ ((l:has_drive_letter || a:path[:0] is# '/') ? 'file://' : '')
\ . (l:has_drive_letter ? '/' . a:path[:2] : '')
\ . ale#uri#Encode(l:has_drive_letter ? a:path[3:] : a:path),
\ '\\',
\ '/',
\ 'g',
\)
endfunction
1 0.000002 function! ale#path#FromURI(uri) abort
let l:i = len('file://')
let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri
let l:path = ale#uri#Decode(l:encoded_path)
" If the path is like /C:/foo/bar, it should be C:\foo\bar instead.
if l:path =~# '^/[a-zA-Z]:'
let l:path = substitute(l:path[1:], '/', '\\', 'g')
endif
return l:path
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/lsp.vim
Sourced 1 time
Total time: 0.000712
Self time: 0.000712
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Language Server Protocol client code
" A Dictionary for tracking connections.
1 0.000016 let s:connections = get(s:, 'connections', {})
1 0.000003 let g:ale_lsp_next_message_id = 1
" Given an id, which can be an executable or address, and a project path,
" create a new connection if needed. Return a unique ID for the connection.
1 0.000005 function! ale#lsp#Register(executable_or_address, project, init_options) abort
let l:conn_id = a:executable_or_address . ':' . a:project
if !has_key(s:connections, l:conn_id)
" is_tsserver: 1 if the connection is for tsserver.
" data: The message data received so far.
" root: The project root.
" open_documents: A Dictionary mapping buffers to b:changedtick, keeping
" track of when documents were opened, and when we last changed them.
" initialized: 0 if the connection is ready, 1 otherwise.
" init_request_id: The ID for the init request.
" init_options: Options to send to the server.
" callback_list: A list of callbacks for handling LSP responses.
" message_queue: Messages queued for sending to callbacks.
" capabilities_queue: The list of callbacks to call with capabilities.
" capabilities: Features the server supports.
let s:connections[l:conn_id] = {
\ 'id': l:conn_id,
\ 'is_tsserver': 0,
\ 'data': '',
\ 'root': a:project,
\ 'open_documents': {},
\ 'initialized': 0,
\ 'init_request_id': 0,
\ 'init_options': a:init_options,
\ 'callback_list': [],
\ 'message_queue': [],
\ 'capabilities_queue': [],
\ 'capabilities': {
\ 'hover': 0,
\ 'references': 0,
\ 'completion': 0,
\ 'completion_trigger_characters': [],
\ 'definition': 0,
\ },
\}
endif
return l:conn_id
endfunction
" Remove an LSP connection with a given ID. This is only for tests.
1 0.000004 function! ale#lsp#RemoveConnectionWithID(id) abort
if has_key(s:connections, a:id)
call remove(s:connections, a:id)
endif
endfunction
" This is only needed for tests
1 0.000003 function! ale#lsp#MarkDocumentAsOpen(id, buffer) abort
let l:conn = get(s:connections, a:id, {})
if !empty(l:conn)
let l:conn.open_documents[a:buffer] = -1
endif
endfunction
1 0.000002 function! ale#lsp#GetNextMessageID() abort
" Use the current ID
let l:id = g:ale_lsp_next_message_id
" Increment the ID variable.
let g:ale_lsp_next_message_id += 1
" When the ID overflows, reset it to 1. By the time we hit the initial ID
" again, the messages will be long gone.
if g:ale_lsp_next_message_id < 1
let g:ale_lsp_next_message_id = 1
endif
return l:id
endfunction
" TypeScript messages use a different format.
1 0.000003 function! s:CreateTSServerMessageData(message) abort
let l:is_notification = a:message[0]
let l:obj = {
\ 'seq': v:null,
\ 'type': 'request',
\ 'command': a:message[1][3:],
\}
if !l:is_notification
let l:obj.seq = ale#lsp#GetNextMessageID()
endif
if len(a:message) > 2
let l:obj.arguments = a:message[2]
endif
let l:data = json_encode(l:obj) . "\n"
return [l:is_notification ? 0 : l:obj.seq, l:data]
endfunction
" Given a List of one or two items, [method_name] or [method_name, params],
" return a List containing [message_id, message_data]
1 0.000003 function! ale#lsp#CreateMessageData(message) abort
if a:message[1][:2] is# 'ts@'
return s:CreateTSServerMessageData(a:message)
endif
let l:is_notification = a:message[0]
let l:obj = {
\ 'method': a:message[1],
\ 'jsonrpc': '2.0',
\}
if !l:is_notification
let l:obj.id = ale#lsp#GetNextMessageID()
endif
if len(a:message) > 2
let l:obj.params = a:message[2]
endif
let l:body = json_encode(l:obj)
let l:data = 'Content-Length: ' . strlen(l:body) . "\r\n\r\n" . l:body
return [l:is_notification ? 0 : l:obj.id, l:data]
endfunction
1 0.000002 function! ale#lsp#ReadMessageData(data) abort
let l:response_list = []
let l:remainder = a:data
while 1
" Look for the end of the HTTP headers
let l:body_start_index = matchend(l:remainder, "\r\n\r\n")
if l:body_start_index < 0
" No header end was found yet.
break
endif
" Parse the Content-Length header.
let l:header_data = l:remainder[:l:body_start_index - 4]
let l:length_match = matchlist(
\ l:header_data,
\ '\vContent-Length: *(\d+)'
\)
if empty(l:length_match)
throw "Invalid JSON-RPC header:\n" . l:header_data
endif
" Split the body and the remainder of the text.
let l:remainder_start_index = l:body_start_index + str2nr(l:length_match[1])
if len(l:remainder) < l:remainder_start_index
" We don't have enough data yet.
break
endif
let l:body = l:remainder[l:body_start_index : l:remainder_start_index - 1]
let l:remainder = l:remainder[l:remainder_start_index :]
" Parse the JSON object and add it to the list.
call add(l:response_list, json_decode(l:body))
endwhile
return [l:remainder, l:response_list]
endfunction
" Update capabilities from the server, so we know which features the server
" supports.
1 0.000003 function! s:UpdateCapabilities(conn, capabilities) abort
if type(a:capabilities) isnot v:t_dict
return
endif
if get(a:capabilities, 'hoverProvider') is v:true
let a:conn.capabilities.hover = 1
endif
if get(a:capabilities, 'referencesProvider') is v:true
let a:conn.capabilities.references = 1
endif
if !empty(get(a:capabilities, 'completionProvider'))
let a:conn.capabilities.completion = 1
endif
if type(get(a:capabilities, 'completionProvider')) is v:t_dict
let l:chars = get(a:capabilities.completionProvider, 'triggerCharacters')
if type(l:chars) is v:t_list
let a:conn.capabilities.completion_trigger_characters = l:chars
endif
endif
if get(a:capabilities, 'definitionProvider') is v:true
let a:conn.capabilities.definition = 1
endif
endfunction
1 0.000003 function! ale#lsp#HandleInitResponse(conn, response) abort
if get(a:response, 'method', '') is# 'initialize'
let a:conn.initialized = 1
elseif type(get(a:response, 'result')) is v:t_dict
\&& has_key(a:response.result, 'capabilities')
call s:UpdateCapabilities(a:conn, a:response.result.capabilities)
let a:conn.initialized = 1
endif
if !a:conn.initialized
return
endif
" After the server starts, send messages we had queued previously.
for l:message_data in a:conn.message_queue
call s:SendMessageData(a:conn, l:message_data)
endfor
" Remove the messages now.
let a:conn.message_queue = []
" Call capabilities callbacks queued for the project.
for [l:capability, l:Callback] in a:conn.capabilities_queue
if a:conn.capabilities[l:capability]
call call(l:Callback, [a:conn.id])
endif
endfor
let a:conn.capabilities_queue = []
endfunction
1 0.000003 function! ale#lsp#HandleMessage(conn_id, message) abort
let l:conn = get(s:connections, a:conn_id, {})
if empty(l:conn)
return
endif
if type(a:message) isnot v:t_string
" Ignore messages that aren't strings.
return
endif
let l:conn.data .= a:message
" Parse the objects now if we can, and keep the remaining text.
let [l:conn.data, l:response_list] = ale#lsp#ReadMessageData(l:conn.data)
" Look for initialize responses first.
if !l:conn.initialized
for l:response in l:response_list
call ale#lsp#HandleInitResponse(l:conn, l:response)
endfor
endif
" If the connection is marked as initialized, call the callbacks with the
" responses.
if l:conn.initialized
for l:response in l:response_list
" Call all of the registered handlers with the response.
for l:Callback in l:conn.callback_list
call ale#util#GetFunction(l:Callback)(a:conn_id, l:response)
endfor
endfor
endif
endfunction
" Given a connection ID, mark it as a tsserver connection, so it will be
" handled that way.
1 0.000003 function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
let l:conn = s:connections[a:conn_id]
let l:conn.is_tsserver = 1
let l:conn.initialized = 1
" Set capabilities which are supported by tsserver.
let l:conn.capabilities.hover = 1
let l:conn.capabilities.references = 1
let l:conn.capabilities.completion = 1
let l:conn.capabilities.completion_trigger_characters = ['.']
let l:conn.capabilities.definition = 1
endfunction
" Start a program for LSP servers.
"
" 1 will be returned if the program is running, or 0 if the program could
" not be started.
1 0.000003 function! ale#lsp#StartProgram(conn_id, executable, command) abort
let l:conn = s:connections[a:conn_id]
if !has_key(l:conn, 'job_id') || !ale#job#IsRunning(l:conn.job_id)
let l:options = {
\ 'mode': 'raw',
\ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)},
\}
let l:job_id = ale#job#Start(a:command, l:options)
else
let l:job_id = l:conn.job_id
endif
if l:job_id > 0
let l:conn.job_id = l:job_id
endif
return l:job_id > 0
endfunction
" Connect to an LSP server via TCP.
"
" 1 will be returned if the connection is running, or 0 if the connection could
" not be opened.
1 0.000005 function! ale#lsp#ConnectToAddress(conn_id, address) abort
let l:conn = s:connections[a:conn_id]
if !has_key(l:conn, 'channel_id') || !ale#socket#IsOpen(l:conn.channel_id)
let l:channel_id = ale#socket#Open(a:address, {
\ 'callback': {_, mess -> ale#lsp#HandleMessage(a:conn_id, mess)},
\})
else
let l:channel_id = l:conn.channel_id
endif
if l:channel_id >= 0
let l:conn.channel_id = l:channel_id
endif
return l:channel_id >= 0
endfunction
" Given a connection ID and a callback, register that callback for handling
" messages if the connection exists.
1 0.000003 function! ale#lsp#RegisterCallback(conn_id, callback) abort
let l:conn = get(s:connections, a:conn_id, {})
if !empty(l:conn)
" Add the callback to the List if it's not there already.
call uniq(sort(add(l:conn.callback_list, a:callback)))
endif
endfunction
" Stop a single LSP connection.
1 0.000003 function! ale#lsp#Stop(conn_id) abort
if has_key(s:connections, a:conn_id)
let l:conn = remove(s:connections, a:conn_id)
if has_key(l:conn, 'channel_id')
call ale#socket#Close(l:conn.channel_id)
elseif has_key(l:conn, 'job_id')
call ale#job#Stop(l:conn.job_id)
endif
endif
endfunction
1 0.000002 function! ale#lsp#CloseDocument(conn_id) abort
endfunction
" Stop all LSP connections, closing all jobs and channels, and removing any
" queued messages.
1 0.000002 function! ale#lsp#StopAll() abort
for l:conn_id in keys(s:connections)
call ale#lsp#Stop(l:conn_id)
endfor
endfunction
1 0.000002 function! s:SendMessageData(conn, data) abort
if has_key(a:conn, 'job_id')
call ale#job#SendRaw(a:conn.job_id, a:data)
elseif has_key(a:conn, 'channel_id') && ale#socket#IsOpen(a:conn.channel_id)
" Send the message to the server
call ale#socket#Send(a:conn.channel_id, a:data)
else
return 0
endif
return 1
endfunction
" Send a message to an LSP server.
" Notifications do not need to be handled.
"
" Returns -1 when a message is sent, but no response is expected
" 0 when the message is not sent and
" >= 1 with the message ID when a response is expected.
1 0.000002 function! ale#lsp#Send(conn_id, message) abort
let l:conn = get(s:connections, a:conn_id, {})
if empty(l:conn)
return 0
endif
" If we haven't initialized the server yet, then send the message for it.
if !l:conn.initialized && !l:conn.init_request_id
let [l:init_id, l:init_data] = ale#lsp#CreateMessageData(
\ ale#lsp#message#Initialize(l:conn.root, l:conn.init_options),
\)
let l:conn.init_request_id = l:init_id
call s:SendMessageData(l:conn, l:init_data)
endif
let [l:id, l:data] = ale#lsp#CreateMessageData(a:message)
if l:conn.initialized
" Send the message now.
call s:SendMessageData(l:conn, l:data)
else
" Add the message we wanted to send to a List to send later.
call add(l:conn.message_queue, l:data)
endif
return l:id == 0 ? -1 : l:id
endfunction
" Notify LSP servers or tsserver if a document is opened, if needed.
" If a document is opened, 1 will be returned, otherwise 0 will be returned.
1 0.000003 function! ale#lsp#OpenDocument(conn_id, buffer, language_id) abort
let l:conn = get(s:connections, a:conn_id, {})
let l:opened = 0
if !empty(l:conn) && !has_key(l:conn.open_documents, a:buffer)
if l:conn.is_tsserver
let l:message = ale#lsp#tsserver_message#Open(a:buffer)
else
let l:message = ale#lsp#message#DidOpen(a:buffer, a:language_id)
endif
call ale#lsp#Send(a:conn_id, l:message)
let l:conn.open_documents[a:buffer] = getbufvar(a:buffer, 'changedtick')
let l:opened = 1
endif
return l:opened
endfunction
" Notify LSP servers or tsserver that a document has changed, if needed.
" If a notification is sent, 1 will be returned, otherwise 0 will be returned.
1 0.000002 function! ale#lsp#NotifyForChanges(conn_id, buffer) abort
let l:conn = get(s:connections, a:conn_id, {})
let l:notified = 0
if !empty(l:conn) && has_key(l:conn.open_documents, a:buffer)
let l:new_tick = getbufvar(a:buffer, 'changedtick')
if l:conn.open_documents[a:buffer] < l:new_tick
if l:conn.is_tsserver
let l:message = ale#lsp#tsserver_message#Change(a:buffer)
else
let l:message = ale#lsp#message#DidChange(a:buffer)
endif
call ale#lsp#Send(a:conn_id, l:message)
let l:conn.open_documents[a:buffer] = l:new_tick
let l:notified = 1
endif
endif
return l:notified
endfunction
" Given some LSP details that must contain at least `connection_id` and
" `project_root` keys,
1 0.000003 function! ale#lsp#WaitForCapability(conn_id, capability, callback) abort
let l:conn = get(s:connections, a:conn_id, {})
if empty(l:conn)
return
endif
if type(get(l:conn.capabilities, a:capability, v:null)) isnot v:t_number
throw 'Invalid capability ' . a:capability
endif
if l:conn.initialized
if l:conn.capabilities[a:capability]
" The project has been initialized, so call the callback now.
call call(a:callback, [a:conn_id])
endif
else
" Call the callback later, once we have the information we need.
call add(l:conn.capabilities_queue, [a:capability, a:callback])
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/command.vim
Sourced 1 time
Total time: 0.000488
Self time: 0.000488
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Special command formatting for creating temporary files and
" passing buffer filenames easily.
1 0.000012 function! s:TemporaryFilename(buffer) abort
let l:filename = fnamemodify(bufname(a:buffer), ':t')
if empty(l:filename)
" If the buffer's filename is empty, create a dummy filename.
let l:ft = getbufvar(a:buffer, '&filetype')
let l:filename = 'file' . ale#filetypes#GuessExtension(l:ft)
endif
" Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function.
return ale#util#Tempname() . (has('win32') ? '\' : '/') . l:filename
endfunction
" Given a command string, replace every...
" %s -> with the current filename
" %t -> with the name of an unused file in a temporary directory
" %% -> with a literal %
1 0.000009 function! ale#command#FormatCommand(buffer, executable, command, pipe_file_if_needed) abort
let l:temporary_file = ''
let l:command = a:command
" First replace all uses of %%, used for literal percent characters,
" with an ugly string.
let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g')
" Replace %e with the escaped executable, if available.
if !empty(a:executable) && l:command =~# '%e'
let l:command = substitute(l:command, '%e', '\=ale#Escape(a:executable)', 'g')
endif
" Replace all %s occurrences in the string with the name of the current
" file.
if l:command =~# '%s'
let l:filename = fnamemodify(bufname(a:buffer), ':p')
let l:command = substitute(l:command, '%s', '\=ale#Escape(l:filename)', 'g')
endif
if l:command =~# '%t'
" Create a temporary filename, <temp_dir>/<original_basename>
" The file itself will not be created by this function.
let l:temporary_file = s:TemporaryFilename(a:buffer)
let l:command = substitute(l:command, '%t', '\=ale#Escape(l:temporary_file)', 'g')
endif
" Finish formatting so %% becomes %.
let l:command = substitute(l:command, '<<PERCENTS>>', '%', 'g')
if a:pipe_file_if_needed && empty(l:temporary_file)
" If we are to send the Vim buffer to a command, we'll do it
" in the shell. We'll write out the file to a temporary file,
" and then read it back in, in the shell.
let l:temporary_file = s:TemporaryFilename(a:buffer)
let l:command = l:command . ' < ' . ale#Escape(l:temporary_file)
endif
return [l:temporary_file, l:command]
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/job.vim
Sourced 1 time
Total time: 0.000805
Self time: 0.000805
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: APIs for working with Asynchronous jobs, with an API normalised
" between Vim 8 and NeoVim.
"
" Important functions are described below. They are:
"
" ale#job#Start(command, options) -> job_id
" ale#job#IsRunning(job_id) -> 1 if running, 0 otherwise.
" ale#job#Stop(job_id)
" A setting for wrapping commands.
1 0.000018 let g:ale_command_wrapper = get(g:, 'ale_command_wrapper', '')
1 0.000005 if !has_key(s:, 'job_map')
1 0.000003 let s:job_map = {}
1 0.000002 endif
" A map from timer IDs to jobs, for tracking jobs that need to be killed
" with SIGKILL if they don't terminate right away.
1 0.000003 if !has_key(s:, 'job_kill_timers')
1 0.000003 let s:job_kill_timers = {}
1 0.000001 endif
1 0.000007 function! s:KillHandler(timer) abort
let l:job = remove(s:job_kill_timers, a:timer)
call job_stop(l:job, 'kill')
endfunction
1 0.000004 function! s:NeoVimCallback(job, data, event) abort
let l:info = s:job_map[a:job]
if a:event is# 'stdout'
let l:info.out_cb_line = ale#util#JoinNeovimOutput(
\ a:job,
\ l:info.out_cb_line,
\ a:data,
\ l:info.mode,
\ ale#util#GetFunction(l:info.out_cb),
\)
elseif a:event is# 'stderr'
let l:info.err_cb_line = ale#util#JoinNeovimOutput(
\ a:job,
\ l:info.err_cb_line,
\ a:data,
\ l:info.mode,
\ ale#util#GetFunction(l:info.err_cb),
\)
else
if has_key(l:info, 'out_cb') && !empty(l:info.out_cb_line)
call ale#util#GetFunction(l:info.out_cb)(a:job, l:info.out_cb_line)
endif
if has_key(l:info, 'err_cb') && !empty(l:info.err_cb_line)
call ale#util#GetFunction(l:info.err_cb)(a:job, l:info.err_cb_line)
endif
try
call ale#util#GetFunction(l:info.exit_cb)(a:job, a:data)
finally
" Automatically forget about the job after it's done.
if has_key(s:job_map, a:job)
call remove(s:job_map, a:job)
endif
endtry
endif
endfunction
1 0.000003 function! s:VimOutputCallback(channel, data) abort
let l:job = ch_getjob(a:channel)
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job))
" Only call the callbacks for jobs which are valid.
if l:job_id > 0 && has_key(s:job_map, l:job_id)
call ale#util#GetFunction(s:job_map[l:job_id].out_cb)(l:job_id, a:data)
endif
endfunction
1 0.000002 function! s:VimErrorCallback(channel, data) abort
let l:job = ch_getjob(a:channel)
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job))
" Only call the callbacks for jobs which are valid.
if l:job_id > 0 && has_key(s:job_map, l:job_id)
call ale#util#GetFunction(s:job_map[l:job_id].err_cb)(l:job_id, a:data)
endif
endfunction
1 0.000002 function! s:VimCloseCallback(channel) abort
let l:job = ch_getjob(a:channel)
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job))
let l:info = get(s:job_map, l:job_id, {})
if empty(l:info)
return
endif
" job_status() can trigger the exit handler.
" The channel can close before the job has exited.
if job_status(l:job) is# 'dead'
try
if !empty(l:info) && has_key(l:info, 'exit_cb')
call ale#util#GetFunction(l:info.exit_cb)(l:job_id, get(l:info, 'exit_code', 1))
endif
finally
" Automatically forget about the job after it's done.
if has_key(s:job_map, l:job_id)
call remove(s:job_map, l:job_id)
endif
endtry
endif
endfunction
1 0.000003 function! s:VimExitCallback(job, exit_code) abort
let l:job_id = ale#job#ParseVim8ProcessID(string(a:job))
let l:info = get(s:job_map, l:job_id, {})
if empty(l:info)
return
endif
let l:info.exit_code = a:exit_code
" The program can exit before the data has finished being read.
if ch_status(job_getchannel(a:job)) is# 'closed'
try
if !empty(l:info) && has_key(l:info, 'exit_cb')
call ale#util#GetFunction(l:info.exit_cb)(l:job_id, a:exit_code)
endif
finally
" Automatically forget about the job after it's done.
if has_key(s:job_map, l:job_id)
call remove(s:job_map, l:job_id)
endif
endtry
endif
endfunction
1 0.000007 function! ale#job#ParseVim8ProcessID(job_string) abort
return matchstr(a:job_string, '\d\+') + 0
endfunction
1 0.000004 function! ale#job#ValidateArguments(command, options) abort
if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw'
throw 'Invalid mode: ' . a:options.mode
endif
endfunction
1 0.000003 function! s:PrepareWrappedCommand(original_wrapper, command) abort
let l:match = matchlist(a:command, '\v^(.*(\&\&|;)) *(.*)$')
let l:prefix = ''
let l:command = a:command
if !empty(l:match)
let l:prefix = l:match[1] . ' '
let l:command = l:match[3]
endif
let l:format = a:original_wrapper
if l:format =~# '%@'
let l:wrapped = substitute(l:format, '%@', ale#Escape(l:command), '')
else
if l:format !~# '%\*'
let l:format .= ' %*'
endif
let l:wrapped = substitute(l:format, '%\*', l:command, '')
endif
return l:prefix . l:wrapped
endfunction
1 0.000005 function! ale#job#PrepareCommand(buffer, command) abort
let l:wrapper = ale#Var(a:buffer, 'command_wrapper')
let l:command = !empty(l:wrapper)
\ ? s:PrepareWrappedCommand(l:wrapper, a:command)
\ : a:command
" The command will be executed in a subshell. This fixes a number of
" issues, including reading the PATH variables correctly, %PATHEXT%
" expansion on Windows, etc.
"
" NeoVim handles this issue automatically if the command is a String,
" but we'll do this explicitly, so we use the same exact command for both
" versions.
if has('win32')
return 'cmd /s/c "' . l:command . '"'
endif
if &shell =~? 'fish$\|pwsh$'
return ['/bin/sh', '-c', l:command]
endif
return split(&shell) + split(&shellcmdflag) + [l:command]
endfunction
" Start a job with options which are agnostic to Vim and NeoVim.
"
" The following options are accepted:
"
" out_cb - A callback for receiving stdin. Arguments: (job_id, data)
" err_cb - A callback for receiving stderr. Arguments: (job_id, data)
" exit_cb - A callback for program exit. Arguments: (job_id, status_code)
" mode - A mode for I/O. Can be 'nl' for split lines or 'raw'.
1 0.000004 function! ale#job#Start(command, options) abort
call ale#job#ValidateArguments(a:command, a:options)
let l:job_info = copy(a:options)
let l:job_options = {}
if has('nvim')
if has_key(a:options, 'out_cb')
let l:job_options.on_stdout = function('s:NeoVimCallback')
let l:job_info.out_cb_line = ''
endif
if has_key(a:options, 'err_cb')
let l:job_options.on_stderr = function('s:NeoVimCallback')
let l:job_info.err_cb_line = ''
endif
if has_key(a:options, 'exit_cb')
let l:job_options.on_exit = function('s:NeoVimCallback')
endif
let l:job_info.job = jobstart(a:command, l:job_options)
let l:job_id = l:job_info.job
else
let l:job_options = {
\ 'in_mode': l:job_info.mode,
\ 'out_mode': l:job_info.mode,
\ 'err_mode': l:job_info.mode,
\}
if has_key(a:options, 'out_cb')
let l:job_options.out_cb = function('s:VimOutputCallback')
endif
if has_key(a:options, 'err_cb')
let l:job_options.err_cb = function('s:VimErrorCallback')
endif
if has_key(a:options, 'exit_cb')
" Set a close callback to which simply calls job_status()
" when the channel is closed, which can trigger the exit callback
" earlier on.
let l:job_options.close_cb = function('s:VimCloseCallback')
let l:job_options.exit_cb = function('s:VimExitCallback')
endif
" Vim 8 will read the stdin from the file's buffer.
let l:job_info.job = job_start(a:command, l:job_options)
let l:job_id = ale#job#ParseVim8ProcessID(string(l:job_info.job))
endif
if l:job_id > 0
" Store the job in the map for later only if we can get the ID.
let s:job_map[l:job_id] = l:job_info
endif
return l:job_id
endfunction
" Send raw data to the job.
1 0.000005 function! ale#job#SendRaw(job_id, string) abort
if has('nvim')
call jobsend(a:job_id, a:string)
else
call ch_sendraw(job_getchannel(s:job_map[a:job_id].job), a:string)
endif
endfunction
" Given a job ID, return 1 if the job is currently running.
" Invalid job IDs will be ignored.
1 0.000003 function! ale#job#IsRunning(job_id) abort
if has('nvim')
try
" In NeoVim, if the job isn't running, jobpid() will throw.
call jobpid(a:job_id)
return 1
catch
endtry
elseif has_key(s:job_map, a:job_id)
let l:job = s:job_map[a:job_id].job
return job_status(l:job) is# 'run'
endif
return 0
endfunction
" Given a Job ID, stop that job.
" Invalid job IDs will be ignored.
1 0.000003 function! ale#job#Stop(job_id) abort
if !has_key(s:job_map, a:job_id)
return
endif
if has('nvim')
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes
" which are child processes on Unix. Some work needs to be done to
" kill child processes to stop long-running processes like pylint.
silent! call jobstop(a:job_id)
else
let l:job = s:job_map[a:job_id].job
" We must close the channel for reading the buffer if it is open
" when stopping a job. Otherwise, we will get errors in the status line.
if ch_status(job_getchannel(l:job)) is# 'open'
call ch_close_in(job_getchannel(l:job))
endif
" Ask nicely for the job to stop.
call job_stop(l:job)
if ale#job#IsRunning(l:job)
" Set a 100ms delay for killing the job with SIGKILL.
let s:job_kill_timers[timer_start(100, function('s:KillHandler'))] = l:job
endif
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/lsp/message.vim
Sourced 1 time
Total time: 0.000403
Self time: 0.000403
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Language Server Protocol message implementations
"
" Messages in this movie will be returned in the format
" [is_notification, method_name, params?]
1 0.000012 let g:ale_lsp_next_version_id = 1
" The LSP protocols demands that we send every change to a document, including
" undo, with incrementing version numbers, so we'll just use one incrementing
" ID for everything.
1 0.000009 function! ale#lsp#message#GetNextVersionID() abort
" Use the current ID
let l:id = g:ale_lsp_next_version_id
" Increment the ID variable.
let g:ale_lsp_next_version_id += 1
" When the ID overflows, reset it to 1. By the time we hit the initial ID
" again, the messages will be long gone.
if g:ale_lsp_next_version_id < 1
let g:ale_lsp_next_version_id = 1
endif
return l:id
endfunction
1 0.000006 function! ale#lsp#message#Initialize(root_path, initialization_options) abort
" TODO: Define needed capabilities.
" NOTE: rootPath is deprecated in favour of rootUri
return [0, 'initialize', {
\ 'processId': getpid(),
\ 'rootPath': a:root_path,
\ 'capabilities': {},
\ 'initializationOptions': a:initialization_options,
\ 'rootUri': ale#path#ToURI(a:root_path),
\}]
endfunction
1 0.000003 function! ale#lsp#message#Initialized() abort
return [1, 'initialized']
endfunction
1 0.000002 function! ale#lsp#message#Shutdown() abort
return [0, 'shutdown']
endfunction
1 0.000002 function! ale#lsp#message#Exit() abort
return [1, 'exit']
endfunction
1 0.000002 function! ale#lsp#message#DidOpen(buffer, language_id) abort
let l:lines = getbufline(a:buffer, 1, '$')
return [1, 'textDocument/didOpen', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(),
\ 'text': join(l:lines, "\n") . "\n",
\ },
\}]
endfunction
1 0.000004 function! ale#lsp#message#DidChange(buffer) abort
let l:lines = getbufline(a:buffer, 1, '$')
" For changes, we simply send the full text of the document to the server.
return [1, 'textDocument/didChange', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(),
\ },
\ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
\}]
endfunction
1 0.000002 function! ale#lsp#message#DidSave(buffer) abort
return [1, 'textDocument/didSave', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\}]
endfunction
1 0.000002 function! ale#lsp#message#DidClose(buffer) abort
return [1, 'textDocument/didClose', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\}]
endfunction
1 0.000003 let s:COMPLETION_TRIGGER_INVOKED = 1
1 0.000002 let s:COMPLETION_TRIGGER_CHARACTER = 2
1 0.000005 function! ale#lsp#message#Completion(buffer, line, column, trigger_character) abort
let l:message = [0, 'textDocument/completion', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column},
\}]
if !empty(a:trigger_character)
let l:message[2].context = {
\ 'triggerKind': s:COMPLETION_TRIGGER_CHARACTER,
\ 'triggerCharacter': a:trigger_character,
\}
endif
return l:message
endfunction
1 0.000002 function! ale#lsp#message#Definition(buffer, line, column) abort
return [0, 'textDocument/definition', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column},
\}]
endfunction
1 0.000003 function! ale#lsp#message#References(buffer, line, column) abort
return [0, 'textDocument/references', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column},
\ 'context': {'includeDeclaration': v:false},
\}]
endfunction
1 0.000002 function! ale#lsp#message#Hover(buffer, line, column) abort
return [0, 'textDocument/hover', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column},
\}]
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/uri.vim
Sourced 1 time
Total time: 0.000227
Self time: 0.000227
count total (s) self (s)
" This probably doesn't handle Unicode characters well.
1 0.000006 function! ale#uri#Encode(value) abort
return substitute(
\ a:value,
\ '\([^a-zA-Z0-9\\/$\-_.!*''(),]\)',
\ '\=printf(''%%%02x'', char2nr(submatch(1)))',
\ 'g'
\)
endfunction
1 0.000004 function! ale#uri#Decode(value) abort
return substitute(
\ a:value,
\ '%\(\x\x\)',
\ '\=nr2char(''0x'' . submatch(1))',
\ 'g'
\)
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/history.vim
Sourced 1 time
Total time: 0.000240
Self time: 0.000240
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Tools for managing command history
" A flag for controlling the maximum size of the command history to store.
1 0.000008 let g:ale_max_buffer_history_size = get(g:, 'ale_max_buffer_history_size', 20)
" Return a shallow copy of the command history for a given buffer number.
1 0.000005 function! ale#history#Get(buffer) abort
return copy(getbufvar(a:buffer, 'ale_history', []))
endfunction
1 0.000004 function! ale#history#Add(buffer, status, job_id, command) abort
if g:ale_max_buffer_history_size <= 0
" Don't save anything if the history isn't a positive number.
call setbufvar(a:buffer, 'ale_history', [])
return
endif
let l:history = getbufvar(a:buffer, 'ale_history', [])
" Remove the first item if we hit the max history size.
if len(l:history) >= g:ale_max_buffer_history_size
let l:history = l:history[1:]
endif
call add(l:history, {
\ 'status': a:status,
\ 'job_id': a:job_id,
\ 'command': a:command,
\})
call setbufvar(a:buffer, 'ale_history', l:history)
endfunction
1 0.000005 function! s:FindHistoryItem(buffer, job_id) abort
" Search backwards to find a matching job ID. IDs might be recycled,
" so finding the last one should be good enough.
for l:obj in reverse(ale#history#Get(a:buffer))
if l:obj.job_id == a:job_id
return l:obj
endif
endfor
return {}
endfunction
" Set an exit code for a command which finished.
1 0.000003 function! ale#history#SetExitCode(buffer, job_id, exit_code) abort
let l:obj = s:FindHistoryItem(a:buffer, a:job_id)
" If we find a match, then set the code and status.
let l:obj.exit_code = a:exit_code
let l:obj.status = 'finished'
endfunction
" Set the output for a command which finished.
1 0.000002 function! ale#history#RememberOutput(buffer, job_id, output) abort
let l:obj = s:FindHistoryItem(a:buffer, a:job_id)
let l:obj.output = a:output
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/vim-airline/autoload/airline/async.vim
Sourced 1 time
Total time: 0.000707
Self time: 0.000707
count total (s) self (s)
" MIT License. Copyright (c) 2013-2018 C.Brabandt et al.
" vim: et ts=2 sts=2 sw=2
1 0.000006 scriptencoding utf-8
1 0.000007 let s:untracked_jobs = {}
1 0.000002 let s:mq_jobs = {}
1 0.000002 let s:po_jobs = {}
" Generic functions handling on exit event of the various async functions
1 0.000005 function! s:untracked_output(dict, buf)
if a:buf =~? ('^'. a:dict.cfg['untracked_mark'])
let a:dict.cfg.untracked[a:dict.file] = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
else
let a:dict.cfg.untracked[a:dict.file] = ''
endif
endfunction
" also called from branch extension (for non-async vims)
1 0.000007 function! airline#async#mq_output(buf, file)
let buf=a:buf
if !empty(a:buf)
if a:buf =~# 'no patches applied' ||
\ a:buf =~# "unknown command 'qtop'" ||
\ a:buf =~# "abort"
let buf = ''
elseif exists("b:mq") && b:mq isnot# buf
" make sure, statusline is updated
unlet! b:airline_head
endif
let b:mq = buf
endif
if has_key(s:mq_jobs, a:file)
call remove(s:mq_jobs, a:file)
endif
endfunction
1 0.000003 function! s:po_output(buf, file)
if !empty(a:buf)
let b:airline_po_stats = printf("[%s]", a:buf)
else
let b:airline_po_stats = ''
endif
if has_key(s:po_jobs, a:file)
call remove(s:po_jobs, a:file)
endif
endfunction
1 0.000002 function! s:valid_dir(dir)
if empty(a:dir) || !isdirectory(a:dir)
return getcwd()
endif
return a:dir
endfunction
1 0.000010 if v:version >= 800 && has("job")
" Vim 8.0 with Job feature
" TODO: Check if we need the cwd option for the job_start() functions
" (only works starting with Vim 8.0.0902)
function! s:on_stdout(channel, msg) dict abort
let self.buf .= a:msg
endfunction
function! s:on_exit_mq(channel) dict abort
call airline#async#mq_output(self.buf, self.file)
endfunction
function! s:on_exit_untracked(channel) dict abort
call s:untracked_output(self, self.buf)
if has_key(s:untracked_jobs, self.file)
call remove(s:untracked_jobs, self.file)
endif
endfunction
function! s:on_exit_po(channel) dict abort
call s:po_output(self.buf, self.file)
call airline#extensions#po#shorten()
endfunction
function! airline#async#get_mq_async(cmd, file)
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
endif
let options = {'cmd': a:cmd, 'buf': '', 'file': a:file}
if has_key(s:mq_jobs, a:file)
if job_status(get(s:mq_jobs, a:file)) == 'run'
return
elseif has_key(s:mq_jobs, a:file)
call remove(s:mq_jobs, a:file)
endif
endif
let id = job_start(cmd, {
\ 'err_io': 'out',
\ 'out_cb': function('s:on_stdout', options),
\ 'close_cb': function('s:on_exit_mq', options)})
let s:mq_jobs[a:file] = id
endfunction
function! airline#async#get_msgfmt_stat(cmd, file)
if g:airline#init#is_windows || !executable('msgfmt')
" no msgfmt on windows?
return
else
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
endif
let options = {'buf': '', 'file': a:file}
if has_key(s:po_jobs, a:file)
if job_status(get(s:po_jobs, a:file)) == 'run'
return
elseif has_key(s:po_jobs, a:file)
call remove(s:po_jobs, a:file)
endif
endif
let id = job_start(cmd, {
\ 'err_io': 'out',
\ 'out_cb': function('s:on_stdout', options),
\ 'close_cb': function('s:on_exit_po', options)})
let s:po_jobs[a:file] = id
endfunction
function! airline#async#vim_vcs_untracked(config, file)
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:config['cmd'] . shellescape(a:file)
else
let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)]
endif
let options = {'cfg': a:config, 'buf': '', 'file': a:file}
if has_key(s:untracked_jobs, a:file)
if job_status(get(s:untracked_jobs, a:file)) == 'run'
return
elseif has_key(s:untracked_jobs, a:file)
call remove(s:untracked_jobs, a:file)
endif
endif
let id = job_start(cmd, {
\ 'err_io': 'out',
\ 'out_cb': function('s:on_stdout', options),
\ 'close_cb': function('s:on_exit_untracked', options)})
let s:untracked_jobs[a:file] = id
endfunction
elseif has("nvim")
" NVim specific functions
1 0.000005 function! s:nvim_output_handler(job_id, data, event) dict
if a:event == 'stdout' || a:event == 'stderr'
let self.buf .= join(a:data)
endif
endfunction
1 0.000002 function! s:nvim_untracked_job_handler(job_id, data, event) dict
if a:event == 'exit'
call s:untracked_output(self, self.buf)
if has_key(s:untracked_jobs, self.file)
call remove(s:untracked_jobs, self.file)
endif
endif
endfunction
1 0.000002 function! s:nvim_mq_job_handler(job_id, data, event) dict
if a:event == 'exit'
call airline#async#mq_output(self.buf, self.file)
endif
endfunction
1 0.000002 function! s:nvim_po_job_handler(job_id, data, event) dict
if a:event == 'exit'
call s:po_output(self.buf, self.file)
call airline#extensions#po#shorten()
endif
endfunction
1 0.000004 function! airline#async#nvim_get_mq_async(cmd, file)
let config = {
\ 'buf': '',
\ 'file': a:file,
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')),
\ 'on_stdout': function('s:nvim_output_handler'),
\ 'on_stderr': function('s:nvim_output_handler'),
\ 'on_exit': function('s:nvim_mq_job_handler')
\ }
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:cmd
else
let cmd = ['sh', '-c', a:cmd]
endif
if has_key(s:mq_jobs, a:file)
call remove(s:mq_jobs, a:file)
endif
let id = jobstart(cmd, config)
let s:mq_jobs[a:file] = id
endfunction
1 0.000004 function! airline#async#nvim_get_msgfmt_stat(cmd, file)
let config = {
\ 'buf': '',
\ 'file': a:file,
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h')),
\ 'on_stdout': function('s:nvim_output_handler'),
\ 'on_stderr': function('s:nvim_output_handler'),
\ 'on_exit': function('s:nvim_po_job_handler')
\ }
if g:airline#init#is_windows && &shell =~ 'cmd'
" no msgfmt on windows?
return
else
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
endif
if has_key(s:po_jobs, a:file)
call remove(s:po_jobs, a:file)
endif
let id = jobstart(cmd, config)
let s:po_jobs[a:file] = id
endfunction
1 0.000002 endif
" Should work in either Vim pre 8 or Nvim
1 0.000004 function! airline#async#nvim_vcs_untracked(cfg, file, vcs)
let cmd = a:cfg.cmd . shellescape(a:file)
let id = -1
let config = {
\ 'buf': '',
\ 'vcs': a:vcs,
\ 'cfg': a:cfg,
\ 'file': a:file,
\ 'cwd': s:valid_dir(fnamemodify(a:file, ':p:h'))
\ }
if has("nvim")
call extend(config, {
\ 'on_stdout': function('s:nvim_output_handler'),
\ 'on_exit': function('s:nvim_untracked_job_handler')})
if has_key(s:untracked_jobs, config.file)
" still running
return
endif
try
let id = jobstart(cmd, config)
catch
" catch-all, jobstart() failed, fall back to system()
let id=-1
endtry
let s:untracked_jobs[a:file] = id
endif
" vim without job feature or nvim jobstart failed
if id < 1
let output=system(cmd)
call s:untracked_output(config, output)
call airline#extensions#branch#update_untracked_config(a:file, a:vcs)
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/cursor.vim
Sourced 1 time
Total time: 0.000439
Self time: 0.000439
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Echoes lint message for the current line, if any
" Controls the milliseconds delay before echoing a message.
1 0.000011 let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10)
" A string format for the echoed message.
1 0.000004 let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%code: %%s')
1 0.000002 let s:cursor_timer = -1
1 0.000003 let s:last_pos = [0, 0, 0]
1 0.000006 function! ale#cursor#TruncatedEcho(original_message) abort
let l:message = a:original_message
" Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message.
let l:message = substitute(l:message, "\n", '', 'g')
" We need to remember the setting for shortmess and reset it again.
let l:shortmess_options = &l:shortmess
try
let l:cursor_position = getcurpos()
" The message is truncated and saved to the history.
setlocal shortmess+=T
exec "norm! :echomsg l:message\n"
" Reset the cursor position if we moved off the end of the line.
" Using :norm and :echomsg can move the cursor off the end of the
" line.
if l:cursor_position != getcurpos()
call setpos('.', l:cursor_position)
endif
finally
let &l:shortmess = l:shortmess_options
endtry
endfunction
1 0.000003 function! s:FindItemAtCursor() abort
let l:buf = bufnr('')
let l:info = get(g:ale_buffer_info, l:buf, {})
let l:loclist = get(l:info, 'loclist', [])
let l:pos = getcurpos()
let l:index = ale#util#BinarySearch(l:loclist, l:buf, l:pos[1], l:pos[2])
let l:loc = l:index >= 0 ? l:loclist[l:index] : {}
return [l:info, l:loc]
endfunction
1 0.000002 function! s:StopCursorTimer() abort
if s:cursor_timer != -1
call timer_stop(s:cursor_timer)
let s:cursor_timer = -1
endif
endfunction
1 0.000003 function! ale#cursor#EchoCursorWarning(...) abort
if !g:ale_echo_cursor
return
endif
" Only echo the warnings in normal mode, otherwise we will get problems.
if mode() isnot# 'n'
return
endif
if ale#ShouldDoNothing(bufnr(''))
return
endif
let l:buffer = bufnr('')
let [l:info, l:loc] = s:FindItemAtCursor()
if !empty(l:loc)
let l:format = ale#Var(l:buffer, 'echo_msg_format')
let l:msg = ale#GetLocItemMessage(l:loc, l:format)
call ale#cursor#TruncatedEcho(l:msg)
let l:info.echoed = 1
elseif get(l:info, 'echoed')
" We'll only clear the echoed message when moving off errors once,
" so we don't continually clear the echo line.
execute 'echo'
let l:info.echoed = 0
endif
endfunction
1 0.000003 function! ale#cursor#EchoCursorWarningWithDelay() abort
if !g:ale_echo_cursor
return
endif
" Only echo the warnings in normal mode, otherwise we will get problems.
if mode() isnot# 'n'
return
endif
call s:StopCursorTimer()
let l:pos = getcurpos()[0:2]
" Check the current buffer, line, and column number against the last
" recorded position. If the position has actually changed, *then*
" we should echo something. Otherwise we can end up doing processing
" the echo message far too frequently.
if l:pos != s:last_pos
let l:delay = ale#Var(bufnr(''), 'echo_delay')
let s:last_pos = l:pos
let s:cursor_timer = timer_start(
\ l:delay,
\ function('ale#cursor#EchoCursorWarning')
\)
endif
endfunction
1 0.000002 function! ale#cursor#ShowCursorDetail() abort
" Only echo the warnings in normal mode, otherwise we will get problems.
if mode() isnot# 'n'
return
endif
if ale#ShouldDoNothing(bufnr(''))
return
endif
call s:StopCursorTimer()
let [l:info, l:loc] = s:FindItemAtCursor()
if !empty(l:loc)
let l:message = get(l:loc, 'detail', l:loc.text)
call ale#preview#Show(split(l:message, "\n"))
execute 'echo'
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/vim-signify/autoload/sy/highlight.vim
Sourced 1 time
Total time: 0.002184
Self time: 0.002035
count total (s) self (s)
" vim: et sw=2 sts=2
1 0.000490 scriptencoding utf-8
" Init: values {{{1
1 0.000011 if get(g:, 'signify_sign_show_text', 1)
1 0.000007 let s:sign_add = get(g:, 'signify_sign_add', '+')
1 0.000005 let s:sign_delete_first_line = get(g:, 'signify_sign_delete_first_line', '‚Äæ')
1 0.000004 let s:sign_change = get(g:, 'signify_sign_change', '!')
1 0.000005 let s:sign_changedelete = get(g:, 'signify_sign_changedelete', s:sign_change)
1 0.000001 else
let s:sign_add = ' '
let s:sign_delete_first_line = ' '
let s:sign_change = ' '
let s:sign_changedelete = ' '
endif
1 0.000004 let s:sign_show_count = get(g:, 'signify_sign_show_count', 1)
" Function: #setup {{{1
1 0.000006 function! sy#highlight#setup() abort
highlight default link SignifyLineAdd DiffAdd
highlight default link SignifyLineDelete DiffDelete
highlight default link SignifyLineDeleteFirstLine SignifyLineDelete
highlight default link SignifyLineChange DiffChange
highlight default link SignifyLineChangeDelete SignifyLineChange
highlight default link SignifySignAdd DiffAdd
highlight default link SignifySignDelete DiffDelete
highlight default link SignifySignDeleteFirstLine SignifySignDelete
highlight default link SignifySignChange DiffChange
highlight default link SignifySignChangeDelete SignifySignChange
endfunction
" Function: #line_enable {{{1
1 0.000006 function! sy#highlight#line_enable() abort
execute 'sign define SignifyAdd text='. s:sign_add 'texthl=SignifySignAdd linehl=SignifyLineAdd'
execute 'sign define SignifyChange text='. s:sign_change 'texthl=SignifySignChange linehl=SignifyLineChange'
execute 'sign define SignifyRemoveFirstLine text='. s:sign_delete_first_line 'texthl=SignifySignDeleteFirstLine linehl=SignifyLineDeleteFirstLine'
if s:sign_show_count
let s:sign_changedelete = substitute(s:sign_changedelete, '^.\zs.*', '', '')
for n in range(1, 9)
execute 'sign define SignifyChangeDelete'. n 'text='. s:sign_changedelete . n 'texthl=SignifySignChangeDelete linehl=SignifyLineChangeDelete'
endfor
execute 'sign define SignifyChangeDeleteMore text='. s:sign_changedelete .'> texthl=SignifySignChangeDelete linehl=SignifyLineChangeDelete'
else
for n in range(1, 9)
execute 'sign define SignifyChangeDelete'. n 'text='. s:sign_changedelete 'texthl=SignifySignChangeDelete linehl=SignifyLineChangeDelete'
endfor
execute 'sign define SignifyChangeDeleteMore text='. s:sign_changedelete 'texthl=SignifySignChangeDelete linehl=SignifyLineChangeDelete'
endif
let g:signify_line_highlight = 1
endfunction
" Function: #line_disable {{{1
1 0.000003 function! sy#highlight#line_disable() abort
execute 'sign define SignifyAdd text='. s:sign_add 'texthl=SignifySignAdd linehl='
execute 'sign define SignifyChange text='. s:sign_change 'texthl=SignifySignChange linehl='
execute 'sign define SignifyRemoveFirstLine text='. s:sign_delete_first_line 'texthl=SignifySignDeleteFirstLine linehl='
if s:sign_show_count
while strwidth(s:sign_changedelete) > 1
let s:sign_changedelete = substitute(s:sign_changedelete, '.', '', '')
endwhile
for n in range(1, 9)
execute 'sign define SignifyChangeDelete'. n 'text='. s:sign_changedelete . n 'texthl=SignifySignChangeDelete linehl='
endfor
execute 'sign define SignifyChangeDeleteMore text='. s:sign_changedelete .'> texthl=SignifySignChangeDelete linehl='
else
for n in range(1, 9)
execute 'sign define SignifyChangeDelete'. n 'text='. s:sign_changedelete 'texthl=SignifySignChangeDelete linehl='
endfor
execute 'sign define SignifyChangeDeleteMore text='. s:sign_changedelete 'texthl=SignifySignChangeDelete linehl='
endif
let g:signify_line_highlight = 0
endfunction
" Function: #line_toggle {{{1
1 0.000003 function! sy#highlight#line_toggle() abort
if get(g:, 'signify_line_highlight')
call sy#highlight#line_disable()
else
call sy#highlight#line_enable()
endif
redraw!
call sy#start()
endfunction
" }}}
1 0.000170 0.000021 call sy#highlight#setup()
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/vim-signify/autoload/sy/sign.vim
Sourced 1 time
Total time: 0.001336
Self time: 0.001336
count total (s) self (s)
" vim: et sw=2 sts=2
1 0.000012 scriptencoding utf-8
" Init: values {{{1
1 0.000011 if get(g:, 'signify_sign_show_text', 1)
1 0.000008 let s:sign_delete = get(g:, 'signify_sign_delete', '_')
1 0.000001 else
let s:sign_delete = ' '
endif
1 0.000004 let s:sign_show_count = get(g:, 'signify_sign_show_count', 1)
1 0.000004 let s:delete_highlight = ['', 'SignifyLineDelete']
" Function: #id_next {{{1
1 0.000007 function! sy#sign#id_next(sy) abort
let id = a:sy.signid
let a:sy.signid += 1
return id
endfunction
" Function: #get_current_signs {{{1
1 0.000004 function! sy#sign#get_current_signs(sy) abort
let a:sy.internal = {}
let a:sy.external = {}
redir => signlist
silent! execute 'sign place buffer='. a:sy.buffer
redir END
for signline in split(signlist, '\n')[2:]
let tokens = matchlist(signline, '\v^\s+\S+\=(\d+)\s+\S+\=(\d+)\s+\S+\=(.*)$')
let line = str2nr(tokens[1])
let id = str2nr(tokens[2])
let type = tokens[3]
if type =~# '^Signify'
" Handle ambiguous signs. Assume you have signs on line 3 and 4.
" Removing line 3 would lead to the second sign to be shifted up
" to line 3. Now there are still 2 signs, both one line 3.
if has_key(a:sy.internal, line)
execute 'sign unplace' a:sy.internal[line].id 'buffer='.a:sy.buffer
endif
let a:sy.internal[line] = { 'type': type, 'id': id }
else
let a:sy.external[line] = id
endif
endfor
endfunction
" Function: #process_diff {{{1
1 0.000004 function! sy#sign#process_diff(sy, vcs, diff) abort
let a:sy.signtable = {}
let a:sy.hunks = []
let [added, modified, deleted] = [0, 0, 0]
call sy#sign#get_current_signs(a:sy)
" Determine where we have to put our signs.
for line in filter(a:diff, 'v:val =~ "^@@ "')
let a:sy.lines = []
let ids = []
let tokens = matchlist(line, '^@@ -\v(\d+),?(\d*) \+(\d+),?(\d*)')
let old_line = str2nr(tokens[1])
let new_line = str2nr(tokens[3])
let old_count = empty(tokens[2]) ? 1 : str2nr(tokens[2])
let new_count = empty(tokens[4]) ? 1 : str2nr(tokens[4])
" 2 lines added:
" @@ -5,0 +6,2 @@ this is line 5
" +this is line 5
" +this is line 5
if (old_count == 0) && (new_count >= 1)
let added += new_count
let offset = 0
while offset < new_count
let line = new_line + offset
let offset += 1
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, 'SignifyAdd'))
endwhile
" 2 lines removed:
" @@ -6,2 +5,0 @@ this is line 5
" -this is line 6
" -this is line 7
elseif (old_count >= 1) && (new_count == 0)
if s:external_sign_present(a:sy, new_line) | continue | endif
let deleted += old_count
if new_line == 0
call add(ids, s:add_sign(a:sy, 1, 'SignifyRemoveFirstLine'))
elseif s:sign_show_count
let text = s:sign_delete . (old_count <= 99 ? old_count : '>')
while strwidth(text) > 2
let text = substitute(text, '.', '', '')
endwhile
call add(ids, s:add_sign(a:sy, new_line, 'SignifyDelete'. old_count, text))
else
call add(ids, s:add_sign(a:sy, new_line, 'SignifyDeleteMore', s:sign_delete))
endif
" 2 lines changed:
" @@ -5,2 +5,2 @@ this is line 4
" -this is line 5
" -this is line 6
" +this os line 5
" +this os line 6
elseif old_count == new_count
let modified += old_count
let offset = 0
while offset < new_count
let line = new_line + offset
let offset += 1
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, 'SignifyChange'))
endwhile
else
" 2 lines changed; 2 lines removed:
" @@ -5,4 +5,2 @@ this is line 4
" -this is line 5
" -this is line 6
" -this is line 7
" -this is line 8
" +this os line 5
" +this os line 6
if old_count > new_count
let modified += new_count
let removed = old_count - new_count
let deleted += removed
let offset = 0
while offset < new_count - 1
let line = new_line + offset
let offset += 1
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, 'SignifyChange'))
endwhile
let line = new_line + offset
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, (removed > 9)
\ ? 'SignifyChangeDeleteMore'
\ : 'SignifyChangeDelete'. removed))
" lines changed and added:
" @@ -5 +5,3 @@ this is line 4
" -this is line 5
" +this os line 5
" +this is line 42
" +this is line 666
else
let modified += old_count
let offset = 0
while offset < old_count
let line = new_line + offset
let offset += 1
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, 'SignifyChange'))
let added += 1
endwhile
while offset < new_count
let line = new_line + offset
let offset += 1
if s:external_sign_present(a:sy, line) | continue | endif
call add(ids, s:add_sign(a:sy, line, 'SignifyAdd'))
endwhile
endif
endif
if !empty(ids)
call add(a:sy.hunks, {
\ 'ids' : ids,
\ 'start': a:sy.lines[0],
\ 'end' : a:sy.lines[-1] })
endif
endfor
" Remove obsoleted signs.
for line in filter(keys(a:sy.internal), '!has_key(a:sy.signtable, v:val)')
execute 'sign unplace' a:sy.internal[line].id 'buffer='.a:sy.buffer
endfor
if has('gui_macvim') && has('gui_running') && mode() == 'n'
" MacVim needs an extra kick in the butt, when setting signs from the
" exit handler. :redraw would trigger a "hanging cursor" issue.
call feedkeys("\<c-l>", 'n')
endif
if empty(a:sy.updated_by) && empty(a:sy.hunks)
call sy#verbose('Successful exit value, but no diff. Keep VCS for time being.', a:vcs)
return
endif
call sy#verbose('Signs updated.', a:vcs)
let a:sy.updated_by = a:vcs
if len(a:sy.vcs) > 1
call sy#verbose('Disable all other VCS.', a:vcs)
let a:sy.vcs = [a:vcs]
endif
let a:sy.stats = [added, modified, deleted]
endfunction
" Function: #remove_all_signs {{{1
1 0.000005 function! sy#sign#remove_all_signs(bufnr) abort
let sy = getbufvar(a:bufnr, 'sy')
for hunk in sy.hunks
for id in hunk.ids
execute 'sign unplace' id 'buffer='.a:bufnr
endfor
endfor
let sy.hunks = []
endfunction
" Function: s:add_sign {{{1
1 0.000006 function! s:add_sign(sy, line, type, ...) abort
call add(a:sy.lines, a:line)
let a:sy.signtable[a:line] = 1
if has_key(a:sy.internal, a:line)
" There is a sign on this line already.
if a:type == a:sy.internal[a:line].type
" Keep current sign since the new one is of the same type.
return a:sy.internal[a:line].id
else
" Update sign by overwriting the ID of the current sign.
let id = a:sy.internal[a:line].id
endif
endif
if !exists('id')
let id = sy#sign#id_next(a:sy)
endif
if a:type =~# 'SignifyDelete'
execute printf('sign define %s text=%s texthl=SignifySignDelete linehl=%s',
\ a:type,
\ a:1,
\ s:delete_highlight[g:signify_line_highlight])
endif
execute printf('sign place %d line=%d name=%s buffer=%s',
\ id,
\ a:line,
\ a:type,
\ a:sy.buffer)
return id
endfunction
" Function: s:external_sign_present {{{1
1 0.000003 function! s:external_sign_present(sy, line) abort
if has_key(a:sy.external, a:line)
if has_key(a:sy.internal, a:line)
" Remove Sy signs from lines with other signs.
execute 'sign unplace' a:sy.internal[a:line].id 'buffer='.a:sy.buffer
endif
return 1
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/sign.vim
Sourced 1 time
Total time: 0.001443
Self time: 0.001360
count total (s) self (s)
1 0.000028 scriptencoding utf8
" Author: w0rp <devw0rp@gmail.com>
" Description: Draws error and warning signs into signcolumn
" This flag can be set to some integer to control the maximum number of signs
" that ALE will set.
1 0.000016 let g:ale_max_signs = get(g:, 'ale_max_signs', -1)
" This flag can be set to 1 to enable changing the sign column colors when
" there are errors.
1 0.000006 let g:ale_change_sign_column_color = get(g:, 'ale_change_sign_column_color', 0)
" These variables dictate what signs are used to indicate errors and warnings.
1 0.000005 let g:ale_sign_error = get(g:, 'ale_sign_error', '>>')
1 0.000005 let g:ale_sign_style_error = get(g:, 'ale_sign_style_error', g:ale_sign_error)
1 0.000009 let g:ale_sign_warning = get(g:, 'ale_sign_warning', '--')
1 0.000006 let g:ale_sign_style_warning = get(g:, 'ale_sign_style_warning', g:ale_sign_warning)
1 0.000004 let g:ale_sign_info = get(g:, 'ale_sign_info', g:ale_sign_warning)
" This variable sets an offset which can be set for sign IDs.
" This ID can be changed depending on what IDs are set for other plugins.
" The dummy sign will use the ID exactly equal to the offset.
1 0.000004 let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
" This flag can be set to 1 to keep sign gutter always open
1 0.000004 let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
1 0.000025 if !hlexists('ALEErrorSign')
highlight link ALEErrorSign error
endif
1 0.000016 if !hlexists('ALEStyleErrorSign')
1 0.000016 highlight link ALEStyleErrorSign ALEErrorSign
1 0.000001 endif
1 0.000008 if !hlexists('ALEWarningSign')
highlight link ALEWarningSign todo
endif
1 0.000009 if !hlexists('ALEStyleWarningSign')
1 0.000014 highlight link ALEStyleWarningSign ALEWarningSign
1 0.000001 endif
1 0.000005 if !hlexists('ALEInfoSign')
highlight link ALEInfoSign ALEWarningSign
endif
1 0.000005 if !hlexists('ALESignColumnWithErrors')
1 0.000011 highlight link ALESignColumnWithErrors error
1 0.000001 endif
1 0.000007 function! ale#sign#SetUpDefaultColumnWithoutErrorsHighlight() abort
redir => l:output
0verbose silent highlight SignColumn
redir end
let l:highlight_syntax = join(split(l:output)[2:])
let l:match = matchlist(l:highlight_syntax, '\vlinks to (.+)$')
if !empty(l:match)
execute 'highlight link ALESignColumnWithoutErrors ' . l:match[1]
elseif l:highlight_syntax isnot# 'cleared'
execute 'highlight ALESignColumnWithoutErrors ' . l:highlight_syntax
endif
endfunction
1 0.000012 if !hlexists('ALESignColumnWithoutErrors')
1 0.000104 0.000022 call ale#sign#SetUpDefaultColumnWithoutErrorsHighlight()
1 0.000001 endif
" Signs show up on the left for error markers.
1 0.000018 execute 'sign define ALEErrorSign text=' . g:ale_sign_error
\ . ' texthl=ALEErrorSign linehl=ALEErrorLine'
1 0.000009 execute 'sign define ALEStyleErrorSign text=' . g:ale_sign_style_error
\ . ' texthl=ALEStyleErrorSign linehl=ALEErrorLine'
1 0.000019 execute 'sign define ALEWarningSign text=' . g:ale_sign_warning
\ . ' texthl=ALEWarningSign linehl=ALEWarningLine'
1 0.000026 execute 'sign define ALEStyleWarningSign text=' . g:ale_sign_style_warning
\ . ' texthl=ALEStyleWarningSign linehl=ALEWarningLine'
1 0.000024 execute 'sign define ALEInfoSign text=' . g:ale_sign_info
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine'
1 0.000005 sign define ALEDummySign
1 0.000005 function! ale#sign#GetSignName(sublist) abort
let l:priority = g:ale#util#style_warning_priority
" Determine the highest priority item for the line.
for l:item in a:sublist
let l:item_priority = ale#util#GetItemPriority(l:item)
if l:item_priority > l:priority
let l:priority = l:item_priority
endif
endfor
if l:priority is# g:ale#util#error_priority
return 'ALEErrorSign'
endif
if l:priority is# g:ale#util#warning_priority
return 'ALEWarningSign'
endif
if l:priority is# g:ale#util#style_error_priority
return 'ALEStyleErrorSign'
endif
if l:priority is# g:ale#util#style_warning_priority
return 'ALEStyleWarningSign'
endif
if l:priority is# g:ale#util#info_priority
return 'ALEInfoSign'
endif
" Use the error sign for invalid severities.
return 'ALEErrorSign'
endfunction
" Read sign data for a buffer to a list of lines.
1 0.000003 function! ale#sign#ReadSigns(buffer) abort
redir => l:output
silent execute 'sign place buffer=' . a:buffer
redir end
return split(l:output, "\n")
endfunction
" Given a list of lines for sign output, return a List of [line, id, group]
1 0.000002 function! ale#sign#ParseSigns(line_list) abort
" Matches output like :
" line=4 id=1 name=ALEErrorSign
" —Å—Ç—Ä–æ–∫–∞=1 id=1000001 –∏–º—è=ALEErrorSign
" 行=1 識別子=1000001 名前=ALEWarningSign
" línea=12 id=1000001 nombre=ALEWarningSign
" riga=1 id=1000001, nome=ALEWarningSign
let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=(ALE[a-zA-Z]+Sign)'
let l:result = []
let l:is_dummy_sign_set = 0
for l:line in a:line_list
let l:match = matchlist(l:line, l:pattern)
if len(l:match) > 0
if l:match[3] is# 'ALEDummySign'
let l:is_dummy_sign_set = 1
else
call add(l:result, [
\ str2nr(l:match[1]),
\ str2nr(l:match[2]),
\ l:match[3],
\])
endif
endif
endfor
return [l:is_dummy_sign_set, l:result]
endfunction
1 0.000004 function! ale#sign#FindCurrentSigns(buffer) abort
let l:line_list = ale#sign#ReadSigns(a:buffer)
return ale#sign#ParseSigns(l:line_list)
endfunction
" Given a loclist, group the List into with one List per line.
1 0.000003 function! s:GroupLoclistItems(buffer, loclist) abort
let l:grouped_items = []
let l:last_lnum = -1
for l:obj in a:loclist
if l:obj.bufnr != a:buffer
continue
endif
" Create a new sub-List when we hit a new line.
if l:obj.lnum != l:last_lnum
call add(l:grouped_items, [])
endif
call add(l:grouped_items[-1], l:obj)
let l:last_lnum = l:obj.lnum
endfor
return l:grouped_items
endfunction
1 0.000002 function! s:UpdateLineNumbers(buffer, current_sign_list, loclist) abort
let l:line_map = {}
let l:line_numbers_changed = 0
for [l:line, l:sign_id, l:name] in a:current_sign_list
let l:line_map[l:sign_id] = l:line
endfor
for l:item in a:loclist
if l:item.bufnr == a:buffer
let l:lnum = get(l:line_map, get(l:item, 'sign_id', 0), 0)
if l:lnum && l:item.lnum != l:lnum
let l:item.lnum = l:lnum
let l:line_numbers_changed = 1
endif
endif
endfor
" When the line numbers change, sort the list again
if l:line_numbers_changed
call sort(a:loclist, 'ale#util#LocItemCompare')
endif
endfunction
1 0.000002 function! s:BuildSignMap(buffer, current_sign_list, grouped_items) abort
let l:max_signs = ale#Var(a:buffer, 'max_signs')
if l:max_signs is 0
let l:selected_grouped_items = []
elseif type(l:max_signs) is v:t_number && l:max_signs > 0
let l:selected_grouped_items = a:grouped_items[:l:max_signs - 1]
else
let l:selected_grouped_items = a:grouped_items
endif
let l:sign_map = {}
let l:sign_offset = g:ale_sign_offset
for [l:line, l:sign_id, l:name] in a:current_sign_list
let l:sign_info = get(l:sign_map, l:line, {
\ 'current_id_list': [],
\ 'current_name_list': [],
\ 'new_id': 0,
\ 'new_name': '',
\ 'items': [],
\})
" Increment the sign offset for new signs, by the maximum sign ID.
if l:sign_id > l:sign_offset
let l:sign_offset = l:sign_id
endif
" Remember the sign names and IDs in separate Lists, so they are easy
" to work with.
call add(l:sign_info.current_id_list, l:sign_id)
call add(l:sign_info.current_name_list, l:name)
let l:sign_map[l:line] = l:sign_info
endfor
for l:group in l:selected_grouped_items
let l:line = l:group[0].lnum
let l:sign_info = get(l:sign_map, l:line, {
\ 'current_id_list': [],
\ 'current_name_list': [],
\ 'new_id': 0,
\ 'new_name': '',
\ 'items': [],
\})
let l:sign_info.new_name = ale#sign#GetSignName(l:group)
let l:sign_info.items = l:group
let l:index = index(
\ l:sign_info.current_name_list,
\ l:sign_info.new_name
\)
if l:index >= 0
" We have a sign with this name already, so use the same ID.
let l:sign_info.new_id = l:sign_info.current_id_list[l:index]
else
" This sign name replaces the previous name, so use a new ID.
let l:sign_info.new_id = l:sign_offset + 1
let l:sign_offset += 1
endif
let l:sign_map[l:line] = l:sign_info
endfor
return l:sign_map
endfunction
1 0.000003 function! ale#sign#GetSignCommands(buffer, was_sign_set, sign_map) abort
let l:command_list = []
let l:is_dummy_sign_set = a:was_sign_set
" Set the dummy sign if we need to.
" The dummy sign is needed to keep the sign column open while we add
" and remove signs.
if !l:is_dummy_sign_set && (!empty(a:sign_map) || g:ale_sign_column_always)
call add(l:command_list, 'sign place '
\ . g:ale_sign_offset
\ . ' line=1 name=ALEDummySign buffer='
\ . a:buffer
\)
let l:is_dummy_sign_set = 1
endif
" Place new items first.
for [l:line_str, l:info] in items(a:sign_map)
if l:info.new_id
" Save the sign IDs we are setting back on our loclist objects.
" These IDs will be used to preserve items which are set many times.
for l:item in l:info.items
let l:item.sign_id = l:info.new_id
endfor
if index(l:info.current_id_list, l:info.new_id) < 0
call add(l:command_list, 'sign place '
\ . (l:info.new_id)
\ . ' line=' . l:line_str
\ . ' name=' . (l:info.new_name)
\ . ' buffer=' . a:buffer
\)
endif
endif
endfor
" Remove signs without new IDs.
for l:info in values(a:sign_map)
for l:current_id in l:info.current_id_list
if l:current_id isnot l:info.new_id
call add(l:command_list, 'sign unplace '
\ . l:current_id
\ . ' buffer=' . a:buffer
\)
endif
endfor
endfor
" Remove the dummy sign to close the sign column if we need to.
if l:is_dummy_sign_set && !g:ale_sign_column_always
call add(l:command_list, 'sign unplace '
\ . g:ale_sign_offset
\ . ' buffer=' . a:buffer
\)
endif
return l:command_list
endfunction
" This function will set the signs which show up on the left.
1 0.000002 function! ale#sign#SetSigns(buffer, loclist) abort
if !bufexists(str2nr(a:buffer))
" Stop immediately when attempting to set signs for a buffer which
" does not exist.
return
endif
" Find the current markers
let [l:is_dummy_sign_set, l:current_sign_list] =
\ ale#sign#FindCurrentSigns(a:buffer)
" Update the line numbers for items from before which may have moved.
call s:UpdateLineNumbers(a:buffer, l:current_sign_list, a:loclist)
" Group items after updating the line numbers.
let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist)
" Build a map of current and new signs, with the lines as the keys.
let l:sign_map = s:BuildSignMap(
\ a:buffer,
\ l:current_sign_list,
\ l:grouped_items,
\)
let l:command_list = ale#sign#GetSignCommands(
\ a:buffer,
\ l:is_dummy_sign_set,
\ l:sign_map,
\)
" Change the sign column color if the option is on.
if g:ale_change_sign_column_color && !empty(a:loclist)
highlight clear SignColumn
highlight link SignColumn ALESignColumnWithErrors
endif
for l:command in l:command_list
silent! execute l:command
endfor
" Reset the sign column color when there are no more errors.
if g:ale_change_sign_column_color && empty(a:loclist)
highlight clear SignColumn
highlight link SignColumn ALESignColumnWithoutErrors
endif
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/list.vim
Sourced 1 time
Total time: 0.001118
Self time: 0.001118
count total (s) self (s)
" Author: Bjorn Neergaard <bjorn@neersighted.com>, modified by Yann fery <yann@fery.me>
" Description: Manages the loclist and quickfix lists
" This flag dictates if ale open the configured loclist
1 0.000016 let g:ale_open_list = get(g:, 'ale_open_list', 0)
" This flag dictates if ale keeps open loclist even if there is no error in loclist
1 0.000006 let g:ale_keep_list_window_open = get(g:, 'ale_keep_list_window_open', 0)
" This flag dictates that quickfix windows should be opened vertically
1 0.000012 let g:ale_list_vertical = get(g:, 'ale_list_vertical', 0)
" The window size to set for the quickfix and loclist windows
1 0.000006 let g:ale_list_window_size = get(g:, 'ale_list_window_size', 10)
" A string format for the loclist messages.
1 0.000011 let g:ale_loclist_msg_format = get(g:, 'ale_loclist_msg_format',
\ get(g:, 'ale_echo_msg_format', '%code: %%s')
\)
1 0.000005 if !exists('s:timer_args')
1 0.000004 let s:timer_args = {}
1 0.000002 endif
" Return 1 if there is a buffer with buftype == 'quickfix' in bufffer list
1 0.000010 function! ale#list#IsQuickfixOpen() abort
for l:buf in range(1, bufnr('$'))
if getbufvar(l:buf, '&buftype') is# 'quickfix'
return 1
endif
endfor
return 0
endfunction
" Check if we should open the list, based on the save event being fired, and
" that setting being on, or the setting just being set to `1`.
1 0.000008 function! s:ShouldOpen(buffer) abort
let l:val = ale#Var(a:buffer, 'open_list')
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
return l:val is 1 || (l:val is# 'on_save' && l:saved)
endfunction
1 0.000007 function! ale#list#GetCombinedList() abort
let l:list = []
for l:info in values(g:ale_buffer_info)
call extend(l:list, l:info.loclist)
endfor
call sort(l:list, function('ale#util#LocItemCompareWithText'))
call uniq(l:list, function('ale#util#LocItemCompareWithText'))
return l:list
endfunction
1 0.000004 function! s:FixList(buffer, list) abort
let l:format = ale#Var(a:buffer, 'loclist_msg_format')
let l:new_list = []
for l:item in a:list
let l:fixed_item = copy(l:item)
let l:fixed_item.text = ale#GetLocItemMessage(l:item, l:format)
if l:item.bufnr == -1
" If the buffer number is invalid, remove it.
call remove(l:fixed_item, 'bufnr')
endif
call add(l:new_list, l:fixed_item)
endfor
return l:new_list
endfunction
1 0.000004 function! s:BufWinId(buffer) abort
return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0
endfunction
1 0.000004 function! s:SetListsImpl(timer_id, buffer, loclist) abort
let l:title = expand('#' . a:buffer . ':p')
if g:ale_set_quickfix
let l:quickfix_list = ale#list#GetCombinedList()
if has('nvim')
call setqflist(s:FixList(a:buffer, l:quickfix_list), ' ', l:title)
else
call setqflist(s:FixList(a:buffer, l:quickfix_list))
call setqflist([], 'r', {'title': l:title})
endif
elseif g:ale_set_loclist
" If windows support is off, bufwinid() may not exist.
" We'll set result in the current window, which might not be correct,
" but it's better than nothing.
let l:id = s:BufWinId(a:buffer)
if has('nvim')
call setloclist(l:id, s:FixList(a:buffer, a:loclist), ' ', l:title)
else
call setloclist(l:id, s:FixList(a:buffer, a:loclist))
call setloclist(l:id, [], 'r', {'title': l:title})
endif
endif
" Open a window to show the problems if we need to.
"
" We'll check if the current buffer's List is not empty here, so the
" window will only be opened if the current buffer has problems.
if s:ShouldOpen(a:buffer) && !empty(a:loclist)
let l:winnr = winnr()
let l:mode = mode()
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>"
" open windows vertically instead of default horizontally
let l:open_type = ''
if ale#Var(a:buffer, 'list_vertical') == 1
let l:open_type = 'vert '
endif
if g:ale_set_quickfix
if !ale#list#IsQuickfixOpen()
silent! execute l:open_type . 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
endif
elseif g:ale_set_loclist
silent! execute l:open_type . 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
endif
" If focus changed, restore it (jump to the last window).
if l:winnr isnot# winnr()
wincmd p
endif
if l:reset_visual_selection || l:reset_character_selection
" If we were in a selection mode before, select the last selection.
normal! gv
if l:reset_character_selection
" Switch back to Select mode, if we were in that.
normal! "\<c-g>"
endif
endif
endif
" If ALE isn't currently checking for more problems, close the window if
" needed now. This check happens inside of this timer function, so
" the window can be closed reliably.
if !ale#engine#IsCheckingBuffer(a:buffer)
call s:CloseWindowIfNeeded(a:buffer)
endif
endfunction
1 0.000009 function! ale#list#SetLists(buffer, loclist) abort
if get(g:, 'ale_set_lists_synchronously') == 1
\|| getbufvar(a:buffer, 'ale_save_event_fired', 0)
" Update lists immediately if running a test synchronously, or if the
" buffer was saved.
"
" The lists need to be updated immediately when saving a buffer so
" that we can reliably close window automatically, if so configured.
call s:SetListsImpl(-1, a:buffer, a:loclist)
else
call ale#util#StartPartialTimer(
\ 0,
\ function('s:SetListsImpl'),
\ [a:buffer, a:loclist],
\)
endif
endfunction
1 0.000005 function! s:CloseWindowIfNeeded(buffer) abort
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
return
endif
try
" Only close windows if the quickfix list or loclist is completely empty,
" including errors set through other means.
if g:ale_set_quickfix
if empty(getqflist())
cclose
endif
else
let l:win_id = s:BufWinId(a:buffer)
if g:ale_set_loclist && empty(getloclist(l:win_id))
lclose
endif
endif
" Ignore 'Cannot close last window' errors.
catch /E444/
endtry
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/highlight.vim
Sourced 1 time
Total time: 0.000657
Self time: 0.000657
count total (s) self (s)
1 0.000010 scriptencoding utf8
" Author: w0rp <devw0rp@gmail.com>
" Description: This module implements error/warning highlighting.
1 0.000024 if !hlexists('ALEError')
highlight link ALEError SpellBad
endif
1 0.000015 if !hlexists('ALEStyleError')
1 0.000016 highlight link ALEStyleError ALEError
1 0.000001 endif
1 0.000032 if !hlexists('ALEWarning')
highlight link ALEWarning SpellCap
endif
1 0.000014 if !hlexists('ALEStyleWarning')
1 0.000016 highlight link ALEStyleWarning ALEWarning
1 0.000001 endif
1 0.000008 if !hlexists('ALEInfo')
highlight link ALEInfo ALEWarning
endif
" The maximum number of items for the second argument of matchaddpos()
1 0.000004 let s:MAX_POS_VALUES = 8
1 0.000002 let s:MAX_COL_SIZE = 1073741824 " pow(2, 30)
1 0.000008 function! ale#highlight#CreatePositions(line, col, end_line, end_col) abort
if a:line >= a:end_line
" For single lines, just return the one position.
return [[[a:line, a:col, a:end_col - a:col + 1]]]
endif
" Get positions from the first line at the first column, up to a large
" integer for highlighting up to the end of the line, followed by
" the lines in-between, for highlighting entire lines, and
" a highlight for the last line, up to the end column.
let l:all_positions =
\ [[a:line, a:col, s:MAX_COL_SIZE]]
\ + range(a:line + 1, a:end_line - 1)
\ + [[a:end_line, 1, a:end_col]]
return map(
\ range(0, len(l:all_positions) - 1, s:MAX_POS_VALUES),
\ 'l:all_positions[v:val : v:val + s:MAX_POS_VALUES - 1]',
\)
endfunction
" Given a loclist for current items to highlight, remove all highlights
" except these which have matching loclist item entries.
1 0.000004 function! ale#highlight#RemoveHighlights() abort
for l:match in getmatches()
if l:match.group =~# '^ALE'
call matchdelete(l:match.id)
endif
endfor
endfunction
1 0.000003 function! ale#highlight#UpdateHighlights() abort
let l:item_list = get(b:, 'ale_enabled', 1) && g:ale_enabled
\ ? get(b:, 'ale_highlight_items', [])
\ : []
call ale#highlight#RemoveHighlights()
for l:item in l:item_list
if l:item.type is# 'W'
if get(l:item, 'sub_type', '') is# 'style'
let l:group = 'ALEStyleWarning'
else
let l:group = 'ALEWarning'
endif
elseif l:item.type is# 'I'
let l:group = 'ALEInfo'
elseif get(l:item, 'sub_type', '') is# 'style'
let l:group = 'ALEStyleError'
else
let l:group = 'ALEError'
endif
let l:line = l:item.lnum
let l:col = l:item.col
let l:end_line = get(l:item, 'end_lnum', l:line)
let l:end_col = get(l:item, 'end_col', l:col)
" Set all of the positions, which are chunked into Lists which
" are as large as will be accepted by matchaddpos.
call map(
\ ale#highlight#CreatePositions(l:line, l:col, l:end_line, l:end_col),
\ 'matchaddpos(l:group, v:val)'
\)
endfor
" If highlights are enabled and signs are not enabled, we should still
" offer line highlights by adding a separate set of highlights.
if !g:ale_set_signs
let l:available_groups = {
\ 'ALEWarningLine': hlexists('ALEWarningLine'),
\ 'ALEInfoLine': hlexists('ALEInfoLine'),
\ 'ALEErrorLine': hlexists('ALEErrorLine'),
\}
for l:item in l:item_list
if l:item.type is# 'W'
let l:group = 'ALEWarningLine'
elseif l:item.type is# 'I'
let l:group = 'ALEInfoLine'
else
let l:group = 'ALEErrorLine'
endif
if l:available_groups[l:group]
call matchaddpos(l:group, [l:item.lnum])
endif
endfor
endif
endfunction
1 0.000004 function! ale#highlight#BufferHidden(buffer) abort
" Remove highlights right away when buffers are hidden.
" They will be restored later when buffers are entered.
call ale#highlight#RemoveHighlights()
endfunction
1 0.000004 augroup ALEHighlightBufferGroup
1 0.000207 autocmd!
1 0.000010 autocmd BufEnter * call ale#highlight#UpdateHighlights()
1 0.000003 autocmd BufHidden * call ale#highlight#BufferHidden(expand('<abuf>'))
1 0.000001 augroup END
1 0.000005 function! ale#highlight#SetHighlights(buffer, loclist) abort
let l:new_list = getbufvar(a:buffer, 'ale_enabled', 1) && g:ale_enabled
\ ? filter(copy(a:loclist), 'v:val.bufnr == a:buffer && v:val.col > 0')
\ : []
" Set the list in the buffer variable.
call setbufvar(str2nr(a:buffer), 'ale_highlight_items', l:new_list)
" Update highlights for the current buffer, which may or may not
" be the buffer we just set highlights for.
call ale#highlight#UpdateHighlights()
endfunction
SCRIPT /Users/rahmatawaludin/dotfiles/.config/nvim/plugged/ale/autoload/ale/lsp/response.vim
Sourced 1 time
Total time: 0.000408
Self time: 0.000408
count total (s) self (s)
" Author: w0rp <devw0rp@gmail.com>
" Description: Parsing and transforming of LSP server responses.
" Constants for error codes.
" Defined by JSON RPC
1 0.000005 let s:PARSE_ERROR = -32700
1 0.000002 let s:INVALID_REQUEST = -32600
1 0.000001 let s:METHOD_NOT_FOUND = -32601
1 0.000002 let s:INVALID_PARAMS = -32602
1 0.000001 let s:INTERNAL_ERROR = -32603
1 0.000001 let s:SERVER_ERROR_START = -32099
1 0.000004 let s:SERVER_ERROR_END = -32000
1 0.000002 let s:SERVER_NOT_INITIALIZED = -32002
1 0.000002 let s:UNKNOWN_ERROR_CODE = -32001
" Defined by the protocol.
1 0.000001 let s:REQUEST_CANCELLED = -32800
" Constants for message severity codes.
1 0.000001 let s:SEVERITY_ERROR = 1
1 0.000001 let s:SEVERITY_WARNING = 2
1 0.000001 let s:SEVERITY_INFORMATION = 3
1 0.000001 let s:SEVERITY_HINT = 4
" Parse the message for textDocument/publishDiagnostics
1 0.000005 function! ale#lsp#response#ReadDiagnostics(response) abort
let l:loclist = []
for l:diagnostic in a:response.params.diagnostics
let l:severity = get(l:diagnostic, 'severity', 0)
let l:loclist_item = {
\ 'text': l:diagnostic.message,
\ 'type': 'E',
\ 'lnum': l:diagnostic.range.start.line + 1,
\ 'col': l:diagnostic.range.start.character + 1,
\ 'end_lnum': l:diagnostic.range.end.line + 1,
\ 'end_col': l:diagnostic.range.end.character + 1,
\}
if l:severity == s:SEVERITY_WARNING
let l:loclist_item.type = 'W'
elseif l:severity == s:SEVERITY_INFORMATION
" TODO: Use 'I' here in future.
let l:loclist_item.type = 'W'
elseif l:severity == s:SEVERITY_HINT
" TODO: Use 'H' here in future
let l:loclist_item.type = 'W'
endif
if has_key(l:diagnostic, 'code')
if type(l:diagnostic.code) == v:t_string
let l:loclist_item.code = l:diagnostic.code
elseif type(l:diagnostic.code) == v:t_number && l:diagnostic.code != -1
let l:loclist_item.code = string(l:diagnostic.code)
let l:loclist_item.nr = l:diagnostic.code
endif
endif
if has_key(l:diagnostic, 'relatedInformation')
let l:related = deepcopy(l:diagnostic.relatedInformation)
call map(l:related, {key, val ->
\ ale#path#FromURI(val.location.uri) .
\ ':' . (val.location.range.start.line + 1) .
\ ':' . (val.location.range.start.character + 1) .
\ ":\n\t" . val.message
\ })
let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n")
endif
call add(l:loclist, l:loclist_item)
endfor
return l:loclist
endfunction
1 0.000003 function! ale#lsp#response#ReadTSServerDiagnostics(response) abort
let l:loclist = []
for l:diagnostic in a:response.body.diagnostics
let l:loclist_item = {
\ 'text': l:diagnostic.text,
\ 'type': 'E',
\ 'lnum': l:diagnostic.start.line,
\ 'col': l:diagnostic.start.offset,
\ 'end_lnum': l:diagnostic.end.line,
\ 'end_col': l:diagnostic.end.offset,
\}
if has_key(l:diagnostic, 'code')
if type(l:diagnostic.code) == v:t_string
let l:loclist_item.code = l:diagnostic.code
elseif type(l:diagnostic.code) == v:t_number && l:diagnostic.code != -1
let l:loclist_item.code = string(l:diagnostic.code)
let l:loclist_item.nr = l:diagnostic.code
endif
endif
if get(l:diagnostic, 'category') is# 'warning'
let l:loclist_item.type = 'W'
endif
if get(l:diagnostic, 'category') is# 'suggestion'
let l:loclist_item.type = 'I'
endif
call add(l:loclist, l:loclist_item)
endfor
return l:loclist
endfunction
1 0.000003 function! ale#lsp#response#GetErrorMessage(response) abort
if type(get(a:response, 'error', 0)) isnot v:t_dict
return ''
endif
let l:code = get(a:response.error, 'code')
" Only report things for these error codes.
if l:code isnot s:INVALID_PARAMS && l:code isnot s:INTERNAL_ERROR
return ''
endif
let l:message = get(a:response.error, 'message', '')
if empty(l:message)
return ''
endif
" Include the traceback or error data as details, if present.
let l:error_data = get(a:response.error, 'data', {})
if type(l:error_data) is v:t_string
let l:message .= "\n" . l:error_data
elseif type(l:error_data) is v:t_dict
let l:traceback = get(l:error_data, 'traceback', [])
if type(l:traceback) is v:t_list && !empty(l:traceback)
let l:message .= "\n" . join(l:traceback, "\n")
endif
endif
return l:message
endfunction
SCRIPT /usr/local/Cellar/neovim/0.3.1/share/nvim/runtime/autoload/phpcomplete.vim
Sourced 1 time
Total time: 0.003601
Self time: 0.003601
count total (s) self (s)
" Vim completion script
" Language: PHP
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2016 Oct 10
"
" OPTIONS:
"
" let g:phpcomplete_relax_static_constraint = 1/0 [default 0]
" Enables completion for non-static methods when completing for static context (::).
" This generates E_STRICT level warning, but php calls these methods nontheless.
"
" let g:phpcomplete_complete_for_unknown_classes = 1/0 [default 0]
" Enables completion of variables and functions in "everything under the sun" fashion
" when completing for an instance or static class context but the code can't tell the class
" or locate the file that it lives in.
" The completion list generated this way is only filtered by the completion base
" and generally not much more accurate then simple keyword completion.
"
" let g:phpcomplete_search_tags_for_variables = 1/0 [default 0]
" Enables use of tags when the plugin tries to find variables.
" When enabled the plugin will search for the variables in the tag files with kind 'v',
" lines like $some_var = new Foo; but these usually yield highly inaccurate results and
" can be fairly slow.
"
" let g:phpcomplete_min_num_of_chars_for_namespace_completion = n [default 1]
" This option controls the number of characters the user needs to type before
" the tags will be searched for namespaces and classes in typed out namespaces in
" "use ..." context. Setting this to 0 is not recommended because that means the code
" have to scan every tag, and vim's taglist() function runs extremly slow with a
" "match everything" pattern.
"
" let g:phpcomplete_parse_docblock_comments = 1/0 [default 0]
" When enabled the preview window's content will include information
" extracted from docblock comments of the completions.
" Enabling this option will add return types to the completion menu for functions too.
"
" let g:phpcomplete_cache_taglists = 1/0 [default 1]
" When enabled the taglist() lookups will be cached and subsequent searches
" for the same pattern will not check the tagfiles any more, thus making the
" lookups faster. Cache expiration is based on the mtimes of the tag files.
"
" TODO:
" - Switching to HTML (XML?) completion (SQL) inside of phpStrings
" - allow also for XML completion <- better do html_flavor for HTML
" completion
" - outside of <?php?> getting parent tag may cause problems. Heh, even in
" perfect conditions GetLastOpenTag doesn't cooperate... Inside of
" phpStrings this can be even a bonus but outside of <?php?> it is not the
" best situation
1 0.000006 if !exists('g:phpcomplete_relax_static_constraint')
1 0.000006 let g:phpcomplete_relax_static_constraint = 0
1 0.000001 endif
1 0.000003 if !exists('g:phpcomplete_complete_for_unknown_classes')
1 0.000002 let g:phpcomplete_complete_for_unknown_classes = 0
1 0.000001 endif
1 0.000002 if !exists('g:phpcomplete_search_tags_for_variables')
1 0.000004 let g:phpcomplete_search_tags_for_variables = 0
1 0.000001 endif
1 0.000003 if !exists('g:phpcomplete_min_num_of_chars_for_namespace_completion')
1 0.000004 let g:phpcomplete_min_num_of_chars_for_namespace_completion = 1
1 0.000001 endif
1 0.000003 if !exists('g:phpcomplete_parse_docblock_comments')
1 0.000002 let g:phpcomplete_parse_docblock_comments = 0
1 0.000001 endif
1 0.000002 if !exists('g:phpcomplete_cache_taglists')
1 0.000002 let g:phpcomplete_cache_taglists = 1
1 0.000001 endif
1 0.000002 if !exists('s:cache_classstructures')
1 0.000002 let s:cache_classstructures = {}
1 0.000001 endif
1 0.000002 if !exists('s:cache_tags')
1 0.000001 let s:cache_tags = {}
1 0.000001 endif
1 0.000002 if !exists('s:cache_tags_checksum')
1 0.000001 let s:cache_tags_checksum = ''
1 0.000000 endif
1 0.000041 let s:script_path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
1 0.000004 function! phpcomplete#CompletePHP(findstart, base) " {{{
if a:findstart
unlet! b:php_menu
" Check if we are inside of PHP markup
let pos = getpos('.')
let phpbegin = searchpairpos('<?', '', '?>', 'bWn',
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
let phpend = searchpairpos('<?', '', '?>', 'Wn',
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
if phpbegin == [0,0] && phpend == [0,0]
" We are outside of any PHP markup. Complete HTML
let htmlbegin = htmlcomplete#CompleteTags(1, '')
let cursor_col = pos[2]
let base = getline('.')[htmlbegin : cursor_col]
let b:php_menu = htmlcomplete#CompleteTags(0, base)
return htmlbegin
else
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
let compl_begin = col('.') - 2
while start >= 0 && line[start - 1] =~ '[\\a-zA-Z_0-9\x7f-\xff$]'
let start -= 1
endwhile
let b:phpbegin = phpbegin
let b:compl_context = phpcomplete#GetCurrentInstruction(line('.'), max([0, col('.') - 2]), phpbegin)
return start
" We can be also inside of phpString with HTML tags. Deal with
" it later (time, not lines).
endif
endif
" If exists b:php_menu it means completion was already constructed we
" don't need to do anything more
if exists("b:php_menu")
return b:php_menu
endif
if !exists('g:php_builtin_functions')
call phpcomplete#LoadData()
endif
" a:base is very short - we need context
if exists("b:compl_context")
let context = b:compl_context
unlet! b:compl_context
" chop of the "base" from the end of the current instruction
if a:base != ""
let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '')
end
else
let context = ''
end
try
let winheight = winheight(0)
let winnr = winnr()
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
if context =~? '^use\s' || context ==? 'use'
return phpcomplete#CompleteUse(a:base)
endif
if context =~ '\(->\|::\)$'
" {{{
" Get name of the class
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
" Get location of class definition, we have to iterate through all
if classname != ''
if classname =~ '\'
" split the last \ segment as a classname, everything else is the namespace
let classname_parts = split(classname, '\')
let namespace = join(classname_parts[0:-2], '\')
let classname = classname_parts[-1]
else
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
else
let classlocation = ''
endif
if classlocation != ''
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
endif
if filereadable(classlocation)
let classfile = readfile(classlocation)
let classcontent = ''
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
let sccontent = split(classcontent, "\n")
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
endif
endif
return phpcomplete#CompleteUnknownClass(a:base, context)
" }}}
elseif context =~? 'implements'
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
elseif context =~? 'instanceof'
return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports)
elseif context =~? 'extends\s\+.\+$' && a:base == ''
return ['implements']
elseif context =~? 'extends'
let kinds = context =~? 'class\s' ? ['c'] : ['i']
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
elseif context =~? 'new'
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
endif
if a:base =~ '^\$'
return phpcomplete#CompleteVariable(a:base)
else
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
endif
finally
silent! exec winnr.'resize '.winheight
endtry
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteUse(base) " {{{
" completes builtin class names regadless of g:phpcomplete_min_num_of_chars_for_namespace_completion
" completes namespaces from tags
" * requires patched ctags
" completes classnames from tags within the already typed out namespace using the "namespace" field of tags
" * requires patched ctags
let res = []
" class and namespace names are always considered absoltute in use ... expressions, leading slash is not recommended
" by the php manual, so we gonna get rid of that
if a:base =~? '^\'
let base = substitute(a:base, '^\', '', '')
else
let base = a:base
endif
let namespace_match_pattern = substitute(base, '\\', '\\\\', 'g')
let classname_match_pattern = matchstr(base, '[^\\]\+$')
let namespace_for_class = substitute(substitute(namespace_match_pattern, '\\\\', '\\', 'g'), '\\*'.classname_match_pattern.'$', '', '')
if len(namespace_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
if len(classname_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
let tags = phpcomplete#GetTaglist('^\('.namespace_match_pattern.'\|'.classname_match_pattern.'\)')
else
let tags = phpcomplete#GetTaglist('^'.namespace_match_pattern)
endif
let patched_ctags_detected = 0
let namespaced_matches = []
let no_namespace_matches = []
for tag in tags
if has_key(tag, 'namespace')
let patched_ctags_detected = 1
endif
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
let patched_ctags_detected = 1
call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename })
elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') && tag.namespace ==? namespace_for_class
call add(namespaced_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
elseif (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't')
call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
endfor
" if it seems that the tags file have namespace informations we can safely throw
" away namespaceless tag matches since we can be sure they are invalid
if patched_ctags_detected
no_namespace_matches = []
endif
let res += namespaced_matches + no_namespace_matches
endif
if base !~ '\'
let builtin_classnames = filter(keys(copy(g:php_builtin_classnames)), 'v:val =~? "^'.classname_match_pattern.'"')
for classname in builtin_classnames
call add(res, {'word': g:php_builtin_classes[tolower(classname)].name, 'kind': 'c'})
endfor
let builtin_interfacenames = filter(keys(copy(g:php_builtin_interfacenames)), 'v:val =~? "^'.classname_match_pattern.'"')
for interfacename in builtin_interfacenames
call add(res, {'word': g:php_builtin_interfaces[tolower(interfacename)].name, 'kind': 'i'})
endfor
endif
for comp in res
let comp.word = substitute(comp.word, '^\\', '', '')
endfor
return res
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
" Complete everything
" + functions, DONE
" + keywords of language DONE
" + defines (constant definitions), DONE
" + extend keywords for predefined constants, DONE
" + classes (after new), DONE
" + limit choice after -> and :: to funcs and vars DONE
" Internal solution for finding functions in current file.
if a:base =~? '^\'
let leading_slash = '\'
else
let leading_slash = ''
endif
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
let int_functions[f_name.'('] = f_args.')'
endif
endfor
" Internal solution for finding constants in current file
let file = getline(1, '$')
call filter(file, 'v:val =~ "define\\s*("')
let jfile = join(file, ' ')
let int_values = split(jfile, 'define\s*(\s*')
let int_constants = {}
for i in int_values
let c_name = matchstr(i, '\(["'']\)\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze\1')
if c_name != '' && c_name =~# '^'.substitute(a:base, '\\', '\\\\', 'g')
let int_constants[leading_slash.c_name] = ''
endif
endfor
" Prepare list of functions from tags file
let ext_functions = {}
let ext_constants = {}
let ext_classes = {}
let ext_traits = {}
let ext_interfaces = {}
let ext_namespaces = {}
let base = substitute(a:base, '^\\', '', '')
let [tag_match_pattern, namespace_for_tag] = phpcomplete#ExpandClassName(a:base, a:current_namespace, a:imports)
let namespace_match_pattern = substitute((namespace_for_tag == '' ? '' : namespace_for_tag.'\').tag_match_pattern, '\\', '\\\\', 'g')
let tags = []
if len(namespace_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion && len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion && tag_match_pattern != namespace_match_pattern
let tags = phpcomplete#GetTaglist('\c^\('.tag_match_pattern.'\|'.namespace_match_pattern.'\)')
elseif len(namespace_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
let tags = phpcomplete#GetTaglist('\c^'.namespace_match_pattern)
elseif len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
let tags = phpcomplete#GetTaglist('\c^'.tag_match_pattern)
endif
for tag in tags
if !has_key(tag, 'namespace') || tag.namespace ==? a:current_namespace || tag.namespace ==? namespace_for_tag
if has_key(tag, 'namespace')
let full_name = tag.namespace.'\'.tag.name " absolute namespaced name (without leading '\')
let base_parts = split(a:base, '\')
if len(base_parts) > 1
let namespace_part = join(base_parts[0:-2], '\')
else
let namespace_part = ''
endif
let relative_name = (namespace_part == '' ? '' : namespace_part.'\').tag.name
endif
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
let info = tag.name.' - '.tag.filename
" patched ctag provides absolute namespace names as tag name, namespace tags dont have namespace fields
let full_name = tag.name
let base_parts = split(a:base, '\')
let full_name_parts = split(full_name, '\')
if len(base_parts) > 1
" the first segment could be a renamed import, take the first segment from the user provided input
" so if it's a sub namespace of a renamed namespace, just use the typed in segments in place of the absolute path
" for example:
" you have a namespace NS1\SUBNS as SUB
" you have a sub-sub-namespace NS1\SUBNS\SUBSUB
" typed in SUB\SU
" the tags will return NS1\SUBNS\SUBSUB
" the completion should be: SUB\SUBSUB by replacing the NS1\SUBSN to SUB as in the import
if has_key(a:imports, base_parts[0]) && a:imports[base_parts[0]].kind == 'n'
let import = a:imports[base_parts[0]]
let relative_name = substitute(full_name, '^'.substitute(import.name, '\\', '\\\\', 'g'), base_parts[0], '')
else
let relative_name = strpart(full_name, stridx(full_name, a:base))
endif
else
let relative_name = strpart(full_name, stridx(full_name, a:base))
endif
if leading_slash == ''
let ext_namespaces[relative_name.'\'] = info
else
let ext_namespaces['\'.full_name.'\'] = info
endif
elseif tag.kind ==? 'f' && !has_key(tag, 'class') " class related functions (methods) completed elsewhere, only works with patched ctags
if has_key(tag, 'signature')
let prototype = tag.signature[1:-2] " drop the ()s around the string
else
let prototype = matchstr(tag.cmd,
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
endif
let info = prototype.') - '.tag.filename
if !has_key(tag, 'namespace')
let ext_functions[tag.name.'('] = info
else
if tag.namespace ==? namespace_for_tag
if leading_slash == ''
let ext_functions[relative_name.'('] = info
else
let ext_functions['\'.full_name.'('] = info
endif
endif
endif
elseif tag.kind ==? 'd'
let info = ' - '.tag.filename
if !has_key(tag, 'namespace')
let ext_constants[tag.name] = info
else
if tag.namespace ==? namespace_for_tag
if leading_slash == ''
let ext_constants[relative_name] = info
else
let ext_constants['\'.full_name] = info
endif
endif
endif
elseif tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't'
let info = ' - '.tag.filename
let key = ''
if !has_key(tag, 'namespace')
let key = tag.name
else
if tag.namespace ==? namespace_for_tag
if leading_slash == ''
let key = relative_name
else
let key = '\'.full_name
endif
endif
endif
if key != ''
if tag.kind ==? 'c'
let ext_classes[key] = info
elseif tag.kind ==? 'i'
let ext_interfaces[key] = info
elseif tag.kind ==? 't'
let ext_traits[key] = info
endif
endif
endif
endif
endfor
let builtin_constants = {}
let builtin_classnames = {}
let builtin_interfaces = {}
let builtin_functions = {}
let builtin_keywords = {}
let base = substitute(a:base, '^\', '', '')
if a:current_namespace == '\' || (a:base =~ '^\\' && a:base =~ '^\\[^\\]*$')
" Add builtin class names
for [classname, info] in items(g:php_builtin_classnames)
if classname =~? '^'.base
let builtin_classnames[leading_slash.g:php_builtin_classes[tolower(classname)].name] = info
endif
endfor
for [interfacename, info] in items(g:php_builtin_interfacenames)
if interfacename =~? '^'.base
let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info
endif
endfor
endif
" Prepare list of constants from built-in constants
for [constant, info] in items(g:php_constants)
if constant =~# '^'.base
let builtin_constants[leading_slash.constant] = info
endif
endfor
if leading_slash == '' " keywords should not be completed when base starts with '\'
" Treat keywords as constants
for [constant, info] in items(g:php_keywords)
if constant =~? '^'.a:base
let builtin_keywords[constant] = info
endif
endfor
endif
for [function_name, info] in items(g:php_builtin_functions)
if function_name =~? '^'.base
let builtin_functions[leading_slash.function_name] = info
endif
endfor
" All constants
call extend(int_constants, ext_constants)
" All functions
call extend(int_functions, ext_functions)
call extend(int_functions, builtin_functions)
for [imported_name, import] in items(a:imports)
if imported_name =~? '^'.base
if import.kind ==? 'c'
if import.builtin
let builtin_classnames[imported_name] = ' '.import.name
else
let ext_classes[imported_name] = ' '.import.name.' - '.import.filename
endif
elseif import.kind ==? 'i'
if import.builtin
let builtin_interfaces[imported_name] = ' '.import.name
else
let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename
endif
elseif import.kind ==? 't'
let ext_traits[imported_name] = ' '.import.name.' - '.import.filename
endif
" no builtin interfaces
if import.kind == 'n'
let ext_namespaces[imported_name.'\'] = ' '.import.name.' - '.import.filename
endif
end
endfor
let all_values = {}
" Add functions found in this file
call extend(all_values, int_functions)
" Add namespaces from tags
call extend(all_values, ext_namespaces)
" Add constants from the current file
call extend(all_values, int_constants)
" Add built-in constants
call extend(all_values, builtin_constants)
" Add external classes
call extend(all_values, ext_classes)
" Add external interfaces
call extend(all_values, ext_interfaces)
" Add external traits
call extend(all_values, ext_traits)
" Add built-in classes
call extend(all_values, builtin_classnames)
" Add built-in interfaces
call extend(all_values, builtin_interfaces)
" Add php keywords
call extend(all_values, builtin_keywords)
let final_list = []
let int_list = sort(keys(all_values))
for i in int_list
if has_key(ext_namespaces, i)
let final_list += [{'word':i, 'kind':'n', 'menu': ext_namespaces[i], 'info': ext_namespaces[i]}]
elseif has_key(int_functions, i)
let final_list +=
\ [{'word':i,
\ 'info':i.int_functions[i],
\ 'menu':int_functions[i],
\ 'kind':'f'}]
elseif has_key(ext_classes, i) || has_key(builtin_classnames, i)
let info = has_key(ext_classes, i) ? ext_classes[i] : builtin_classnames[i].' - builtin'
let final_list += [{'word':i, 'kind': 'c', 'menu': info, 'info': i.info}]
elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i)
let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin'
let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}]
elseif has_key(ext_traits, i)
let final_list += [{'word':i, 'kind': 't', 'menu': ext_traits[i], 'info': ext_traits[i]}]
elseif has_key(int_constants, i) || has_key(builtin_constants, i)
let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin'
let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}]
else
let final_list += [{'word':i}]
endif
endfor
return final_list
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteUnknownClass(base, context) " {{{
let res = []
if g:phpcomplete_complete_for_unknown_classes != 1
return []
endif
if a:base =~ '^\$'
let adddollar = '$'
else
let adddollar = ''
endif
let file = getline(1, '$')
" Internal solution for finding object properties in current file.
if a:context =~ '::'
let variables = filter(deepcopy(file),
\ 'v:val =~ "^\\s*\\(static\\|static\\s\\+\\(public\\|var\\)\\|\\(public\\|var\\)\\s\\+static\\)\\s\\+\\$"')
elseif a:context =~ '->'
let variables = filter(deepcopy(file),
\ 'v:val =~ "^\\s*\\(public\\|var\\)\\s\\+\\$"')
endif
let jvars = join(variables, ' ')
let svars = split(jvars, '\$')
let int_vars = {}
for i in svars
let c_var = matchstr(i,
\ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if c_var != ''
let int_vars[adddollar.c_var] = ''
endif
endfor
" Internal solution for finding functions in current file.
call filter(deepcopy(file),
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
let int_functions[f_name.'('] = f_args.')'
endfor
" collect external functions from tags
let ext_functions = {}
let tags = phpcomplete#GetTaglist('^'.substitute(a:base, '^\$', '', ''))
for tag in tags
if tag.kind ==? 'f'
let item = tag.name
if has_key(tag, 'signature')
let prototype = tag.signature[1:-2]
else
let prototype = matchstr(tag.cmd,
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
endif
let ext_functions[item.'('] = prototype.') - '.tag['filename']
endif
endfor
" All functions to one hash for later reference when deciding kind
call extend(int_functions, ext_functions)
let all_values = {}
call extend(all_values, int_functions)
call extend(all_values, int_vars) " external variables are already in
call extend(all_values, g:php_builtin_object_functions)
for m in sort(keys(all_values))
if m =~ '\(^\|::\)'.a:base
call add(res, m)
endif
endfor
let start_list = res
let final_list = []
for i in start_list
if has_key(int_vars, i)
let class = ' '
if all_values[i] != ''
let class = i.' class '
endif
let final_list += [{'word':i, 'info':class.all_values[i], 'kind':'v'}]
else
let final_list +=
\ [{'word':substitute(i, '.*::', '', ''),
\ 'info':i.all_values[i],
\ 'menu':all_values[i],
\ 'kind':'f'}]
endif
endfor
return final_list
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteVariable(base) " {{{
let res = []
" Internal solution for current file.
let file = getline(1, '$')
let jfile = join(file, ' ')
let int_vals = split(jfile, '\ze\$')
let int_vars = {}
for i in int_vals
if i =~? '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
else
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
endif
if val != ''
let int_vars[val] = ''
endif
endfor
call extend(int_vars, g:php_builtin_vars)
" ctags has support for PHP, use tags file for external variables
if g:phpcomplete_search_tags_for_variables
let ext_vars = {}
let tags = phpcomplete#GetTaglist('\C^'.substitute(a:base, '^\$', '', ''))
for tag in tags
if tag.kind ==? 'v'
let item = tag.name
let m_menu = ''
if tag.cmd =~? tag['name'].'\s*=\s*new\s\+'
let m_menu = matchstr(tag.cmd,
\ '\c=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
endif
let ext_vars['$'.item] = m_menu
endif
endfor
call extend(int_vars, ext_vars)
endif
for m in sort(keys(int_vars))
if m =~# '^\'.a:base
call add(res, m)
endif
endfor
let int_list = res
let int_dict = []
for i in int_list
if int_vars[i] != ''
let class = ' '
if int_vars[i] != ''
let class = i.' class '
endif
let int_dict += [{'word':i, 'info':class.int_vars[i], 'menu':int_vars[i], 'kind':'v'}]
else
let int_dict += [{'word':i, 'kind':'v'}]
endif
endfor
return int_dict
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) " {{{
let kinds = sort(a:kinds)
" Complete class name
let res = []
if a:base =~? '^\'
let leading_slash = '\'
let base = substitute(a:base, '^\', '', '')
else
let leading_slash = ''
let base = a:base
endif
" Internal solution for finding classes in current file.
let file = getline(1, '$')
let filterstr = ''
if kinds == ['c', 'i']
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['c', 'n']
let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['c']
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['i']
let filterstr = 'v:val =~? "interface\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
endif
call filter(file, filterstr)
for line in file
let c_name = matchstr(line, '\c\(class\|interface\)\s*\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
let kind = (line =~? '^\s*class' ? 'c' : 'i')
if c_name != '' && c_name =~? '^'.base
call add(res, {'word': c_name, 'kind': kind})
endif
endfor
" resolve the typed in part with namespaces (if theres a \ in it)
let [tag_match_pattern, namespace_for_class] = phpcomplete#ExpandClassName(a:base, a:current_namespace, a:imports)
let tags = []
if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
let tags = phpcomplete#GetTaglist('^\c'.tag_match_pattern)
endif
if len(tags)
let base_parts = split(a:base, '\')
if len(base_parts) > 1
let namespace_part = join(base_parts[0:-2], '\').'\'
else
let namespace_part = ''
endif
let no_namespace_matches = []
let namespaced_matches = []
let seen_namespaced_tag = 0
for tag in tags
if has_key(tag, 'namespace')
let seen_namespaced_tag = 1
endif
let relative_name = namespace_part.tag.name
" match base without the namespace part for namespaced base but not namespaced tags, for tagfiles with old ctags
if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tolower(tag.name), tolower(base[len(namespace_part):])) == 0
call add(no_namespace_matches, {'word': leading_slash.relative_name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
if has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && tag.namespace ==? namespace_for_class
let full_name = tag.namespace.'\'.tag.name " absolute namespaced name (without leading '\')
call add(namespaced_matches, {'word': leading_slash == '\' ? leading_slash.full_name : relative_name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
endfor
" if there was a tag with namespace field, assume tag files with namespace support, so the matches
" without a namespace field are in the global namespace so if there were namespace in the base
" we should not add them to the matches
if seen_namespaced_tag && namespace_part != ''
let no_namespace_matches = []
endif
let res += no_namespace_matches + namespaced_matches
endif
" look for built in classnames and interfaces
let base_parts = split(base, '\')
if a:current_namespace == '\' || (leading_slash == '\' && len(base_parts) < 2)
if index(kinds, 'c') != -1
let builtin_classnames = filter(keys(copy(g:php_builtin_classnames)), 'v:val =~? "^'.substitute(a:base, '\\', '', 'g').'"')
for classname in builtin_classnames
let menu = ''
" if we have a constructor for this class, add parameters as to the info
if has_key(g:php_builtin_classes[tolower(classname)].methods, '__construct')
let menu = g:php_builtin_classes[tolower(classname)]['methods']['__construct']['signature']
endif
call add(res, {'word': leading_slash.g:php_builtin_classes[tolower(classname)].name, 'kind': 'c', 'menu': menu})
endfor
endif
if index(kinds, 'i') != -1
let builtin_interfaces = filter(keys(copy(g:php_builtin_interfaces)), 'v:val =~? "^'.substitute(a:base, '\\', '', 'g').'"')
for interfacename in builtin_interfaces
call add(res, {'word': leading_slash.g:php_builtin_interfaces[interfacename]['name'], 'kind': 'i', 'menu': ''})
endfor
endif
endif
" add matching imported things
for [imported_name, import] in items(a:imports)
if imported_name =~? '^'.base && index(kinds, import.kind) != -1
let menu = import.name.(import.builtin ? ' - builtin' : '')
call add(res, {'word': imported_name, 'kind': import.kind, 'menu': menu})
endif
endfor
let res = sort(res, 'phpcomplete#CompareCompletionRow')
return res
endfunction
" }}}
1 0.000002 function! phpcomplete#CompareCompletionRow(i1, i2) " {{{
return a:i1.word == a:i2.word ? 0 : a:i1.word > a:i2.word ? 1 : -1
endfunction
" }}}
1 0.000003 function! s:getNextCharWithPos(filelines, current_pos) " {{{
let line_no = a:current_pos[0]
let col_no = a:current_pos[1]
let last_line = a:filelines[len(a:filelines) - 1]
let end_pos = [len(a:filelines) - 1, strlen(last_line) - 1]
if line_no > end_pos[0] || line_no == end_pos[0] && col_no > end_pos[1]
return ['EOF', 'EOF']
endif
" we've not reached the end of the current line break
if col_no + 1 < strlen(a:filelines[line_no])
let col_no += 1
else
" we've reached the end of the current line, jump to the next
" non-blank line (blank lines have no position where we can read from,
" not even a whitespace. The newline char does not positionable by vim
let line_no += 1
while strlen(a:filelines[line_no]) == 0
let line_no += 1
endwhile
let col_no = 0
endif
" return 'EOF' string to signal end of file, normal results only one char
" in length
if line_no == end_pos[0] && col_no > end_pos[1]
return ['EOF', 'EOF']
endif
return [[line_no, col_no], a:filelines[line_no][col_no]]
endfunction " }}}
1 0.000003 function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{
" if theres no modifier, and no modifier is allowed and no modifier is required
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
return 1
else
" check if every requred modifier is present
for required_modifier in a:required_modifiers
if index(a:modifiers, required_modifier) == -1
return 0
endif
endfor
for modifier in a:modifiers
" if the modifier is prohibited it's a no match
if index(a:prohibited_modifiers, modifier) != -1
return 0
endif
endfor
" anything that is not explicitly required or prohibited is allowed
return 1
endif
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " {{{
let final_list = []
let res = []
let required_modifiers = []
let prohibited_modifiers = []
if a:visibility == 'public'
let prohibited_modifiers += ['private', 'protected']
endif
" limit based on context to static or normal methods
let static_con = ''
if a:context =~ '::$' && a:context !~? 'parent::$'
if g:phpcomplete_relax_static_constraint != 1
let required_modifiers += ['static']
endif
elseif a:context =~ '->$'
let prohibited_modifiers += ['static']
endif
let all_function = filter(deepcopy(a:sccontent),
\ 'v:val =~ "^\\s*\\(public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)*function"')
let functions = []
for i in all_function
let modifiers = split(matchstr(tolower(i), '\zs.\+\zefunction'), '\s\+')
if phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) == 1
call add(functions, i)
endif
endfor
let c_functions = {}
let c_doc = {}
for i in functions
let f_name = matchstr(i,
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)')
if f_name != '' && stridx(f_name, '__') != 0
let c_functions[f_name.'('] = f_args
if g:phpcomplete_parse_docblock_comments
let c_doc[f_name.'('] = phpcomplete#GetDocBlock(a:sccontent, 'function\s*&\?\<'.f_name.'\>')
endif
endif
endfor
" limit based on context to static or normal attributes
if a:context =~ '::$' && a:context !~? 'parent::$'
" variables must have static to be accessed as static unlike functions
let required_modifiers += ['static']
endif
let all_variable = filter(deepcopy(a:sccontent),
\ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"')
let variables = []
for i in all_variable
let modifiers = split(matchstr(tolower(i), '\zs.\+\ze\$'), '\s\+')
if phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) == 1
call add(variables, i)
endif
endfor
let static_vars = split(join(variables, ' '), '\$')
let c_variables = {}
let var_index = 0
for i in static_vars
let c_var = matchstr(i,
\ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if c_var != ''
if a:context =~ '::$'
let c_var = '$'.c_var
endif
let c_variables[c_var] = ''
if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index)) > 0
let c_doc[c_var] = phpcomplete#GetDocBlock(a:sccontent, variables[var_index])
endif
let var_index += 1
endif
endfor
let constants = filter(deepcopy(a:sccontent),
\ 'v:val =~ "^\\s*const\\s\\+"')
let jcons = join(constants, ' ')
let scons = split(jcons, 'const')
let c_constants = {}
let const_index = 0
for i in scons
let c_con = matchstr(i,
\ '^\s*\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if c_con != ''
let c_constants[c_con] = ''
if g:phpcomplete_parse_docblock_comments && len(get(constants, const_index)) > 0
let c_doc[c_con] = phpcomplete#GetDocBlock(a:sccontent, constants[const_index])
endif
let const_index += 1
endif
endfor
let all_values = {}
call extend(all_values, c_functions)
call extend(all_values, c_variables)
call extend(all_values, c_constants)
for m in sort(keys(all_values))
if stridx(m, a:base) == 0
call add(res, m)
endif
endfor
let start_list = res
let final_list = []
for i in start_list
let docblock = phpcomplete#ParseDocBlock(get(c_doc, i, ''))
if has_key(c_variables, i)
let final_list +=
\ [{'word': i,
\ 'info':phpcomplete#FormatDocBlock(docblock),
\ 'menu':get(docblock.var, 'type', ''),
\ 'kind':'v'}]
elseif has_key(c_constants, i)
let info = phpcomplete#FormatDocBlock(docblock)
if info != ''
let info = "\n".info
endif
let final_list +=
\ [{'word':i,
\ 'info':i.info,
\ 'menu':all_values[i],
\ 'kind':'d'}]
else
let return_type = get(docblock.return, 'type', '')
if return_type != ''
let return_type = ' | '.return_type
endif
let info = phpcomplete#FormatDocBlock(docblock)
if info != ''
let info = "\n".info
endif
let final_list +=
\ [{'word':substitute(i, '.*::', '', ''),
\ 'info':i.all_values[i].')'.info,
\ 'menu':all_values[i].')'.return_type,
\ 'kind':'f'}]
endif
endfor
return final_list
endfunction
" }}}
1 0.000003 function! phpcomplete#CompleteBuiltInClass(context, classname, base) " {{{
let class_info = g:php_builtin_classes[tolower(a:classname)]
let res = []
if a:context =~ '->$' " complete for everything instance related
" methods
for [method_name, method_info] in items(class_info.methods)
if stridx(method_name, '__') != 0 && (a:base == '' || method_name =~? '^'.a:base)
call add(res, {'word':method_name.'(', 'kind': 'f', 'menu': method_info.signature, 'info': method_info.signature })
endif
endfor
" properties
for [property_name, property_info] in items(class_info.properties)
if a:base == '' || property_name =~? '^'.a:base
call add(res, {'word':property_name, 'kind': 'v', 'menu': property_info.type, 'info': property_info.type })
endif
endfor
elseif a:context =~ '::$' " complete for everything static
" methods
for [method_name, method_info] in items(class_info.static_methods)
if a:base == '' || method_name =~? '^'.a:base
call add(res, {'word':method_name.'(', 'kind': 'f', 'menu': method_info.signature, 'info': method_info.signature })
endif
endfor
" properties
for [property_name, property_info] in items(class_info.static_properties)
if a:base == '' || property_name =~? '^'.a:base
call add(res, {'word':property_name, 'kind': 'v', 'menu': property_info.type, 'info': property_info.type })
endif
endfor
" constants
for [constant_name, constant_info] in items(class_info.constants)
if a:base == '' || constant_name =~? '^'.a:base
call add(res, {'word':constant_name, 'kind': 'd', 'menu': constant_info, 'info': constant_info})
endif
endfor
endif
return res
endfunction
" }}}
1 0.000002 function! phpcomplete#GetTaglist(pattern) " {{{
let cache_checksum = ''
if g:phpcomplete_cache_taglists == 1
" build a string with format of "<tagfile>:<mtime>$<tagfile2>:<mtime2>..."
" to validate that the tags are not changed since the time we saved the results in cache
for tagfile in sort(tagfiles())
let cache_checksum .= fnamemodify(tagfile, ':p').':'.getftime(tagfile).'$'
endfor
if s:cache_tags_checksum != cache_checksum
" tag file(s) changed
" since we don't know where individual tags coming from when calling taglist() we zap the whole cache
" no way to clear only the entries originating from the changed tag file
let s:cache_tags = {}
endif
if has_key(s:cache_tags, a:pattern)
return s:cache_tags[a:pattern]
endif
endif
let tags = taglist(a:pattern)
for tag in tags
for prop in keys(tag)
if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin'
continue
endif
let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g')
endfor
endfor
let s:cache_tags[a:pattern] = tags
let has_key = has_key(s:cache_tags, a:pattern)
let s:cache_tags_checksum = cache_checksum
return tags
endfunction
" }}}
1 0.000002 function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) " {{{
" locate the current instruction (up until the previous non comment or string ";" or php region start (<?php or <?) without newlines
let col_number = a:col_number
let line_number = a:line_number
let line = getline(a:line_number)
let current_char = -1
let instruction = ''
let parent_depth = 0
let bracket_depth = 0
let stop_chars = [
\ '!', '@', '%', '^', '&',
\ '*', '/', '-', '+', '=',
\ ':', '>', '<', '.', '?',
\ ';', '(', '|', '['
\ ]
let phpbegin_length = len(matchstr(getline(a:phpbegin[0]), '\zs<?\(php\)\?\ze'))
let phpbegin_end = [a:phpbegin[0], a:phpbegin[1] - 1 + phpbegin_length]
" will hold the first place where a coma could have ended the match
let first_coma_break_pos = -1
let next_char = len(line) < col_number ? line[col_number + 1] : ''
while !(line_number == 1 && col_number == 1)
if current_char != -1
let next_char = current_char
endif
let current_char = line[col_number]
let synIDName = synIDattr(synID(line_number, col_number + 1, 0), 'name')
if col_number - 1 == -1
let prev_line_number = line_number - 1
let prev_line = getline(line_number - 1)
let prev_col_number = strlen(prev_line)
else
let prev_line_number = line_number
let prev_col_number = col_number - 1
let prev_line = line
endif
let prev_char = prev_line[prev_col_number]
" skip comments
if synIDName =~? 'comment\|phpDocTags'
let current_char = ''
endif
" break on the last char of the "and" and "or" operators
if synIDName == 'phpOperator' && (current_char == 'r' || current_char == 'd')
break
endif
" break on statements as "return" or "throws"
if synIDName == 'phpStatement' || synIDName == 'phpException'
break
endif
" if the current char should be considered
if current_char != '' && parent_depth >= 0 && bracket_depth >= 0 && synIDName !~? 'comment\|string'
" break if we are on a "naked" stop_char (operators, colon, openparent...)
if index(stop_chars, current_char) != -1
let do_break = 1
" dont break if it does look like a "->"
if (prev_char == '-' && current_char == '>') || (current_char == '-' && next_char == '>')
let do_break = 0
endif
" dont break if it does look like a "::"
if (prev_char == ':' && current_char == ':') || (current_char == ':' && next_char == ':')
let do_break = 0
endif
if do_break
break
endif
endif
" save the coma position for later use if theres a "naked" , possibly separating a parameter and it is not in a parented part
if first_coma_break_pos == -1 && current_char == ','
let first_coma_break_pos = len(instruction)
endif
endif
" count nested darenthesis and brackets so we can tell if we need to break on a ';' or not (think of for (;;) loops)
if synIDName =~? 'phpBraceFunc\|phpParent\|Delimiter'
if current_char == '('
let parent_depth += 1
elseif current_char == ')'
let parent_depth -= 1
elseif current_char == '['
let bracket_depth += 1
elseif current_char == ']'
let bracket_depth -= 1
endif
endif
" stop collecting chars if we see a function start { (think of first line in a function)
if (current_char == '{' || current_char == '}') && synIDName =~? 'phpBraceFunc\|phpParent\|Delimiter'
break
endif
" break if we are reached the php block start (<?php or <?)
if [line_number, col_number] == phpbegin_end
break
endif
let instruction = current_char.instruction
" step a char or a line back if we are on the first column of the line already
let col_number -= 1
if col_number == -1
let line_number -= 1
let line = getline(line_number)
let col_number = strlen(line)
endif
endwhile
" strip leading whitespace
let instruction = substitute(instruction, '^\s\+', '', '')
" there were a "naked" coma in the instruction
if first_coma_break_pos != -1
if instruction !~? '^use' && instruction !~? '^class' " use ... statements and class delcarations should not be broken up by comas
let pos = (-1 * first_coma_break_pos) + 1
let instruction = instruction[pos :]
endif
endif
" HACK to remove one line conditionals from code like "if ($foo) echo 'bar'"
" what the plugin really need is a proper php tokenizer
if instruction =~? '\c^\(if\|while\|foreach\|for\)\s*('
" clear everything up until the first (
let instruction = substitute(instruction, '^\(if\|while\|foreach\|for\)\s*(\s*', '', '')
" lets iterate trough the instruction until we can find the pair for the opening (
let i = 0
let depth = 1
while i < len(instruction)
if instruction[i] == '('
let depth += 1
endif
if instruction[i] == ')'
let depth -= 1
endif
if depth == 0
break
end
let i += 1
endwhile
let instruction = instruction[i + 1 : len(instruction)]
endif
" trim whitespace from the ends
let instruction = substitute(instruction, '\v^(^\s+)|(\s+)$', '', 'g')
return instruction
endfunction " }}}
1 0.000003 function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, imports, methodstack) " {{{
" Tries to get the classname and namespace for a chained method call like:
" $this->foo()->bar()->baz()->
let classname_candidate = a:classname_candidate
let class_candidate_namespace = a:class_candidate_namespace
let methodstack = a:methodstack
let unknown_result = ['', '']
let prev_method_is_array = (methodstack[0] =~ '\v^[^([]+\[' ? 1 : 0)
let classname_candidate_is_array = (classname_candidate =~ '\[\]$' ? 1 : 0)
if prev_method_is_array
if classname_candidate_is_array
let classname_candidate = substitute(classname_candidate, '\[\]$', '', '')
else
return unknown_result
endif
endif
if (len(methodstack) == 1)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, a:imports)
return [classname_candidate, class_candidate_namespace]
else
call remove(methodstack, 0)
let method_is_array = (methodstack[0] =~ '\v^[^[]+\[' ? 1 : 0)
let method = matchstr(methodstack[0], '\v^\$*\zs[^[(]+\ze')
let classlocation = phpcomplete#GetClassLocation(classname_candidate, class_candidate_namespace)
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname_candidate))
let class_info = g:php_builtin_classes[tolower(classname_candidate)]
if has_key(class_info['methods'], method)
return phpcomplete#GetCallChainReturnType(class_info['methods'][method].return_type, '\', a:imports, methodstack)
endif
if has_key(class_info['properties'], method)
return phpcomplete#GetCallChainReturnType(class_info['properties'][method].type, '\', a:imports, methodstack)
endif
if has_key(class_info['static_methods'], method)
return phpcomplete#GetCallChainReturnType(class_info['static_methods'][method].return_type, '\', a:imports, methodstack)
endif
if has_key(class_info['static_properties'], method)
return phpcomplete#GetCallChainReturnType(class_info['static_properties'][method].type, '\', a:imports, methodstack)
endif
return unknown_result
elseif classlocation != '' && filereadable(classlocation)
" Read the next method from the stack and extract only the name
let classcontents = phpcomplete#GetCachedClassContents(classlocation, classname_candidate)
" Get Structured information of all classes and subclasses including namespace and includes
" try to find the method's return type in docblock comment
for classstructure in classcontents
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
if doc_str != ''
break
endif
endfor
if doc_str != ''
let docblock = phpcomplete#ParseDocBlock(doc_str)
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
if type == ''
for property in docblock.properties
if property.description =~? method
let type = property.type
break
endif
endfor
endif
" there's a namespace in the type, threat the type as FQCN
if type =~ '\\'
let parts = split(substitute(type, '^\\', '', ''), '\')
let class_candidate_namespace = join(parts[0:-2], '\')
let classname_candidate = parts[-1]
" check for renamed namepsace in imports
if has_key(classstructure.imports, class_candidate_namespace)
let class_candidate_namespace = classstructure.imports[class_candidate_namespace].name
endif
else
" no namespace in the type, threat it as a relative classname
let returnclass = type
if has_key(classstructure.imports, returnclass)
if has_key(classstructure.imports[returnclass], 'namespace')
let fullnamespace = classstructure.imports[returnclass].namespace
else
let fullnamespace = class_candidate_namespace
endif
else
let fullnamespace = class_candidate_namespace
endif
" make @return self, static, $this the same way
" (not exactly what php means by these)
if returnclass == 'self' || returnclass == 'static' || returnclass == '$this' || returnclass == 'self[]' || returnclass == 'static[]' || returnclass == '$this[]'
if returnclass =~ '\[\]$'
let classname_candidate = a:classname_candidate.'[]'
else
let classname_candidate = a:classname_candidate
endif
let class_candidate_namespace = a:class_candidate_namespace
else
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(returnclass, fullnamespace, a:imports)
endif
endif
return phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, a:imports, methodstack)
endif
endif
return unknown_result
else
return unknown_result
endif
endif
endfunction " }}}
1 0.000002 function! phpcomplete#GetMethodStack(line) " {{{
let methodstack = []
let i = 0
let end = len(a:line)
let current_part = ''
let parent_depth = 0
let in_string = 0
let string_start = ''
let next_char = ''
while i < end
let current_char = a:line[i]
let next_char = i + 1 < end ? a:line[i + 1] : ''
let prev_char = i >= 1 ? a:line[i - 1] : ''
let prev_prev_char = i >= 2 ? a:line[i - 2] : ''
if in_string == 0 && parent_depth == 0 && ((current_char == '-' && next_char == '>') || (current_char == ':' && next_char == ':'))
call add(methodstack, current_part)
let current_part = ''
let i += 2
continue
endif
" if it's looks like a string
if current_char == "'" || current_char == '"'
" and it is not escaped
if prev_char != '\' || (prev_char == '\' && prev_prev_char == '\')
" and we are in a string already
if in_string
" and that string started with this char too
if current_char == string_start
" clear the string mark
let in_string = 0
endif
else " ... and we are not in a string
" set the string mark
let in_string = 1
let string_start = current_char
endif
endif
endif
if !in_string && a:line[i] == '('
let parent_depth += 1
endif
if !in_string && a:line[i] == ')'
let parent_depth -= 1
endif
let current_part .= current_char
let i += 1
endwhile
" add the last remaining part, this can be an empty string and this is expected
" the empty string represents the completion base (which happen to be an empty string)
if current_part != ''
call add(methodstack, current_part)
endif
return methodstack
endfunction
" }}}
1 0.000002 function! phpcomplete#GetClassName(start_line, context, current_namespace, imports) " {{{
" Get class name
" Class name can be detected in few ways:
" @var $myVar class
" @var class $myVar
" in the same line (php 5.4 (new Class)-> syntax)
" line above
" or line in tags file
let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
let function_name_pattern = '[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*'
let function_invocation_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*('
let variable_name_pattern = '\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
let classname_candidate = ''
let class_candidate_namespace = a:current_namespace
let class_candidate_imports = a:imports
let methodstack = phpcomplete#GetMethodStack(a:context)
if a:context =~? '\$this->' || a:context =~? '\(self\|static\)::' || a:context =~? 'parent::'
let i = 1
while i < a:start_line
let line = getline(a:start_line - i)
" Don't complete self:: or $this if outside of a class
" (assumes correct indenting)
if line =~ '^}'
return ''
endif
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class\s'
let class_name = matchstr(line, '\cclass\s\+\zs'.class_name_pattern.'\ze')
let extended_class = matchstr(line, '\cclass\s\+'.class_name_pattern.'\s\+extends\s\+\zs'.class_name_pattern.'\ze')
let classname_candidate = a:context =~? 'parent::' ? extended_class : class_name
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
endif
let i += 1
endwhile
elseif a:context =~? '(\s*new\s\+'.class_name_pattern.'\s*)->'
let classname_candidate = matchstr(a:context, '\cnew\s\+\zs'.class_name_pattern.'\ze')
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
elseif get(methodstack, 0) =~# function_invocation_pattern
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
if function_file == ''
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
endif
if function_file == 'VIMPHP_BUILTINFUNCTION'
" built in function, grab the return type from the info string
let return_type = matchstr(g:php_builtin_functions[function_name.'('], '\v\|\s+\zs.+$')
let classname_candidate = return_type
let class_candidate_namespace = '\'
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
endif
endif
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
else
" extract the variable name from the context
let object = methodstack[0]
let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0)
let object = matchstr(object, variable_name_pattern)
let function_boundary = phpcomplete#GetCurrentFunctionBoundaries()
let search_end_line = max([1, function_boundary[0][0]])
" -1 makes us ignore the current line (where the completion was invoked
let lines = reverse(getline(search_end_line, a:start_line - 1))
" check Constant lookup
let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
if constant_object != ''
let classname_candidate = constant_object
endif
if classname_candidate == ''
" scan the file backwards from current line for explicit type declaration (@var $variable Classname)
for line in lines
" in file lookup for /* @var $foo Class */
if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern
let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
" in file lookup for /* @var Class $foo */
if line =~# '@var\s\+'.class_name_pattern.'\s\+'.object
let classname_candidate = matchstr(line, '@var\s\+\zs'.class_name_pattern.'\(\[\]\)\?\ze'.'\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
endif
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
" scan the file backwards from the current line
let i = 1
for line in lines " {{{
" do in-file lookup of $var = new Class
if line =~# '^\s*'.object.'\s*=\s*new\s\+'.class_name_pattern && !object_is_array
let classname_candidate = matchstr(line, object.'\c\s*=\s*new\s*\zs'.class_name_pattern.'\ze')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
" in-file lookup for Class::getInstance()
if line =~# '^\s*'.object.'\s*=&\?\s*'.class_name_pattern.'\s*::\s*getInstance' && !object_is_array
let classname_candidate = matchstr(line, object.'\s*=&\?\s*\zs'.class_name_pattern.'\ze\s*::\s*getInstance')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
" do in-file lookup for static method invocation of a built-in class, like: $d = DateTime::createFromFormat()
if line =~# '^\s*'.object.'\s*=&\?\s*'.class_name_pattern.'\s*::\s*$\?[a-zA-Z_0-9\x7f-\xff]\+'
let classname = matchstr(line, '^\s*'.object.'\s*=&\?\s*\zs'.class_name_pattern.'\ze\s*::')
if has_key(a:imports, classname) && a:imports[classname].kind == 'c'
let classname = a:imports[classname].name
endif
if has_key(g:php_builtin_classes, tolower(classname))
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname, '\', {}, sub_methodstack)
return classname_candidate
else
" try to get the class name from the static method's docblock
let [classname, namespace_for_class] = phpcomplete#ExpandClassName(classname, a:current_namespace, a:imports)
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
\ classname,
\ namespace_for_class,
\ a:imports,
\ sub_methodstack)
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
endif
" function declaration line
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
let function_lines = join(reverse(copy(lines)), " ")
" search for type hinted arguments
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
let args = split(f_args, '\s*\zs,\ze\s*')
for arg in args
if arg =~# object.'\(,\|$\)'
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
if classname_candidate != ''
break
endif
endif
" search for docblock for the function
let match_line = substitute(line, '\\', '\\\\', 'g')
let sccontent = getline(0, a:start_line - i)
let doc_str = phpcomplete#GetDocBlock(sccontent, match_line)
if doc_str != ''
let docblock = phpcomplete#ParseDocBlock(doc_str)
for param in docblock.params
if param.name =~? object
let classname_candidate = matchstr(param.type, class_name_pattern.'\(\[\]\)\?')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
if classname_candidate != ''
break
endif
endif
endif
" assignment for the variable in question with a variable on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s\+\(clone\)\?\s*'.variable_name_pattern
" try to find the next non-comment or string ";" char
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
let filelines = reverse(copy(lines))
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
let chars_read = 1
let last_pos = pos
" function_boundary == 0 if we are not in a function
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
" read while end of the file
while char != 'EOF' && chars_read < 1000
let last_pos = pos
let [pos, char] = s:getNextCharWithPos(filelines, pos)
let chars_read += 1
" we got a candidate
if char == ';'
" pos values is relative to the function's lines,
" line 0 need to be offsetted with the line number
" where te function was started to get the line number
" in real buffer terms
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
" it's not a comment or string, end search
if synIDName !~? 'comment\|string'
break
endif
endif
endwhile
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
if prev_context == ''
" cannot get previous context give up
return
endif
let prev_class = phpcomplete#GetClassName(a:start_line - i, prev_context, a:current_namespace, a:imports)
if stridx(prev_class, '\') != -1
let classname_parts = split(prev_class, '\\\+')
let classname_candidate = classname_parts[-1]
let class_candidate_namespace = join(classname_parts[0:-2], '\')
else
let classname_candidate = prev_class
let class_candidate_namespace = '\'
endif
break
endif
" assignment for the variable in question with a function on the right hand side
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
" try to find the next non-comment or string ";" char
let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
let filelines = reverse(copy(lines))
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
let chars_read = 1
let last_pos = pos
" function_boundary == 0 if we are not in a function
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
" read while end of the file
while char != 'EOF' && chars_read < 1000
let last_pos = pos
let [pos, char] = s:getNextCharWithPos(filelines, pos)
let chars_read += 1
" we got a candidate
if char == ';'
" pos values is relative to the function's lines,
" line 0 need to be offsetted with the line number
" where te function was started to get the line number
" in real buffer terms
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
" it's not a comment or string, end search
if synIDName !~? 'comment\|string'
break
endif
endif
endwhile
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
if prev_context == ''
" cannot get previous context give up
return
endif
let function_name = matchstr(prev_context, '^'.function_invocation_pattern.'\ze')
let function_name = matchstr(function_name, '^\zs.\+\ze\s*($') " strip the trailing (
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
if function_file == ''
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
endif
if function_file == 'VIMPHP_BUILTINFUNCTION'
" built in function, grab the return type from the info string
let return_type = matchstr(g:php_builtin_functions[function_name.'('], '\v\|\s+\zs.+$')
let classname_candidate = return_type
let class_candidate_namespace = '\'
break
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
if has_key(docblock.return, 'type')
let classname_candidate = docblock.return.type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
break
endif
endif
endif
" foreach with the variable in question
if line =~? 'foreach\s*(.\{-}\s\+'.object.'\s*)'
let sub_context = matchstr(line, 'foreach\s*(\s*\zs.\{-}\ze\s\+as')
let prev_class = phpcomplete#GetClassName(a:start_line - i, sub_context, a:current_namespace, a:imports)
" t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment