Created
December 5, 2018 18:56
-
-
Save eknowlton/9be7287b001932f713eaf3f6cf483dd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FUNCTION airline#extensions#quickfix#inactive_qf_window() | |
Called 208 times | |
Total time: 0.001837 | |
Self time: 0.001837 | |
count total (s) self (s) | |
208 0.001182 if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', '')) | |
call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m') | |
endif | |
FUNCTION <SNR>29_GetLSPCompletions() | |
Called 29 times | |
Total time: 0.036243 | |
Self time: 0.000790 | |
count total (s) self (s) | |
29 0.000088 let l:buffer = bufnr('') | |
29 0.018606 0.000184 let l:lsp_details = ale#lsp_linter#StartLSP(l:buffer, a:linter) | |
29 0.000038 if empty(l:lsp_details) | |
return 0 | |
endif | |
29 0.000049 let l:id = l:lsp_details.connection_id | |
29 0.000170 let l:OnReady = function('s:OnReady', [a:linter, l:lsp_details]) | |
29 0.017169 0.000138 call ale#lsp#WaitForCapability(l:id, 'completion', l:OnReady) | |
FUNCTION phpcomplete#GetTaglist() | |
Called 323 times | |
Total time: 1.596026 | |
Self time: 1.596026 | |
count total (s) self (s) | |
323 0.000443 let cache_checksum = '' | |
323 0.000416 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 | |
646 0.069482 for tagfile in sort(tagfiles()) | |
323 0.009561 let cache_checksum .= fnamemodify(tagfile, ':p').':'.getftime(tagfile).'$' | |
323 0.000317 endfor | |
323 0.000678 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 | |
323 0.000844 if has_key(s:cache_tags, a:pattern) | |
316 0.000624 return s:cache_tags[a:pattern] | |
endif | |
7 0.000003 endif | |
7 1.217008 let tags = taglist(a:pattern) | |
9094 0.005057 for tag in tags | |
54522 0.049610 for prop in keys(tag) | |
45435 0.086420 if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin' | |
27261 0.017270 continue | |
endif | |
18174 0.066220 let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g') | |
18174 0.007641 endfor | |
9087 0.004017 endfor | |
7 0.000028 let s:cache_tags[a:pattern] = tags | |
7 0.000021 let has_key = has_key(s:cache_tags, a:pattern) | |
7 0.000031 let s:cache_tags_checksum = cache_checksum | |
7 0.000009 return tags | |
FUNCTION ale#events#LintOnEnter() | |
Called 104 times | |
Total time: 0.006448 | |
Self time: 0.001686 | |
count total (s) self (s) | |
" Unmark a file as being changed outside of Vim after we try to check it. | |
104 0.000378 call setbufvar(a:buffer, 'ale_file_changed', 0) | |
104 0.001677 0.000585 if ale#Var(a:buffer, 'enabled') && g:ale_lint_on_enter | |
104 0.004093 0.000424 call ale#Queue(0, 'lint_file', a:buffer) | |
104 0.000044 endif | |
FUNCTION ale#job#IsRunning() | |
Called 55 times | |
Total time: 0.000626 | |
Self time: 0.000626 | |
count total (s) self (s) | |
55 0.000118 if has('nvim') | |
55 0.000051 try | |
" In NeoVim, if the job isn't running, jobpid() will throw. | |
55 0.000157 call jobpid(a:job_id) | |
55 0.000043 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 | |
FUNCTION airline#util#exec_funcrefs() | |
Called 519 times | |
Total time: 0.355032 | |
Self time: 0.026344 | |
count total (s) self (s) | |
3320 0.003436 for Fn in a:list | |
3320 0.343218 0.014530 let code = call(Fn, a:000) | |
3320 0.002552 if code != 0 | |
519 0.000387 return code | |
endif | |
2801 0.001229 endfor | |
return 0 | |
FUNCTION airline#extensions#netrw#apply() | |
Called 311 times | |
Total time: 0.004268 | |
Self time: 0.004268 | |
count total (s) self (s) | |
311 0.000646 if &ft == 'netrw' | |
let spc = g:airline_symbols.space | |
call a:1.add_section('airline_a', spc.'netrw'.spc) | |
if exists('*airline#extensions#branch#get_head') | |
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) | |
endif | |
call a:1.add_section('airline_c', spc.'%f'.spc) | |
call a:1.split() | |
call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc) | |
return 1 | |
endif | |
FUNCTION AutoPairsSpace() | |
Called 3 times | |
Total time: 0.000092 | |
Self time: 0.000092 | |
count total (s) self (s) | |
3 0.000019 let line = getline('.') | |
3 0.000019 let prev_char = line[col('.')-2] | |
3 0.000003 let cmd = '' | |
3 0.000006 let cur_char =line[col('.')-1] | |
3 0.000025 if has_key(g:AutoPairsParens, prev_char) && g:AutoPairsParens[prev_char] == cur_char | |
let cmd = "\<SPACE>".s:Left | |
endif | |
3 0.000008 return "\<SPACE>".cmd | |
FUNCTION ale#lsp#RegisterCallback() | |
Called 55 times | |
Total time: 0.000868 | |
Self time: 0.000868 | |
count total (s) self (s) | |
55 0.000141 let l:conn = get(s:connections, a:conn_id, {}) | |
55 0.000061 if !empty(l:conn) | |
" Add the callback to the List if it's not there already. | |
55 0.000546 call uniq(sort(add(l:conn.callback_list, a:callback))) | |
55 0.000027 endif | |
FUNCTION <SNR>69_update_branch() | |
Called 1439 times | |
Total time: 0.291209 | |
Self time: 0.055755 | |
count total (s) self (s) | |
4317 0.008384 for vcs in keys(s:vcs_config) | |
2878 0.253267 0.017813 call {s:vcs_config[vcs].update_branch}() | |
2878 0.008525 if b:buffer_vcs_config[vcs].branch != s:vcs_config[vcs].branch | |
let b:buffer_vcs_config[vcs].branch = s:vcs_config[vcs].branch | |
unlet! b:airline_head | |
endif | |
2878 0.001887 endfor | |
FUNCTION airline#extensions#ale#get_error() | |
Called 1448 times | |
Total time: 0.146758 | |
Self time: 0.008416 | |
count total (s) self (s) | |
1448 0.146108 0.007765 return airline#extensions#ale#get('error') | |
FUNCTION ale#linter#Get() | |
Called 55 times | |
Total time: 0.018312 | |
Self time: 0.011186 | |
count total (s) self (s) | |
55 0.000127 let l:possibly_duplicated_linters = [] | |
" Handle dot-separated filetypes. | |
110 0.000554 for l:original_filetype in split(a:original_filetypes, '\.') | |
55 0.003420 0.000363 let l:filetype = ale#linter#ResolveFiletype(l:original_filetype) | |
55 0.001360 0.000293 let l:linter_names = s:GetLinterNames(l:original_filetype) | |
55 0.003244 0.000242 let l:all_linters = ale#linter#GetAll(l:filetype) | |
55 0.000066 let l:filetype_linters = [] | |
55 0.000148 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. | |
440 0.000367 for l:linter in l:all_linters | |
385 0.001151 let l:name_list = [l:linter.name] + l:linter.aliases | |
660 0.000581 for l:name in l:name_list | |
385 0.000719 if index(l:linter_names, l:name) >= 0 | |
110 0.000219 call add(l:filetype_linters, l:linter) | |
110 0.000091 break | |
endif | |
275 0.000127 endfor | |
385 0.000185 endfor | |
55 0.000049 endif | |
55 0.000115 call extend(l:possibly_duplicated_linters, l:filetype_linters) | |
55 0.000032 endfor | |
55 0.000073 let l:name_list = [] | |
55 0.000064 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. | |
165 0.000193 for l:linter in reverse(l:possibly_duplicated_linters) | |
110 0.000206 if index(l:name_list, l:linter.name) < 0 | |
110 0.000203 call add(l:name_list, l:linter.name) | |
110 0.000174 call add(l:combined_linters, l:linter) | |
110 0.000059 endif | |
110 0.000067 endfor | |
55 0.000088 return reverse(l:combined_linters) | |
FUNCTION <SNR>40_crend() | |
Called 4 times | |
Total time: 0.000049 | |
Self time: 0.000049 | |
count total (s) self (s) | |
4 0.000014 let n = "" | |
4 0.000017 if !exists("b:endwise_addition") || !exists("b:endwise_words") || !exists("b:endwise_syngroups") | |
4 0.000004 return n | |
endif | |
let synids = join(map(split(b:endwise_syngroups, ','), 'hlID(v:val)'), ',') | |
let wordchoice = '\%('.substitute(b:endwise_words,',','\\|','g').'\)' | |
if exists("b:endwise_pattern") | |
let beginpat = substitute(b:endwise_pattern,'&',substitute(wordchoice,'\\','\\&','g'),'g') | |
else | |
let beginpat = '\<'.wordchoice.'\>' | |
endif | |
let lnum = line('.') - 1 | |
let space = matchstr(getline(lnum),'^\s*') | |
let col = match(getline(lnum),beginpat) + 1 | |
let word = matchstr(getline(lnum),beginpat) | |
let endword = substitute(word,'.*',b:endwise_addition,'') | |
let y = n.endword."\<C-O>O" | |
if exists("b:endwise_end_pattern") | |
let endpat = '\w\@<!'.substitute(word, '.*', substitute(b:endwise_end_pattern, '\\', '\\\\', 'g'), '').'\w\@!' | |
elseif b:endwise_addition[0:1] ==# '\=' | |
let endpat = '\w\@<!'.endword.'\w\@!' | |
else | |
let endpat = '\w\@<!'.substitute('\w\+', '.*', b:endwise_addition, '').'\w\@!' | |
endif | |
let synidpat = '\%('.substitute(synids,',','\\|','g').'\)' | |
if a:always | |
return y | |
elseif col <= 0 || synID(lnum,col,1) !~ '^'.synidpat.'$' | |
return n | |
elseif getline('.') !~ '^\s*#\=$' | |
return n | |
endif | |
let line = s:mysearchpair(beginpat,endpat,synidpat) | |
" even is false if no end was found, or if the end found was less | |
" indented than the current line | |
let even = strlen(matchstr(getline(line),'^\s*')) >= strlen(space) | |
if line == 0 | |
let even = 0 | |
endif | |
if !even && line == line('.') + 1 | |
return y | |
endif | |
if even | |
return n | |
endif | |
return y | |
FUNCTION airline#check_mode() | |
Called 1459 times | |
Total time: 0.518493 | |
Self time: 0.127202 | |
count total (s) self (s) | |
1459 0.002867 if !has_key(s:contexts, a:winnr) | |
return '' | |
endif | |
1459 0.002887 let context = s:contexts[a:winnr] | |
1459 0.004232 if get(w:, 'airline_active', 1) | |
1448 0.004076 let l:m = mode(1) | |
1448 0.004056 if l:m ==# "i" | |
1024 0.003139 let l:mode = ['insert'] | |
1024 0.001054 elseif l:m[0] ==# "i" | |
175 0.000318 let l:mode = ['insert'] | |
175 0.000140 elseif l:m ==# "Rv" | |
let l:mode =['replace'] | |
elseif l:m[0] ==# "R" | |
let l:mode = ['replace'] | |
elseif l:m[0] =~# '\v(v|V||s|S|)' | |
let l:mode = ['visual'] | |
elseif l:m ==# "t" | |
let l:mode = ['terminal'] | |
elseif l:m[0] ==# "c" | |
2 0.000003 let l:mode = ['commandline'] | |
2 0.000002 elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode | |
let l:mode = ['normal'] | |
elseif l:m[0:1] ==# 'ni' | |
let l:mode = ['normal'] | |
let l:m = 'ni' | |
else | |
247 0.000359 let l:mode = ['normal'] | |
247 0.000109 endif | |
1448 0.006800 if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1 | |
1273 0.001971 let l:m = l:m[0] | |
1273 0.000607 endif | |
1448 0.004984 let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) | |
1448 0.000705 else | |
11 0.000021 let l:mode = ['inactive'] | |
11 0.000042 let w:airline_current_mode = get(g:airline_mode_map, '__') | |
11 0.000006 endif | |
1459 0.003258 if g:airline_detect_modified && &modified | |
1450 0.003207 call add(l:mode, 'modified') | |
1450 0.000725 endif | |
1459 0.001945 if g:airline_detect_paste && &paste | |
call add(l:mode, 'paste') | |
endif | |
1459 0.007263 if g:airline_detect_crypt && exists("+key") && !empty(&key) | |
call add(l:mode, 'crypt') | |
endif | |
1459 0.001838 if g:airline_detect_spell && &spell | |
call add(l:mode, 'spell') | |
endif | |
1459 0.001523 if &readonly || ! &modifiable | |
9 0.000024 call add(l:mode, 'readonly') | |
9 0.000005 endif | |
1459 0.005210 let mode_string = join(l:mode) | |
1459 0.004142 if get(w:, 'airline_lastmode', '') != mode_string | |
18 0.005847 0.000144 call airline#highlighter#highlight_modified_inactive(context.bufnr) | |
18 0.383982 0.000438 call airline#highlighter#highlight(l:mode, context.bufnr) | |
18 0.002154 0.000110 call airline#util#doautocmd('AirlineModeChanged') | |
18 0.000065 let w:airline_lastmode = mode_string | |
18 0.000011 endif | |
1459 0.000960 return '' | |
FUNCTION ale#uri#Decode() | |
Called 48 times | |
Total time: 0.000389 | |
Self time: 0.000389 | |
count total (s) self (s) | |
48 0.000327 return substitute( a:value, '%\(\x\x\)', '\=nr2char(''0x'' . submatch(1))', 'g') | |
FUNCTION airline#util#append() | |
Called 10073 times | |
Total time: 0.071180 | |
Self time: 0.071180 | |
count total (s) self (s) | |
10073 0.014898 if a:minwidth > 0 && winwidth(0) < a:minwidth | |
return '' | |
endif | |
10073 0.021939 let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc | |
10073 0.020064 return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text | |
FUNCTION <SNR>79_get_accented_line() | |
Called 3320 times | |
Total time: 0.138265 | |
Self time: 0.138265 | |
count total (s) self (s) | |
3320 0.003290 if a:self._context.active | |
" active window | |
2488 0.002731 let contents = [] | |
2488 0.014263 let content_parts = split(a:contents, '__accent') | |
6212 0.006937 for cpart in content_parts | |
3724 0.024563 let accent = matchstr(cpart, '_\zs[^#]*\ze') | |
3724 0.007744 call add(contents, cpart) | |
3724 0.002403 endfor | |
2488 0.008265 let line = join(contents, a:group) | |
2488 0.013502 let line = substitute(line, '__restore__', a:group, 'g') | |
2488 0.001175 else | |
" inactive window | |
832 0.010900 let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g') | |
832 0.004409 let line = substitute(line, '%#__restore__#', '', 'g') | |
832 0.000421 endif | |
3320 0.002605 return line | |
FUNCTION 8() | |
Called 519 times | |
Total time: 0.001721 | |
Self time: 0.001721 | |
count total (s) self (s) | |
519 0.001455 call add(self._sections, ['|', a:0 ? a:1 : '%=']) | |
FUNCTION ale#lsp#UpdateConfig() | |
Called 55 times | |
Total time: 0.000373 | |
Self time: 0.000373 | |
count total (s) self (s) | |
55 0.000161 let l:conn = get(s:connections, a:conn_id, {}) | |
55 0.000116 if empty(l:conn) || a:config ==# l:conn.config " no-custom-checks | |
55 0.000032 return 0 | |
endif | |
let l:conn.config = a:config | |
let l:message = ale#lsp#message#DidChangeConfiguration(a:buffer, a:config) | |
call ale#lsp#Send(a:conn_id, l:message) | |
return 1 | |
FUNCTION airline#extensions#branch#update_untracked_config() | |
Called 1439 times | |
Total time: 0.015002 | |
Self time: 0.015002 | |
count total (s) self (s) | |
1439 0.004188 if !has_key(s:vcs_config[a:vcs].untracked, a:file) | |
return | |
elseif s:vcs_config[a:vcs].untracked[a:file] != b:buffer_vcs_config[a:vcs].untracked | |
let b:buffer_vcs_config[a:vcs].untracked = s:vcs_config[a:vcs].untracked[a:file] | |
unlet! b:airline_head | |
endif | |
FUNCTION <SNR>80_get_section() | |
Called 4461 times | |
Total time: 0.124985 | |
Self time: 0.113094 | |
count total (s) self (s) | |
4461 0.008548 if has_key(s:section_truncate_width, a:key) | |
3112 0.006595 if winwidth(a:winnr) < s:section_truncate_width[a:key] | |
return '' | |
endif | |
3112 0.001207 endif | |
4461 0.005426 let spc = g:airline_symbols.space | |
4461 0.014140 if !exists('g:airline_section_{a:key}') | |
return '' | |
endif | |
4461 0.036908 0.025018 let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key}) | |
4461 0.023686 let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')] | |
4461 0.012762 return empty(text) ? '' : prefix.text.suffix | |
FUNCTION <SNR>84_RunJob() | |
Called 26 times | |
Total time: 0.235754 | |
Self time: 0.006743 | |
count total (s) self (s) | |
26 0.000038 let l:command = a:options.command | |
26 0.000038 if empty(l:command) | |
return 0 | |
endif | |
26 0.000045 let l:executable = a:options.executable | |
26 0.000028 let l:buffer = a:options.buffer | |
26 0.000026 let l:linter = a:options.linter | |
26 0.000033 let l:output_stream = a:options.output_stream | |
26 0.000034 let l:next_chain_index = a:options.next_chain_index | |
26 0.000031 let l:read_buffer = a:options.read_buffer | |
26 0.000045 let l:info = g:ale_buffer_info[l:buffer] | |
26 0.003144 0.000176 let [l:temporary_file, l:command] = ale#command#FormatCommand( l:buffer, l:executable, l:command, l:read_buffer,) | |
26 0.159832 0.000554 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. | |
26 0.000100 let l:read_buffer = 0 | |
26 0.000037 endif | |
" Add a newline to commands which need it. | |
" This is only used for Flow for now, and is not documented. | |
26 0.000052 if l:linter.add_newline | |
if has('win32') | |
let l:command = l:command . '; echo.' | |
else | |
let l:command = l:command . '; echo' | |
endif | |
endif | |
26 0.002307 0.000277 let l:command = ale#job#PrepareCommand(l:buffer, l:command) | |
26 0.000177 let l:job_options = { 'mode': 'nl', 'exit_cb': function('s:HandleExit'),} | |
26 0.000040 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 | |
26 0.000119 let l:job_options.out_cb = function('s:GatherOutput') | |
26 0.000012 endif | |
26 0.000077 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 | |
26 0.059557 0.000744 let l:job_id = ale#job#Start(l:command, l:job_options) | |
26 0.000018 endif | |
26 0.000050 let l:status = 'failed' | |
" Only proceed if the job is being run. | |
26 0.000020 if l:job_id | |
" Add the job to the list of jobs, so we can track them. | |
26 0.000188 call add(l:info.job_list, l:job_id) | |
26 0.000168 if index(l:info.active_linter_list, l:linter.name) < 0 | |
26 0.000099 call add(l:info.active_linter_list, l:linter.name) | |
26 0.000013 endif | |
26 0.000032 let l:status = 'started' | |
" Store the ID for the job in the map to read back again. | |
26 0.000374 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,} | |
26 0.003644 0.001318 silent doautocmd <nomodeline> User ALEJobStarted | |
26 0.000016 endif | |
26 0.000032 if g:ale_history_enabled | |
26 0.003856 0.000259 call ale#history#Add(l:buffer, l:status, l:job_id, l:command) | |
26 0.000014 endif | |
26 0.000057 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 | |
26 0.000079 return l:job_id != 0 | |
FUNCTION airline#themes#get_highlight() | |
Called 6472 times | |
Total time: 0.697597 | |
Self time: 0.039327 | |
count total (s) self (s) | |
6472 0.695618 0.037347 return call('airline#highlighter#get_highlight', [a:group] + a:000) | |
FUNCTION <SNR>111_ShouldIgnore() | |
Called 48 times | |
Total time: 0.000969 | |
Self time: 0.000450 | |
count total (s) self (s) | |
48 0.000788 0.000269 let l:config = ale#Var(a:buffer, 'linters_ignore') | |
" Don't load code for ignoring diagnostics if there's nothing to ignore. | |
48 0.000068 if empty(l:config) | |
48 0.000029 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 | |
FUNCTION ale#highlight#RemoveHighlights() | |
Called 390 times | |
Total time: 0.008954 | |
Self time: 0.008954 | |
count total (s) self (s) | |
908 0.003014 for l:match in getmatches() | |
518 0.002131 if l:match.group =~# '^ALE' | |
511 0.000991 call matchdelete(l:match.id) | |
511 0.000271 endif | |
518 0.000449 endfor | |
FUNCTION <SNR>79_get_transitioned_seperator() | |
Called 2801 times | |
Total time: 1.272395 | |
Self time: 0.069367 | |
count total (s) self (s) | |
2801 0.002777 let line = '' | |
2801 0.008945 if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side | |
call airline#highlighter#add_separator(a:prev_group, a:group, 0) | |
let line .= '%#'.a:prev_group.'_to_'.a:group.'#' | |
let line .= a:self._context.right_sep.'%#'.a:group.'#' | |
else | |
2801 1.215263 0.012235 call airline#highlighter#add_separator(a:prev_group, a:group, a:side) | |
2801 0.010527 let line .= '%#'.a:prev_group.'_to_'.a:group.'#' | |
2801 0.008008 let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep | |
2801 0.005960 let line .= '%#'.a:group.'#' | |
2801 0.001215 endif | |
2801 0.002179 return line | |
FUNCTION ale#sign#FindCurrentSigns() | |
Called 74 times | |
Total time: 0.012241 | |
Self time: 0.001048 | |
count total (s) self (s) | |
74 0.002460 0.000422 let l:line_list = ale#sign#ReadSigns(a:buffer) | |
74 0.009655 0.000500 return ale#sign#ParseSigns(l:line_list) | |
FUNCTION airline#extensions#denite#apply() | |
Called 311 times | |
Total time: 0.004137 | |
Self time: 0.004137 | |
count total (s) self (s) | |
311 0.000983 if &ft == 'denite' | |
let w:airline_skip_empty_sections = 0 | |
call a:1.add_section('airline_a', ' Denite %{airline#extensions#denite#check_denite_mode('.a:2['bufnr'].')}') | |
call a:1.add_section('airline_c', ' %{denite#get_status_sources()}') | |
call a:1.split() | |
call a:1.add_section('airline_y', ' %{denite#get_status_path()} ') | |
call a:1.add_section('airline_z', ' %{denite#get_status_linenr()} ') | |
return 1 | |
endif | |
FUNCTION phpcomplete#CompleteVariable() | |
Called 12 times | |
Total time: 0.007782 | |
Self time: 0.007782 | |
count total (s) self (s) | |
12 0.000022 let res = [] | |
" Internal solution for current file. | |
12 0.000145 let file = getline(1, '$') | |
12 0.000259 let jfile = join(file, ' ') | |
12 0.000279 let int_vals = split(jfile, '\ze\$') | |
12 0.000015 let int_vars = {} | |
211 0.000170 for i in int_vals | |
199 0.001504 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 | |
199 0.001218 let val = matchstr(i, '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*') | |
199 0.000085 endif | |
199 0.000189 if val != '' | |
186 0.000254 let int_vars[val] = '' | |
186 0.000071 endif | |
199 0.000093 endfor | |
12 0.000153 call extend(int_vars, g:php_builtin_vars) | |
" ctags has support for PHP, use tags file for external variables | |
12 0.000017 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 | |
270 0.000337 for m in sort(keys(int_vars)) | |
258 0.000772 if m =~# '^\'.a:base | |
58 0.000103 call add(res, m) | |
58 0.000025 endif | |
258 0.000103 endfor | |
12 0.000015 let int_list = res | |
12 0.000012 let int_dict = [] | |
70 0.000053 for i in int_list | |
58 0.000082 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 | |
58 0.000186 let int_dict += [{'word':i, 'kind':'v'}] | |
58 0.000032 endif | |
58 0.000032 endfor | |
12 0.000011 return int_dict | |
FUNCTION phpcomplete#GetClassContentsStructure() | |
Called 1 time | |
Total time: 0.148342 | |
Self time: 0.002083 | |
count total (s) self (s) | |
" returns dictionary containing content, namespace and imports for the class and all parent classes. | |
" Example: | |
" [ | |
" { | |
" class: 'foo', | |
" content: '... class foo extends bar ... ', | |
" namespace: 'NS\Foo', | |
" imports : { ... }, | |
" file: '/foo.php', | |
" mtime: 42, | |
" }, | |
" { | |
" class: 'bar', | |
" content: '... class bar extends baz ... ', | |
" namespace: 'NS\Bar', | |
" imports : { ... } | |
" file: '/bar.php', | |
" mtime: 42, | |
" }, | |
" ... | |
" ] | |
" | |
1 0.000010 let full_file_path = fnamemodify(a:file_path, ':p') | |
1 0.000002 let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' | |
1 0.000032 let cfile = join(a:file_lines, "\n") | |
1 0.000001 let result = [] | |
" We use new buffer and (later) normal! because | |
" this is the most efficient way. The other way | |
" is to go through the looong string looking for | |
" matching {} | |
" remember the window we started at | |
1 0.000002 let phpcomplete_original_window = winnr() | |
1 0.020949 0.000161 silent! below 1new | |
1 0.000172 silent! 0put =cfile | |
1 0.000084 call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)') | |
1 0.000003 let cfline = line('.') | |
1 0.000003 call search('{') | |
1 0.000001 let endline = line('.') | |
1 0.000005 let content = join(getline(cfline, endline), "\n") | |
" Catch extends | |
1 0.000003 if content =~? 'extends' | |
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)') | |
let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")') | |
else | |
1 0.000001 let extended_classes = '' | |
1 0.000001 endif | |
" Catch implements | |
1 0.000003 if content =~? 'implements' | |
let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze') | |
let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")') | |
else | |
1 0.000001 let implemented_interfaces = [] | |
1 0.000000 endif | |
1 0.000161 call searchpair('{', '', '}', 'W') | |
1 0.000002 let class_closing_bracket_line = line('.') | |
" Include class docblock | |
1 0.000001 let doc_line = cfline - 1 | |
1 0.000004 if getline(doc_line) =~? '^\s*\*/' | |
while doc_line != 0 | |
if getline(doc_line) =~? '^\s*/\*\*' | |
let cfline = doc_line | |
break | |
endif | |
let doc_line -= 1 | |
endwhile | |
endif | |
1 0.000022 let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") | |
1 0.000001 let used_traits = [] | |
" move back to the line next to the class's definition | |
1 0.000002 call cursor(endline + 1, 1) | |
1 0.000001 let keep_searching = 1 | |
3 0.000003 while keep_searching != 0 | |
" try to grab "use..." keywords | |
2 0.000065 let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line) | |
2 0.000010 let syn_name = synIDattr(synID(lnum, col, 0), "name") | |
2 0.000008 if syn_name =~? 'string\|comment' | |
call cursor(lnum + 1, 1) | |
continue | |
endif | |
2 0.000004 let trait_line = getline(lnum) | |
2 0.000005 if trait_line !~? ';' | |
" try to find the next line containing ';' | |
1 0.000001 let l = lnum | |
1 0.000001 let search_line = trait_line | |
" add lines from the file until theres no ';' in them | |
1 0.000002 while search_line !~? ';' && l > 0 | |
" file lines are reversed so we need to go backwards | |
let l += 1 | |
let search_line = getline(l) | |
let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') | |
endwhile | |
1 0.000000 endif | |
2 0.000019 let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;') | |
2 0.000018 let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') | |
2 0.000011 let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")') | |
2 0.000004 call cursor(lnum + 1, 1) | |
2 0.000005 if [lnum, col] == [0, 0] | |
1 0.000001 let keep_searching = 0 | |
1 0.000000 endif | |
2 0.000001 endwhile | |
1 0.025258 0.000811 silent! bw! % | |
1 0.048690 0.000034 let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline]) | |
" go back to original window | |
1 0.000005 exe phpcomplete_original_window.'wincmd w' | |
1 0.000019 call add(result, { 'class': a:class_name, 'content': classcontent, 'namespace': current_namespace, 'imports': imports, 'file': full_file_path, 'mtime': getftime(full_file_path), }) | |
1 0.000002 let all_extends = used_traits | |
1 0.000002 if len(extended_classes) > 0 | |
call extend(all_extends, extended_classes) | |
endif | |
1 0.000002 if len(implemented_interfaces) > 0 | |
call extend(all_extends, implemented_interfaces) | |
endif | |
1 0.000001 if len(all_extends) > 0 | |
2 0.000003 for class in all_extends | |
1 0.000076 0.000011 let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports) | |
1 0.000001 if namespace == '' | |
let namespace = '\' | |
endif | |
1 0.052316 0.000013 let classlocation = phpcomplete#GetClassLocation(class, namespace) | |
1 0.000001 if classlocation == "VIMPHP_BUILTINOBJECT" | |
if has_key(g:php_builtin_classes, tolower(class)) | |
let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])] | |
endif | |
if has_key(g:php_builtin_interfaces, tolower(class)) | |
let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])] | |
endif | |
elseif classlocation != '' && filereadable(classlocation) | |
let full_file_path = fnamemodify(classlocation, ':p') | |
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class) | |
elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1 | |
" try to find the declaration in the same file. | |
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class) | |
endif | |
1 0.000001 endfor | |
1 0.000000 endif | |
1 0.000001 return result | |
FUNCTION ale#sign#GetSignName() | |
Called 122 times | |
Total time: 0.005322 | |
Self time: 0.002916 | |
count total (s) self (s) | |
122 0.000218 let l:priority = g:ale#util#style_warning_priority | |
" Determine the highest priority item for the line. | |
290 0.000274 for l:item in a:sublist | |
168 0.003077 0.000671 let l:item_priority = ale#util#GetItemPriority(l:item) | |
168 0.000170 if l:item_priority > l:priority | |
122 0.000127 let l:priority = l:item_priority | |
122 0.000056 endif | |
168 0.000100 endfor | |
122 0.000142 if l:priority is# g:ale#util#error_priority | |
122 0.000098 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' | |
FUNCTION ale#list#SetLists() | |
Called 74 times | |
Total time: 0.002852 | |
Self time: 0.001697 | |
count total (s) self (s) | |
74 0.000431 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 | |
74 0.001884 0.000730 call ale#util#StartPartialTimer( 0, function('s:SetListsImpl'), [a:buffer, a:loclist],) | |
74 0.000036 endif | |
FUNCTION airline#util#has_fugitive() | |
Called 1439 times | |
Total time: 0.004733 | |
Self time: 0.004733 | |
count total (s) self (s) | |
1439 0.004144 return exists('*fugitive#head') || exists('*FugitiveHead') | |
FUNCTION ale#lsp#HandleMessage() | |
Called 1902 times | |
Total time: 0.744716 | |
Self time: 0.130838 | |
count total (s) self (s) | |
1902 0.007722 let l:conn = get(s:connections, a:conn_id, {}) | |
1902 0.002686 if empty(l:conn) | |
return | |
endif | |
1902 0.003793 if type(a:message) isnot v:t_string | |
" Ignore messages that aren't strings. | |
return | |
endif | |
1902 0.004130 let l:conn.data .= a:message | |
" Parse the objects now if we can, and keep the remaining text. | |
1902 0.224698 0.016676 let [l:conn.data, l:response_list] = ale#lsp#ReadMessageData(l:conn.data) | |
" Look for initialize responses first. | |
1902 0.002152 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. | |
1902 0.001446 if l:conn.initialized | |
4418 0.004519 for l:response in l:response_list | |
" Call all of the registered handlers with the response. | |
7548 0.009368 for l:Callback in l:conn.callback_list | |
5032 0.437463 0.031607 call ale#util#GetFunction(l:Callback)(a:conn_id, l:response) | |
5032 0.003266 endfor | |
2516 0.001378 endfor | |
1902 0.000933 endif | |
FUNCTION ale#highlight#UpdateHighlights() | |
Called 288 times | |
Total time: 0.041817 | |
Self time: 0.031262 | |
count total (s) self (s) | |
288 0.001611 let l:item_list = get(b:, 'ale_enabled', 1) && g:ale_enabled ? get(b:, 'ale_highlight_items', []) : [] | |
288 0.009476 0.001310 call ale#highlight#RemoveHighlights() | |
799 0.000845 for l:item in l:item_list | |
511 0.000726 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 | |
511 0.000560 let l:group = 'ALEError' | |
511 0.000228 endif | |
511 0.000580 let l:line = l:item.lnum | |
511 0.000544 let l:col = l:item.col | |
511 0.001140 let l:end_line = get(l:item, 'end_lnum', l:line) | |
511 0.001087 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. | |
511 0.006987 0.004599 call map( ale#highlight#CreatePositions(l:line, l:col, l:end_line, l:end_col), 'matchaddpos(l:group, v:val)') | |
511 0.000267 endfor | |
" If highlights are enabled and signs are not enabled, we should still | |
" offer line highlights by adding a separate set of highlights. | |
288 0.000320 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 | |
FUNCTION ale#completion#GetPrefix() | |
Called 45 times | |
Total time: 0.002937 | |
Self time: 0.001484 | |
count total (s) self (s) | |
45 0.001895 0.000442 let l:regex = s:GetFiletypeValue(s:should_complete_map, a:filetype) | |
" The column we're using completions for is where we are inserting text, | |
" like so: | |
" abc | |
" ^ | |
" So we need check the text in the column before that position. | |
45 0.000861 return matchstr(getline(a:line)[: a:column - 2], l:regex) | |
FUNCTION <SNR>76_GetHiCmd() | |
Called 350 times | |
Total time: 0.027954 | |
Self time: 0.027954 | |
count total (s) self (s) | |
" a:list needs to have 5 items! | |
350 0.000340 let res = '' | |
350 0.000316 let i = -1 | |
2100 0.001454 while i < 4 | |
1750 0.001481 let i += 1 | |
1750 0.003471 let item = get(a:list, i, '') | |
1750 0.001742 if item is '' | |
642 0.000553 continue | |
endif | |
1108 0.000738 if i == 0 | |
192 0.000402 let res .= ' guifg='.item | |
192 0.000125 elseif i == 1 | |
170 0.000309 let res .= ' guibg='.item | |
170 0.000095 elseif i == 2 | |
350 0.000746 let res .= ' ctermfg='.item | |
350 0.000226 elseif i == 3 | |
328 0.000659 let res .= ' ctermbg='.item | |
328 0.000240 elseif i == 4 | |
68 0.000279 let res .= printf(' gui=%s cterm=%s term=%s', item, item, item) | |
68 0.000032 endif | |
1108 0.000613 endwhile | |
350 0.000309 return res | |
FUNCTION phpcomplete#GetCurrentInstruction() | |
Called 65 times | |
Total time: 0.407640 | |
Self time: 0.407640 | |
count total (s) self (s) | |
" locate the current instruction (up until the previous non comment or string ";" or php region start (<?php or <?) without newlines | |
65 0.000117 let col_number = a:col_number | |
65 0.000084 let line_number = a:line_number | |
65 0.000123 let line = getline(a:line_number) | |
65 0.000074 let current_char = -1 | |
65 0.000062 let instruction = '' | |
65 0.000059 let parent_depth = 0 | |
65 0.000061 let bracket_depth = 0 | |
65 0.000306 let stop_chars = [ '!', '@', '%', '^', '&', '*', '/', '-', '+', '=', ':', '>', '<', '.', '?', ';', '(', '|', '[' ] | |
65 0.000624 let phpbegin_length = len(matchstr(getline(a:phpbegin[0]), '\zs<?\(php\)\?\ze')) | |
65 0.000177 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 | |
65 0.000078 let first_coma_break_pos = -1 | |
65 0.000191 let next_char = len(line) < col_number ? line[col_number + 1] : '' | |
1529 0.001910 while !(line_number == 1 && col_number == 1) | |
1529 0.001476 if current_char != -1 | |
1464 0.001658 let next_char = current_char | |
1464 0.000656 endif | |
1529 0.002386 let current_char = line[col_number] | |
1529 0.279753 let synIDName = synIDattr(synID(line_number, col_number + 1, 0), 'name') | |
1529 0.001736 if col_number - 1 == -1 | |
76 0.000094 let prev_line_number = line_number - 1 | |
76 0.000156 let prev_line = getline(line_number - 1) | |
76 0.000146 let prev_col_number = strlen(prev_line) | |
76 0.000040 else | |
1453 0.001709 let prev_line_number = line_number | |
1453 0.001703 let prev_col_number = col_number - 1 | |
1453 0.001633 let prev_line = line | |
1453 0.000650 endif | |
1529 0.002558 let prev_char = prev_line[prev_col_number] | |
" skip comments | |
1529 0.008123 if synIDName =~? 'comment\|phpDocTags' | |
let current_char = '' | |
endif | |
" break on the last char of the "and" and "or" operators | |
1529 0.002621 if synIDName == 'phpOperator' && (current_char == 'r' || current_char == 'd') | |
break | |
endif | |
" break on statements as "return" or "throws" | |
1529 0.002770 if synIDName == 'phpStatement' || synIDName == 'phpException' | |
break | |
endif | |
" if the current char should be considered | |
1529 0.008711 if current_char != '' && parent_depth >= 0 && bracket_depth >= 0 && synIDName !~? 'comment\|string' | |
" break if we are on a "naked" stop_char (operators, colon, openparent...) | |
1453 0.003552 if index(stop_chars, current_char) != -1 | |
72 0.000084 let do_break = 1 | |
" dont break if it does look like a "->" | |
72 0.000178 if (prev_char == '-' && current_char == '>') || (current_char == '-' && next_char == '>') | |
68 0.000056 let do_break = 0 | |
68 0.000029 endif | |
" dont break if it does look like a "::" | |
72 0.000144 if (prev_char == ':' && current_char == ':') || (current_char == ':' && next_char == ':') | |
let do_break = 0 | |
endif | |
72 0.000043 if do_break | |
4 0.000002 break | |
endif | |
68 0.000024 endif | |
" save the coma position for later use if theres a "naked" , possibly separating a parameter and it is not in a parented part | |
1449 0.002321 if first_coma_break_pos == -1 && current_char == ',' | |
let first_coma_break_pos = len(instruction) | |
endif | |
1449 0.000565 endif | |
" count nested darenthesis and brackets so we can tell if we need to break on a ';' or not (think of for (;;) loops) | |
1525 0.008968 if synIDName =~? 'phpBraceFunc\|phpParent\|Delimiter' | |
61 0.000064 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 | |
61 0.000023 endif | |
" stop collecting chars if we see a function start { (think of first line in a function) | |
1525 0.003453 if (current_char == '{' || current_char == '}') && synIDName =~? 'phpBraceFunc\|phpParent\|Delimiter' | |
61 0.000047 break | |
endif | |
" break if we are reached the php block start (<?php or <?) | |
1464 0.002816 if [line_number, col_number] == phpbegin_end | |
break | |
endif | |
1464 0.002742 let instruction = current_char.instruction | |
" step a char or a line back if we are on the first column of the line already | |
1464 0.001603 let col_number -= 1 | |
1464 0.001033 if col_number == -1 | |
76 0.000079 let line_number -= 1 | |
76 0.000140 let line = getline(line_number) | |
76 0.000133 let col_number = strlen(line) | |
76 0.000033 endif | |
1464 0.000866 endwhile | |
" strip leading whitespace | |
65 0.000521 let instruction = substitute(instruction, '^\s\+', '', '') | |
" there were a "naked" coma in the instruction | |
65 0.000084 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 | |
65 0.000365 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 | |
65 0.000586 let instruction = substitute(instruction, '\v^(^\s+)|(\s+)$', '', 'g') | |
65 0.000092 return instruction | |
FUNCTION ale#job#Start() | |
Called 26 times | |
Total time: 0.058813 | |
Self time: 0.058672 | |
count total (s) self (s) | |
26 0.000288 0.000148 call ale#job#ValidateArguments(a:command, a:options) | |
26 0.000089 let l:job_info = copy(a:options) | |
26 0.000039 let l:job_options = {} | |
26 0.000061 if has('nvim') | |
26 0.000046 if has_key(a:options, 'out_cb') | |
26 0.000106 let l:job_options.on_stdout = function('s:NeoVimCallback') | |
26 0.000046 let l:job_info.out_cb_line = '' | |
26 0.000012 endif | |
26 0.000039 if has_key(a:options, 'err_cb') | |
let l:job_options.on_stderr = function('s:NeoVimCallback') | |
let l:job_info.err_cb_line = '' | |
endif | |
26 0.000038 if has_key(a:options, 'exit_cb') | |
26 0.000076 let l:job_options.on_exit = function('s:NeoVimCallback') | |
26 0.000011 endif | |
26 0.055782 let l:job_info.job = jobstart(a:command, l:job_options) | |
26 0.000226 let l:job_id = l:job_info.job | |
26 0.000029 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 | |
" Use non-blocking writes for Vim versions that support the option. | |
if has('patch-8.1.350') | |
let l:job_options.noblock = 1 | |
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 | |
26 0.000038 if l:job_id > 0 | |
" Store the job in the map for later only if we can get the ID. | |
26 0.000153 let s:job_map[l:job_id] = l:job_info | |
26 0.000015 endif | |
26 0.000073 return l:job_id | |
FUNCTION airline#parts#filetype() | |
Called 1459 times | |
Total time: 0.006454 | |
Self time: 0.006454 | |
count total (s) self (s) | |
1459 0.005846 return winwidth(0) < 90 && strlen(&filetype) > 3 ? matchstr(&filetype, '...'). (&encoding is? 'utf-8' ? '…' : '>') : &filetype | |
FUNCTION airline#parts#iminsert() | |
Called 1439 times | |
Total time: 0.006649 | |
Self time: 0.006649 | |
count total (s) self (s) | |
1439 0.002618 if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name') | |
return toupper(b:keymap_name) | |
endif | |
1439 0.000735 return '' | |
FUNCTION ale#lsp_linter#StartLSP() | |
Called 55 times | |
Total time: 0.034448 | |
Self time: 0.007575 | |
count total (s) self (s) | |
55 0.000065 let l:command = '' | |
55 0.000048 let l:address = '' | |
55 0.011894 0.000488 let l:root = ale#util#GetFunction(a:linter.project_root_callback)(a:buffer) | |
55 0.000112 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 | |
55 0.000984 0.000309 let l:init_options = ale#lsp_linter#GetOptions(a:buffer, a:linter) | |
55 0.000078 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 | |
55 0.003077 0.000241 let l:executable = ale#linter#GetExecutable(a:buffer, a:linter) | |
55 0.000970 if empty(l:executable) || !executable(l:executable) | |
return {} | |
endif | |
55 0.001390 0.000391 let l:conn_id = ale#lsp#Register(l:executable, l:root, l:init_options) | |
55 0.000464 0.000225 let l:command = ale#linter#GetCommand(a:buffer, a:linter) | |
" Format the command, so %e can be formatted into it. | |
55 0.004180 0.000389 let l:command = ale#command#FormatCommand(a:buffer, l:executable, l:command, 0)[1] | |
55 0.002942 0.000341 let l:command = ale#job#PrepareCommand(a:buffer, l:command) | |
55 0.002238 0.000318 let l:ready = ale#lsp#StartProgram(l:conn_id, l:executable, l:command) | |
55 0.000022 endif | |
55 0.000036 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. | |
55 0.000078 if a:linter.lsp is# 'tsserver' | |
call ale#lsp#MarkConnectionAsTsserver(l:conn_id) | |
endif | |
55 0.000793 0.000228 let l:config = ale#lsp_linter#GetConfig(a:buffer, a:linter) | |
55 0.000857 0.000472 let l:language_id = ale#util#GetFunction(a:linter.language_callback)(a:buffer) | |
55 0.000285 let l:details = { 'buffer': a:buffer, 'connection_id': l:conn_id, 'command': l:command, 'project_root': l:root, 'language_id': l:language_id,} | |
55 0.000611 0.000237 call ale#lsp#UpdateConfig(l:conn_id, a:buffer, l:config) | |
55 0.001370 0.000287 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. | |
55 0.000081 if a:linter.lsp is# 'tsserver' | |
call ale#lsp#NotifyForChanges(l:conn_id, a:buffer) | |
endif | |
55 0.000041 return l:details | |
FUNCTION ale_linters#php#langserver#GetProjectRoot() | |
Called 55 times | |
Total time: 0.010952 | |
Self time: 0.000719 | |
count total (s) self (s) | |
55 0.010624 0.000391 let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git') | |
55 0.000223 return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : '' | |
FUNCTION airline#extensions#term#apply() | |
Called 311 times | |
Total time: 0.004697 | |
Self time: 0.004697 | |
count total (s) self (s) | |
311 0.000391 if &buftype == 'terminal' | |
let spc = g:airline_symbols.space | |
let name=get(g:airline_mode_map, 't', 't') | |
call a:1.add_section('airline_a', spc.name.spc) | |
call a:1.add_section('airline_b', '') | |
call a:1.add_section('airline_term', spc.s:termname()) | |
call a:1.split() | |
call a:1.add_section('airline_y', '') | |
call a:1.add_section('airline_z', spc.airline#section#create_right(['linenr', 'maxlinenr'])) | |
return 1 | |
endif | |
FUNCTION <SNR>27_record() | |
Called 532 times | |
Total time: 0.031655 | |
Self time: 0.008901 | |
count total (s) self (s) | |
532 0.001056 if s:locked | retu | en | |
532 0.000958 let bufnr = a:bufnr + 0 | |
532 0.001160 let bufname = bufname(bufnr) | |
532 0.001009 if bufnr > 0 && !empty(bufname) | |
214 0.000853 cal filter(s:mrbs, 'v:val != bufnr') | |
214 0.000410 cal insert(s:mrbs, bufnr) | |
214 0.023970 0.001217 cal s:addtomrufs(bufname) | |
214 0.000098 en | |
FUNCTION ale#events#ReadOrEnterEvent() | |
Called 214 times | |
Total time: 0.005095 | |
Self time: 0.005095 | |
count total (s) self (s) | |
" Apply pattern options if the variable is set. | |
214 0.001004 if get(g:, 'ale_pattern_options_enabled', 1)&& !empty(get(g:, 'ale_pattern_options')) | |
call ale#pattern_options#SetOptions(a:buffer) | |
endif | |
" When entering a buffer, we are no longer quitting it. | |
214 0.000654 call setbufvar(a:buffer, 'ale_quitting', 0) | |
214 0.000649 let l:filetype = getbufvar(a:buffer, '&filetype') | |
214 0.000694 call setbufvar(a:buffer, 'ale_original_filetype', l:filetype) | |
" If the file changed outside of Vim, check it on BufEnter,BufRead | |
214 0.000390 if getbufvar(a:buffer, 'ale_file_changed') | |
call ale#events#LintOnEnter(a:buffer) | |
endif | |
FUNCTION <SNR>29_OnReady() | |
Called 29 times | |
Total time: 0.016245 | |
Self time: 0.001750 | |
count total (s) self (s) | |
29 0.000041 let l:buffer = a:lsp_details.buffer | |
29 0.000047 let l:id = a:lsp_details.connection_id | |
" If we have sent a completion request already, don't send another. | |
29 0.000031 if b:ale_completion_info.request_id | |
return | |
endif | |
29 0.000137 let l:Callback = a:linter.lsp is# 'tsserver' ? function('ale#completion#HandleTSServerResponse') : function('ale#completion#HandleLSPResponse') | |
29 0.000590 0.000126 call ale#lsp#RegisterCallback(l:id, l:Callback) | |
29 0.000033 if a:linter.lsp is# 'tsserver' | |
let l:message = ale#lsp#tsserver_message#Completions( l:buffer, b:ale_completion_info.line, b:ale_completion_info.column, b:ale_completion_info.prefix,) | |
else | |
" Send a message saying the buffer has changed first, otherwise | |
" completions won't know what text is nearby. | |
29 0.008550 0.000209 call ale#lsp#NotifyForChanges(l:id, l:buffer) | |
" For LSP completions, we need to clamp the column to the length of | |
" the line. python-language-server and perhaps others do not implement | |
" this correctly. | |
29 0.003116 0.000389 let l:message = ale#lsp#message#Completion( l:buffer, b:ale_completion_info.line, min([ b:ale_completion_info.line_length, b:ale_completion_info.column, ]), ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),) | |
29 0.000012 endif | |
29 0.003102 0.000138 let l:request_id = ale#lsp#Send(l:id, l:message) | |
29 0.000023 if l:request_id | |
29 0.000051 let b:ale_completion_info.conn_id = l:id | |
29 0.000040 let b:ale_completion_info.request_id = l:request_id | |
29 0.000055 if has_key(a:linter, 'completion_filter') | |
let b:ale_completion_info.completion_filter = a:linter.completion_filter | |
endif | |
29 0.000011 endif | |
FUNCTION ale#path#ToURI() | |
Called 77 times | |
Total time: 0.002647 | |
Self time: 0.001228 | |
count total (s) self (s) | |
77 0.000250 let l:has_drive_letter = a:path[1:2] is# ':\' | |
77 0.002304 0.000885 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',) | |
FUNCTION 15() | |
Called 519 times | |
Total time: 2.258594 | |
Self time: 0.267428 | |
count total (s) self (s) | |
519 0.000489 let side = 1 | |
519 0.000435 let line = '' | |
519 0.000426 let i = 0 | |
519 0.000944 let length = len(self._sections) | |
519 0.000442 let split = 0 | |
519 0.000489 let is_empty = 0 | |
519 0.000530 let prev_group = '' | |
4358 0.004701 while i < length | |
3839 0.006210 let section = self._sections[i] | |
3839 0.005280 let group = section[0] | |
3839 0.005157 let contents = section[1] | |
3839 0.004442 let pgroup = prev_group | |
3839 0.052580 0.018086 let prev_group = airline#builder#get_prev_group(self._sections, i) | |
3839 0.007649 if group ==# 'airline_c' && &buftype ==# 'terminal' && self._context.active | |
let group = 'airline_term' | |
elseif group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') | |
let group = 'airline_c'. self._context.bufnr | |
elseif prev_group ==# 'airline_c' && !self._context.active && has_key(self._context, 'bufnr') | |
let prev_group = 'airline_c'. self._context.bufnr | |
endif | |
3839 0.002471 if is_empty | |
let prev_group = pgroup | |
endif | |
3839 0.048182 0.016045 let is_empty = s:section_is_empty(self, contents) | |
3839 0.002179 if is_empty | |
" need to fix highlighting groups, since we | |
" have skipped a section, we actually need | |
" the previous previous group and so the | |
" seperator goes from the previous previous group | |
" to the current group | |
let pgroup = group | |
endif | |
3839 0.003776 if group == '' | |
let line .= contents | |
elseif group == '|' | |
519 0.000404 let side = 0 | |
519 0.001007 let line .= contents | |
519 0.000400 let split = 1 | |
519 0.000244 else | |
3320 0.003365 if prev_group == '' | |
519 0.001374 let line .= '%#'.group.'#' | |
519 0.000354 elseif split | |
519 0.000350 if !is_empty | |
519 0.244366 0.003212 let line .= s:get_transitioned_seperator(self, prev_group, group, side) | |
519 0.000282 endif | |
519 0.000526 let split = 0 | |
519 0.000244 else | |
2282 0.001518 if !is_empty | |
2282 1.558839 0.013723 let line .= s:get_seperator(self, prev_group, group, side) | |
2282 0.001203 endif | |
2282 0.000970 endif | |
3320 0.163137 0.024872 let line .= is_empty ? '' : s:get_accented_line(self, group, contents) | |
3320 0.001643 endif | |
3839 0.004521 let i = i + 1 | |
3839 0.002785 endwhile | |
519 0.000534 if !self._context.active | |
"let line = substitute(line, '%#airline_c#', '%#airline_c'.self._context.bufnr.'#', '') | |
208 0.006696 let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g') | |
208 0.000118 endif | |
519 0.000470 return line | |
FUNCTION <SNR>76_exec_separator() | |
Called 3256 times | |
Total time: 1.378914 | |
Self time: 0.098159 | |
count total (s) self (s) | |
3256 0.004181 if pumvisible() | |
20 0.000010 return | |
endif | |
3236 0.008833 let group = a:from.'_to_'.a:to.a:suffix | |
3236 0.374605 0.015281 let l:from = airline#themes#get_highlight(a:from.a:suffix) | |
3236 0.352372 0.014098 let l:to = airline#themes#get_highlight(a:to.a:suffix) | |
3236 0.002348 if a:inverse | |
682 0.002166 let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] | |
682 0.000306 else | |
2554 0.008174 let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] | |
2554 0.001058 endif | |
3236 0.009189 let a:dict[group] = colors | |
3236 0.601049 0.017891 call airline#highlighter#exec(group, colors) | |
FUNCTION <SNR>102_GetLinterNames() | |
Called 55 times | |
Total time: 0.001067 | |
Self time: 0.001067 | |
count total (s) self (s) | |
55 0.000166 let l:buffer_ale_linters = get(b:, 'ale_linters', {}) | |
" b:ale_linters can be set to 'all' | |
55 0.000062 if l:buffer_ale_linters is# 'all' | |
return 'all' | |
endif | |
" b:ale_linters can be set to a List. | |
55 0.000086 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 | |
55 0.000110 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 | |
55 0.000118 if has_key(g:ale_linters, a:original_filetype) | |
55 0.000085 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' | |
FUNCTION ale#history#RememberOutput() | |
Called 26 times | |
Total time: 0.000647 | |
Self time: 0.000237 | |
count total (s) self (s) | |
26 0.000571 0.000161 let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
26 0.000045 let l:obj.output = a:output | |
FUNCTION ale#engine#ManageDirectory() | |
Called 26 times | |
Total time: 0.000472 | |
Self time: 0.000214 | |
count total (s) self (s) | |
26 0.000361 0.000103 call ale#engine#InitBufferInfo(a:buffer) | |
26 0.000091 call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory) | |
FUNCTION ale#ShouldDoNothing() | |
Called 265 times | |
Total time: 0.016795 | |
Self time: 0.012782 | |
count total (s) self (s) | |
" The checks are split into separate if statements to make it possible to | |
" profile each check individually with Vim's profiling tools. | |
" | |
" Do nothing if ALE is disabled. | |
265 0.001101 if !getbufvar(a:buffer, 'ale_enabled', get(g:, 'ale_enabled', 0)) | |
return 1 | |
endif | |
" Don't perform any checks when newer NeoVim versions are exiting. | |
265 0.000697 if get(v:, 'exiting', v:null) isnot v:null | |
return 1 | |
endif | |
265 0.000865 let l:filetype = getbufvar(a:buffer, '&filetype') | |
" Do nothing when there's no filetype. | |
265 0.000323 if l:filetype is# '' | |
104 0.000058 return 1 | |
endif | |
" Do nothing for blacklisted files. | |
161 0.000757 if index(get(g:, 'ale_filetype_blacklist', []), l:filetype) >= 0 | |
return 1 | |
endif | |
" Do nothing if running from command mode. | |
161 0.000489 if s:getcmdwintype_exists && !empty(getcmdwintype()) | |
return 1 | |
endif | |
161 0.000675 let l:filename = fnamemodify(bufname(a:buffer), ':t') | |
" Do nothing for directories. | |
161 0.000190 if l:filename is# '.' | |
return 1 | |
endif | |
" Don't start linting and so on when an operator is pending. | |
161 0.001359 0.000750 if ale#util#Mode(1) is# 'no' | |
return 1 | |
endif | |
" Do nothing if running in the sandbox. | |
161 0.002457 0.000530 if ale#util#InSandbox() | |
return 1 | |
endif | |
" Do nothing if the file is too large. | |
161 0.002087 0.000610 if ale#FileTooLarge(a:buffer) | |
return 1 | |
endif | |
" Do nothing from CtrlP buffers with CtrlP-funky. | |
161 0.001168 if exists(':CtrlPFunky') is 2&& getbufvar(a:buffer, '&l:statusline') =~# 'CtrlPMode.*funky' | |
return 1 | |
endif | |
161 0.000100 return 0 | |
FUNCTION ale#completion#RestoreCompletionOptions() | |
Called 68 times | |
Total time: 0.001091 | |
Self time: 0.001091 | |
count total (s) self (s) | |
" Reset settings when completion is done. | |
68 0.000182 if exists('b:ale_old_omnifunc') | |
20 0.000045 if b:ale_old_omnifunc isnot# 'pythoncomplete#Complete' | |
20 0.000077 let &l:omnifunc = b:ale_old_omnifunc | |
20 0.000011 endif | |
20 0.000053 unlet b:ale_old_omnifunc | |
20 0.000009 endif | |
68 0.000121 if exists('b:ale_old_completopt') | |
20 0.000072 let &l:completeopt = b:ale_old_completopt | |
20 0.000056 unlet b:ale_old_completopt | |
20 0.000008 endif | |
FUNCTION ale#completion#StopTimer() | |
Called 60 times | |
Total time: 0.000551 | |
Self time: 0.000551 | |
count total (s) self (s) | |
60 0.000122 if s:timer_id != -1 | |
15 0.000045 call timer_stop(s:timer_id) | |
15 0.000006 endif | |
60 0.000114 let s:timer_id = -1 | |
FUNCTION <SNR>114_TemporaryFilename() | |
Called 26 times | |
Total time: 0.000961 | |
Self time: 0.000477 | |
count total (s) self (s) | |
26 0.000092 let l:filename = fnamemodify(bufname(a:buffer), ':t') | |
26 0.000036 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. | |
26 0.000680 0.000196 return ale#util#Tempname() . (has('win32') ? '\' : '/') . l:filename | |
FUNCTION <SNR>121_FixList() | |
Called 74 times | |
Total time: 0.013248 | |
Self time: 0.004566 | |
count total (s) self (s) | |
74 0.001078 0.000332 let l:format = ale#Var(a:buffer, 'loclist_msg_format') | |
74 0.000093 let l:new_list = [] | |
242 0.000266 for l:item in a:list | |
168 0.000692 let l:fixed_item = copy(l:item) | |
168 0.008913 0.000977 let l:fixed_item.text = ale#GetLocItemMessage(l:item, l:format) | |
168 0.000189 if l:item.bufnr == -1 | |
" If the buffer number is invalid, remove it. | |
call remove(l:fixed_item, 'bufnr') | |
endif | |
168 0.000346 call add(l:new_list, l:fixed_item) | |
168 0.000106 endfor | |
74 0.000059 return l:new_list | |
FUNCTION airline#util#doautocmd() | |
Called 18 times | |
Total time: 0.002045 | |
Self time: 0.001355 | |
count total (s) self (s) | |
18 0.002035 0.001345 exe printf("silent doautocmd %s User %s", s:nomodeline, a:event) | |
FUNCTION ale#history#SetExitCode() | |
Called 26 times | |
Total time: 0.001256 | |
Self time: 0.000404 | |
count total (s) self (s) | |
26 0.001038 0.000186 let l:obj = s:FindHistoryItem(a:buffer, a:job_id) | |
" If we find a match, then set the code and status. | |
26 0.000054 let l:obj.exit_code = a:exit_code | |
26 0.000042 let l:obj.status = 'finished' | |
FUNCTION ale#util#Writefile() | |
Called 26 times | |
Total time: 0.121542 | |
Self time: 0.121542 | |
count total (s) self (s) | |
26 0.000159 let l:corrected_lines = getbufvar(a:buffer, '&fileformat') is# 'dos' ? map(copy(a:lines), 'substitute(v:val, ''\r*$'', ''\r'', '''')') : a:lines | |
26 0.121327 call writefile(l:corrected_lines, a:filename) " no-custom-checks | |
FUNCTION ale#lsp_linter#GetOptions() | |
Called 55 times | |
Total time: 0.000675 | |
Self time: 0.000675 | |
count total (s) self (s) | |
55 0.000082 let l:initialization_options = {} | |
55 0.000112 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 | |
55 0.000048 return l:initialization_options | |
FUNCTION AutoPairsDelete() | |
Called 26 times | |
Total time: 0.003331 | |
Self time: 0.003331 | |
count total (s) self (s) | |
26 0.000224 if !b:autopairs_enabled | |
return "\<BS>" | |
end | |
26 0.000208 let line = getline('.') | |
26 0.000091 let pos = col('.') - 1 | |
26 0.000311 let current_char = get(split(strpart(line, pos), '\zs'), 0, '') | |
26 0.000628 let prev_chars = split(strpart(line, 0, pos), '\zs') | |
26 0.000071 let prev_char = get(prev_chars, -1, '') | |
26 0.000055 let pprev_char = get(prev_chars, -2, '') | |
26 0.000039 if pprev_char == '\' | |
return "\<BS>" | |
end | |
" Delete last two spaces in parens, work with MapSpace | |
26 0.000097 if has_key(b:AutoPairs, pprev_char) && prev_char == ' ' && current_char == ' ' | |
return "\<BS>\<DEL>" | |
endif | |
" Delete Repeated Pair eg: '''|''' [[|]] {{|}} | |
26 0.000046 if has_key(b:AutoPairs, prev_char) | |
2 0.000002 let times = 0 | |
2 0.000002 let p = -1 | |
4 0.000012 while get(prev_chars, p, '') == prev_char | |
2 0.000003 let p = p - 1 | |
2 0.000002 let times = times + 1 | |
2 0.000006 endwhile | |
2 0.000004 let close = b:AutoPairs[prev_char] | |
2 0.000005 let left = repeat(prev_char, times) | |
2 0.000004 let right = repeat(close, times) | |
2 0.000005 let before = strpart(line, pos-times, times) | |
2 0.000004 let after = strpart(line, pos, times) | |
2 0.000004 if left == before && right == after | |
return repeat("\<BS>\<DEL>", times) | |
end | |
2 0.000001 end | |
26 0.000055 if has_key(b:AutoPairs, prev_char) | |
2 0.000003 let close = b:AutoPairs[prev_char] | |
2 0.000016 if match(line,'^\s*'.close, col('.')-1) != -1 | |
" Delete (|___) | |
let space = matchstr(line, '^\s*', col('.')-1) | |
return "\<BS>". repeat("\<DEL>", len(space)+1) | |
elseif match(line, '^\s*$', col('.')-1) != -1 | |
" Delete (|__\n___) | |
2 0.000007 let nline = getline(line('.')+1) | |
2 0.000008 if nline =~ '^\s*'.close | |
if &filetype == 'vim' && prev_char == '"' | |
" Keep next line's comment | |
return "\<BS>" | |
end | |
let space = matchstr(nline, '^\s*') | |
return "\<BS>\<DEL>". repeat("\<DEL>", len(space)+1) | |
end | |
2 0.000001 end | |
2 0.000001 end | |
26 0.000038 return "\<BS>" | |
FUNCTION ale#lsp#Register() | |
Called 55 times | |
Total time: 0.000999 | |
Self time: 0.000999 | |
count total (s) self (s) | |
55 0.000164 let l:conn_id = a:executable_or_address . ':' . a:project | |
55 0.000139 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. | |
" config: Configuration settings 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, 'config': {}, 'callback_list': [], 'message_queue': [], 'capabilities_queue': [], 'capabilities': { 'hover': 0, 'references': 0, 'completion': 0, 'completion_trigger_characters': [], 'definition': 0, 'symbol_search': 0, },} | |
endif | |
55 0.000051 return l:conn_id | |
FUNCTION <SNR>82_can_diffoff() | |
Called 206 times | |
Total time: 0.001652 | |
Self time: 0.001652 | |
count total (s) self (s) | |
206 0.001487 return getwinvar(bufwinnr(a:buf), '&diff') && !empty(getbufvar(a:buf, 'git_dir')) && !empty(getwinvar(bufwinnr(a:buf), 'fugitive_diff_restore')) | |
FUNCTION ale#lsp_linter#HandleLSPResponse() | |
Called 2516 times | |
Total time: 0.321950 | |
Self time: 0.059596 | |
count total (s) self (s) | |
2516 0.006396 let l:method = get(a:response, 'method', '') | |
2516 0.008273 if get(a:response, 'jsonrpc', '') is# '2.0' && has_key(a:response, 'error') | |
let l:linter_name = get(s:lsp_linter_map, a:conn_id, '') | |
call s:HandleLSPErrorMessage(l:linter_name, a:response) | |
elseif l:method is# 'textDocument/publishDiagnostics' | |
48 0.262802 0.000448 call s:HandleLSPDiagnostics(a:conn_id, a:response) | |
48 0.000133 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 | |
FUNCTION ale#lsp#message#Completion() | |
Called 29 times | |
Total time: 0.001748 | |
Self time: 0.000801 | |
count total (s) self (s) | |
29 0.001546 0.000600 let l:message = [0, 'textDocument/completion', { 'textDocument': { 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), }, 'position': {'line': a:line - 1, 'character': a:column},}] | |
29 0.000053 if !empty(a:trigger_character) | |
let l:message[2].context = { 'triggerKind': s:COMPLETION_TRIGGER_CHARACTER, 'triggerCharacter': a:trigger_character,} | |
endif | |
29 0.000021 return l:message | |
FUNCTION ale#cursor#EchoCursorWarning() | |
Called 58 times | |
Total time: 0.004499 | |
Self time: 0.001337 | |
count total (s) self (s) | |
58 0.000162 let l:buffer = bufnr('') | |
58 0.000073 if !g:ale_echo_cursor && !g:ale_cursor_detail | |
return | |
endif | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
58 0.000116 if mode(1) isnot# 'n' | |
45 0.000024 return | |
endif | |
13 0.001369 0.000082 if ale#ShouldDoNothing(l:buffer) | |
return | |
endif | |
13 0.000970 0.000123 let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer) | |
13 0.000012 if g:ale_echo_cursor | |
13 0.000031 if !empty(l:loc) | |
4 0.000091 0.000024 let l:format = ale#Var(l:buffer, 'echo_msg_format') | |
4 0.000278 0.000025 let l:msg = ale#GetLocItemMessage(l:loc, l:format) | |
4 0.000737 0.000032 call ale#cursor#TruncatedEcho(l:msg) | |
4 0.000020 let l:info.echoed = 1 | |
4 0.000007 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. | |
2 0.000032 execute 'echo' | |
2 0.000006 let l:info.echoed = 0 | |
2 0.000001 endif | |
13 0.000006 endif | |
13 0.000014 if g:ale_cursor_detail | |
if !empty(l:loc) | |
call s:ShowCursorDetailForItem(l:loc, {'stay_here': 1}) | |
else | |
call ale#preview#CloseIfTypeMatches('ale-preview') | |
endif | |
endif | |
FUNCTION <SNR>121_BufWinId() | |
Called 74 times | |
Total time: 0.000478 | |
Self time: 0.000478 | |
count total (s) self (s) | |
74 0.000358 return exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0 | |
FUNCTION <SNR>76_hl_group_exists() | |
Called 3444 times | |
Total time: 0.036502 | |
Self time: 0.036502 | |
count total (s) self (s) | |
3444 0.011653 if !hlexists(a:group) | |
return 0 | |
elseif empty(synIDattr(hlID(a:group), 'fg')) | |
return 0 | |
endif | |
3444 0.001717 return 1 | |
FUNCTION ale#path#FromURI() | |
Called 48 times | |
Total time: 0.001510 | |
Self time: 0.001121 | |
count total (s) self (s) | |
48 0.000095 let l:i = len('file://') | |
48 0.000174 let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri | |
48 0.000605 0.000216 let l:path = ale#uri#Decode(l:encoded_path) | |
" If the path is like /C:/foo/bar, it should be C:\foo\bar instead. | |
48 0.000327 if l:path =~# '^/[a-zA-Z]:' | |
let l:path = substitute(l:path[1:], '/', '\\', 'g') | |
endif | |
48 0.000041 return l:path | |
FUNCTION ale#history#Add() | |
Called 26 times | |
Total time: 0.003597 | |
Self time: 0.003597 | |
count total (s) self (s) | |
26 0.000079 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 | |
26 0.000187 let l:history = getbufvar(a:buffer, 'ale_history', []) | |
" Remove the first item if we hit the max history size. | |
26 0.000058 if len(l:history) >= g:ale_max_buffer_history_size | |
26 0.000992 let l:history = l:history[1:] | |
26 0.000013 endif | |
26 0.000140 call add(l:history, { 'status': a:status, 'job_id': a:job_id, 'command': a:command,}) | |
26 0.001858 call setbufvar(a:buffer, 'ale_history', l:history) | |
FUNCTION 10() | |
Called 3320 times | |
Total time: 0.009682 | |
Self time: 0.009682 | |
count total (s) self (s) | |
3320 0.008730 call add(self._sections, [a:group, a:contents]) | |
FUNCTION ale#GetLocItemMessage() | |
Called 172 times | |
Total time: 0.008189 | |
Self time: 0.008189 | |
count total (s) self (s) | |
172 0.000274 let l:msg = a:format_string | |
172 0.000259 let l:severity = g:ale_echo_msg_warning_str | |
172 0.000370 let l:code = get(a:item, 'code', '') | |
172 0.000336 let l:type = get(a:item, 'type', 'E') | |
172 0.000392 let l:linter_name = get(a:item, 'linter_name', '') | |
172 0.000389 let l:code_repl = !empty(l:code) ? '\=submatch(1) . l:code . submatch(2)' : '' | |
172 0.000195 if l:type is# 'E' | |
172 0.000261 let l:severity = g:ale_echo_msg_error_str | |
172 0.000122 elseif l:type is# 'I' | |
let l:severity = g:ale_echo_msg_info_str | |
endif | |
" Replace special markers with certain information. | |
" \=l:variable is used to avoid escaping issues. | |
172 0.000907 let l:msg = substitute(l:msg, '\V%severity%', '\=l:severity', 'g') | |
172 0.000681 let l:msg = substitute(l:msg, '\V%linter%', '\=l:linter_name', 'g') | |
172 0.001854 let l:msg = substitute(l:msg, '\v\%([^\%]*)code([^\%]*)\%', l:code_repl, 'g') | |
" Replace %s with the text. | |
172 0.000917 let l:msg = substitute(l:msg, '\V%s', '\=a:item.text', 'g') | |
172 0.000143 return l:msg | |
FUNCTION ale#util#JoinNeovimOutput() | |
Called 1954 times | |
Total time: 0.791096 | |
Self time: 0.028827 | |
count total (s) self (s) | |
1954 0.002675 if a:mode is# 'raw' | |
1902 0.782441 0.020737 call a:callback(a:job, join(a:data, "\n")) | |
1902 0.001268 return '' | |
endif | |
52 0.000141 let l:lines = a:data[:-2] | |
52 0.000096 if len(a:data) > 1 | |
26 0.000086 let l:lines[0] = a:last_line . l:lines[0] | |
26 0.000044 let l:new_last_line = a:data[-1] | |
26 0.000016 else | |
26 0.000085 let l:new_last_line = a:last_line . get(a:data, 0, '') | |
26 0.000026 endif | |
114 0.000199 for l:line in l:lines | |
62 0.000931 0.000366 call a:callback(a:job, l:line) | |
62 0.000045 endfor | |
52 0.000052 return l:new_last_line | |
FUNCTION ale#sign#SetSigns() | |
Called 74 times | |
Total time: 0.265402 | |
Self time: 0.224143 | |
count total (s) self (s) | |
74 0.000201 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 | |
74 0.012788 0.000547 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. | |
74 0.004415 0.000587 call s:UpdateLineNumbers(a:buffer, l:current_sign_list, a:loclist) | |
" Group items after updating the line numbers. | |
74 0.003378 0.000389 let l:grouped_items = s:GroupLoclistItems(a:buffer, a:loclist) | |
" Build a map of current and new signs, with the lines as the keys. | |
74 0.016107 0.000511 let l:sign_map = s:BuildSignMap( a:buffer, l:current_sign_list, l:grouped_items,) | |
74 0.007052 0.000447 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. | |
74 0.000132 if g:ale_change_sign_column_color && !empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithErrors | |
endif | |
208 0.000322 for l:command in l:command_list | |
134 0.219340 silent! execute l:command | |
134 0.000234 endfor | |
" Reset the sign column color when there are no more errors. | |
74 0.000198 if g:ale_change_sign_column_color && empty(a:loclist) | |
highlight clear SignColumn | |
highlight link SignColumn ALESignColumnWithoutErrors | |
endif | |
FUNCTION ale#node#FindExecutable() | |
Called 55 times | |
Total time: 0.001648 | |
Self time: 0.000585 | |
count total (s) self (s) | |
55 0.000893 0.000308 if ale#Var(a:buffer, a:base_var_name . '_use_global') | |
55 0.000692 0.000214 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') | |
FUNCTION <SNR>84_HandleExit() | |
Called 26 times | |
Total time: 0.100195 | |
Self time: 0.002581 | |
count total (s) self (s) | |
26 0.000110 if !has_key(s:job_info_map, a:job_id) | |
return | |
endif | |
26 0.000063 let l:job_info = s:job_info_map[a:job_id] | |
26 0.000041 let l:linter = l:job_info.linter | |
26 0.000029 let l:output = l:job_info.output | |
26 0.000029 let l:buffer = l:job_info.buffer | |
26 0.000037 let l:executable = l:job_info.executable | |
26 0.000037 let l:next_chain_index = l:job_info.next_chain_index | |
26 0.000026 if g:ale_history_enabled | |
26 0.001460 0.000203 call ale#history#SetExitCode(l:buffer, a:job_id, a:exit_code) | |
26 0.000013 endif | |
" Remove this job from the list. | |
26 0.000836 0.000145 call ale#job#Stop(a:job_id) | |
26 0.000068 call remove(s:job_info_map, a:job_id) | |
26 0.000248 call filter(g:ale_buffer_info[l:buffer].job_list, 'v:val isnot# a:job_id') | |
26 0.000130 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. | |
26 0.000634 0.000112 if ale#util#InSandbox() | |
return | |
endif | |
26 0.000114 if has('nvim') && !empty(l:output) && empty(l:output[-1]) | |
call remove(l:output, -1) | |
endif | |
26 0.000081 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. | |
26 0.000045 if g:ale_history_enabled && g:ale_history_log_output | |
26 0.000778 0.000132 call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:]) | |
26 0.000012 endif | |
26 0.000015 try | |
26 0.004936 0.000226 let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output) | |
" Handle the function being unknown, or being deleted. | |
26 0.000018 catch /E700/ | |
let l:loclist = [] | |
endtry | |
26 0.089959 0.000171 call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist, 0) | |
FUNCTION ale#engine#InitBufferInfo() | |
Called 52 times | |
Total time: 0.000788 | |
Self time: 0.000788 | |
count total (s) self (s) | |
52 0.000134 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': [], 'active_other_sources_list': [], 'loclist': [], 'temporary_file_list': [], 'temporary_directory_list': [],} | |
return 1 | |
endif | |
52 0.000051 return 0 | |
FUNCTION <SNR>79_get_seperator() | |
Called 2282 times | |
Total time: 1.545116 | |
Self time: 0.023007 | |
count total (s) self (s) | |
2282 0.501222 0.010355 if airline#builder#should_change_group(a:prev_group, a:group) | |
2282 1.042763 0.011522 return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side) | |
else | |
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep | |
endif | |
FUNCTION <SNR>84_StopCurrentJobs() | |
Called 26 times | |
Total time: 0.000921 | |
Self time: 0.000921 | |
count total (s) self (s) | |
26 0.000111 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
26 0.000036 let l:new_job_list = [] | |
26 0.000031 let l:new_active_linter_list = [] | |
26 0.000087 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. | |
26 0.000081 call uniq(sort(l:new_active_linter_list)) | |
" Update the List, so it includes only the jobs we still need. | |
26 0.000051 let l:info.job_list = l:new_job_list | |
" Update the active linter list, clearing out anything not running. | |
26 0.000042 let l:info.active_linter_list = l:new_active_linter_list | |
FUNCTION ale#statusline#Count() | |
Called 2638 times | |
Total time: 0.051967 | |
Self time: 0.016798 | |
count total (s) self (s) | |
" The Dictionary is copied here before exposing it to other plugins. | |
2638 0.049959 0.014791 return copy(s:GetCounts(a:buffer)) | |
FUNCTION airline#extensions#default#apply() | |
Called 519 times | |
Total time: 0.261745 | |
Self time: 0.021093 | |
count total (s) self (s) | |
519 0.000753 let winnr = a:context.winnr | |
519 0.000598 let active = a:context.active | |
519 0.004082 0.002611 if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse)) | |
311 0.062791 0.001536 call s:build_sections(a:builder, a:context, s:layout[0]) | |
311 0.000160 else | |
208 0.007654 0.001010 let text = s:get_section(winnr, 'c') | |
208 0.000292 if empty(text) | |
2 0.000004 let text = ' %f%m ' | |
2 0.000001 endif | |
208 0.001872 0.001095 call a:builder.add_section('airline_c'.(a:context.bufnr), text) | |
208 0.000100 endif | |
519 0.019706 0.003877 call a:builder.split(s:get_section(winnr, 'gutter', '', '')) | |
519 0.002910 0.001751 if airline#util#getwinvar(winnr, 'airline_render_right', 1) | |
519 0.155919 0.002402 call s:build_sections(a:builder, a:context, s:layout[1]) | |
519 0.000232 endif | |
519 0.000268 return 1 | |
FUNCTION ale#FileTooLarge() | |
Called 161 times | |
Total time: 0.001477 | |
Self time: 0.001477 | |
count total (s) self (s) | |
161 0.000772 let l:max = getbufvar(a:buffer, 'ale_maximum_file_size', get(g:, 'ale_maximum_file_size', 0)) | |
161 0.000450 return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0 | |
FUNCTION ale#engine#IsCheckingBuffer() | |
Called 3070 times | |
Total time: 0.027878 | |
Self time: 0.027878 | |
count total (s) self (s) | |
3070 0.009599 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
3070 0.015343 return !empty(get(l:info, 'active_linter_list', [])) || !empty(get(l:info, 'active_other_sources_list', [])) | |
FUNCTION ale#job#ValidateArguments() | |
Called 26 times | |
Total time: 0.000140 | |
Self time: 0.000140 | |
count total (s) self (s) | |
26 0.000077 if a:options.mode isnot# 'nl' && a:options.mode isnot# 'raw' | |
throw 'Invalid mode: ' . a:options.mode | |
endif | |
FUNCTION airline#extensions#fugitiveline#bufname() | |
Called 1450 times | |
Total time: 0.070708 | |
Self time: 0.070708 | |
count total (s) self (s) | |
1450 0.003100 if !exists('b:fugitive_name') | |
let b:fugitive_name = '' | |
try | |
if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal') | |
let b:fugitive_name = FugitiveReal(bufname('%')) | |
elseif exists('b:git_dir') | |
let buffer = fugitive#buffer() | |
if buffer.type('blob') | |
let b:fugitive_name = buffer.repo().translate(buffer.path('/')) | |
endif | |
endif | |
catch | |
endtry | |
endif | |
1450 0.002250 if empty(b:fugitive_name) | |
1450 0.042103 return fnamemodify(bufname('%'), s:fmod) | |
else | |
return fnamemodify(b:fugitive_name, s:fmod) | |
endif | |
FUNCTION airline#highlighter#add_separator() | |
Called 2801 times | |
Total time: 1.203029 | |
Self time: 0.035003 | |
count total (s) self (s) | |
2801 0.013847 let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] | |
2801 1.187829 0.019803 call <sid>exec_separator({}, a:from, a:to, a:inverse, '') | |
FUNCTION airline#util#wrap() | |
Called 11590 times | |
Total time: 0.043242 | |
Self time: 0.043242 | |
count total (s) self (s) | |
11590 0.019335 if a:minwidth > 0 && winwidth(0) < a:minwidth | |
return '' | |
endif | |
11590 0.008300 return a:text | |
FUNCTION FindOpenBracket() | |
Called 8 times | |
Total time: 0.003733 | |
Self time: 0.001713 | |
count total (s) self (s) | |
8 0.000020 call cursor(a:lnum, 1) | |
8 0.002002 0.000713 let line = searchpair('{', '', '}', 'bW', 'Skippmatch()') | |
8 0.000009 if a:blockStarter == 1 | |
14 0.000014 while line > 1 | |
14 0.000028 let linec = getline(line) | |
14 0.000807 if linec =~ s:terminated || linec =~ s:structureHead | |
8 0.000007 break | |
endif | |
6 0.000764 0.000034 let line = GetLastRealCodeLNum(line - 1) | |
6 0.000004 endwhile | |
8 0.000004 endif | |
8 0.000006 return line | |
FUNCTION ale#completion#NullFilter() | |
Called 7 times | |
Total time: 0.000008 | |
Self time: 0.000008 | |
count total (s) self (s) | |
7 0.000005 return 1 | |
FUNCTION airline#extensions#ale#get() | |
Called 2896 times | |
Total time: 0.254669 | |
Self time: 0.136769 | |
count total (s) self (s) | |
2896 0.007173 if !exists(':ALELint') | |
return '' | |
endif | |
2896 0.008172 let error_symbol = get(g:, 'airline#extensions#ale#error_symbol', 'E:') | |
2896 0.007414 let warning_symbol = get(g:, 'airline#extensions#ale#warning_symbol', 'W:') | |
2896 0.007513 let checking_symbol = get(g:, 'airline#extensions#ale#checking_symbol', '...') | |
2896 0.007194 let show_line_numbers = get(g:, 'airline#extensions#ale#show_line_numbers', 1) | |
2896 0.004765 let is_err = a:type ==# 'error' | |
2896 0.038563 0.012191 if ale#engine#IsCheckingBuffer(bufnr('')) == 1 | |
258 0.000331 return is_err ? '' : checking_symbol | |
endif | |
2638 0.004430 let symbol = is_err ? error_symbol : warning_symbol | |
2638 0.062154 0.010187 let counts = ale#statusline#Count(bufnr('')) | |
2638 0.008857 if type(counts) == type({}) && has_key(counts, 'error') | |
" Use the current Dictionary format. | |
2638 0.004440 let errors = counts.error + counts.style_error | |
2638 0.004512 let num = is_err ? errors : counts.total - errors | |
2638 0.001289 else | |
" Use the old List format. | |
let num = is_err ? counts[0] : counts[1] | |
endif | |
2638 0.002527 if show_line_numbers == 1 | |
2638 0.060006 0.020445 return s:airline_ale_count(num, symbol) . <sid>airline_ale_get_line_number(num, a:type) | |
else | |
return s:airline_ale_count(num, symbol) | |
endif | |
FUNCTION <SNR>101_ApplyPartialTimer() | |
Called 74 times | |
Total time: 0.027139 | |
Self time: 0.001210 | |
count total (s) self (s) | |
74 0.000186 if has_key(s:partial_timers, a:timer_id) | |
74 0.000366 let [l:Callback, l:args] = remove(s:partial_timers, a:timer_id) | |
74 0.026476 0.000548 call call(l:Callback, [a:timer_id] + l:args) | |
74 0.000030 endif | |
FUNCTION FugitiveGitDir() | |
Called 1439 times | |
Total time: 0.006210 | |
Self time: 0.006210 | |
count total (s) self (s) | |
1439 0.001812 if !a:0 || a:1 ==# -1 | |
1439 0.003413 return get(b:, 'git_dir', '') | |
elseif type(a:1) == type(0) | |
return getbufvar(a:1, 'git_dir') | |
elseif type(a:1) == type('') | |
return substitute(s:Slash(a:1), '/$', '', '') | |
else | |
return '' | |
endif | |
FUNCTION phpcomplete#ExpandClassName() | |
Called 256 times | |
Total time: 0.017883 | |
Self time: 0.017883 | |
count total (s) self (s) | |
" if there's an imported class, just use that class's information | |
256 0.001091 if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i' || a:imports[a:classname].kind == 't') | |
let namespace = has_key(a:imports[a:classname], 'namespace') ? a:imports[a:classname].namespace : '' | |
return [a:imports[a:classname].name, namespace] | |
endif | |
" try to find relative namespace in imports, imported names takes precedence over | |
" current namespace when resolving relative namespaced class names | |
256 0.001101 if a:classname !~ '^\' && a:classname =~ '\\' | |
202 0.001466 let classname_parts = split(a:classname, '\\\+') | |
202 0.000597 if has_key(a:imports, classname_parts[0]) && a:imports[classname_parts[0]].kind == 'n' | |
let classname_parts[0] = a:imports[classname_parts[0]].name | |
let namespace = join(classname_parts[0:-2], '\') | |
let classname = classname_parts[-1] | |
return [classname, namespace] | |
endif | |
202 0.000080 endif | |
" no imported class or namespace matched, expand with the current namespace | |
256 0.000278 let namespace = '' | |
256 0.000328 let classname = a:classname | |
" if the classname have namespaces in in or we are in a namespace | |
256 0.000797 if a:classname =~ '\\' || (a:current_namespace != '\' && a:current_namespace != '') | |
" add current namespace to the a:classname | |
256 0.000579 if a:classname !~ '^\' | |
256 0.001413 let classname = a:current_namespace.'\'.substitute(a:classname, '^\\', '', '') | |
256 0.000118 else | |
" remove leading \, tag files doesn't have those | |
let classname = substitute(a:classname, '^\\', '', '') | |
endif | |
" split classname to classname and namespace | |
256 0.002002 let classname_parts = split(classname, '\\\+') | |
256 0.000418 if len(classname_parts) > 1 | |
256 0.001518 let namespace = join(classname_parts[0:-2], '\') | |
256 0.000380 let classname = classname_parts[-1] | |
256 0.000109 endif | |
256 0.000110 endif | |
256 0.000431 return [classname, namespace] | |
FUNCTION ale#engine#ProcessChain() | |
Called 26 times | |
Total time: 0.001491 | |
Self time: 0.001384 | |
count total (s) self (s) | |
26 0.000067 let l:output_stream = get(a:linter, 'output_stream', 'stdout') | |
26 0.000035 let l:read_buffer = a:linter.read_buffer | |
26 0.000029 let l:chain_index = a:chain_index | |
26 0.000026 let l:input = a:input | |
26 0.000039 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 we have a command to run, execute that. | |
if !empty(l:command) | |
" 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 | |
26 0.000214 0.000107 let l:command = ale#linter#GetCommand(a:buffer, a:linter) | |
26 0.000022 endif | |
26 0.000142 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,} | |
FUNCTION <SNR>69_update_git_branch() | |
Called 1439 times | |
Total time: 0.175797 | |
Self time: 0.027737 | |
count total (s) self (s) | |
1439 0.009550 0.004817 if !airline#util#has_fugitive() | |
let s:vcs_config['git'].branch = '' | |
return | |
endif | |
1439 0.154399 0.011073 let s:vcs_config['git'].branch = exists("*FugitiveHead") ? FugitiveHead(s:sha1size) : fugitive#head(s:sha1size) | |
1439 0.004073 if s:vcs_config['git'].branch is# 'master' && winwidth(0) < 81 | |
" Shorten default a bit | |
let s:vcs_config['git'].branch='mas' | |
endif | |
FUNCTION airline#extensions#term#inactive_apply() | |
Called 208 times | |
Total time: 0.001975 | |
Self time: 0.001975 | |
count total (s) self (s) | |
208 0.000645 if getbufvar(a:2.bufnr, '&buftype') == 'terminal' | |
let spc = g:airline_symbols.space | |
call a:1.add_section('airline_a', spc.'TERMINAL'.spc) | |
call a:1.add_section('airline_b', spc.'%f') | |
return 1 | |
endif | |
FUNCTION <SNR>81_Lint() | |
Called 26 times | |
Total time: 0.283758 | |
Self time: 0.004353 | |
count total (s) self (s) | |
" Use the filetype from the buffer | |
26 0.000413 let l:filetype = getbufvar(a:buffer, '&filetype') | |
26 0.009328 0.000427 let l:linters = ale#linter#Get(l:filetype) | |
" Apply ignore lists for linters only if needed. | |
26 0.000419 0.000140 let l:ignore_config = ale#Var(a:buffer, 'linters_ignore') | |
26 0.000097 let l:linters = !empty(l:ignore_config) ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config) : l:linters | |
" Tell other sources that they can start checking the buffer now. | |
26 0.000172 let g:ale_want_results_buffer = a:buffer | |
26 0.002150 0.001834 silent doautocmd <nomodeline> User ALEWantResults | |
26 0.000234 unlet! g:ale_want_results_buffer | |
" Don't set up buffer data and so on if there are no linters to run. | |
26 0.000128 if !has_key(g:ale_buffer_info, a:buffer) && empty(l:linters) | |
return | |
endif | |
" Clear lint_file linters, or only run them if the file exists. | |
26 0.000135 let l:lint_file = empty(l:linters) || (a:should_lint_file && filereadable(expand('#' . a:buffer . ':p'))) | |
26 0.270269 0.000360 call ale#engine#RunLinters(a:buffer, l:linters, l:lint_file) | |
FUNCTION airline#builder#get_prev_group() | |
Called 3839 times | |
Total time: 0.034494 | |
Self time: 0.034494 | |
count total (s) self (s) | |
3839 0.004976 let x = a:i - 1 | |
4358 0.004048 while x >= 0 | |
3839 0.006266 let group = a:sections[x][0] | |
3839 0.006451 if group != '' && group != '|' | |
3320 0.002790 return group | |
endif | |
519 0.000491 let x = x - 1 | |
519 0.000353 endwhile | |
519 0.000317 return '' | |
FUNCTION airline#util#getwinvar() | |
Called 6329 times | |
Total time: 0.016943 | |
Self time: 0.016943 | |
count total (s) self (s) | |
6329 0.015077 return getwinvar(a:winnr, a:key, a:def) | |
FUNCTION airline#extensions#whitespace#check() | |
Called 1448 times | |
Total time: 0.137771 | |
Self time: 0.121930 | |
count total (s) self (s) | |
1448 0.004008 let max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000) | |
1448 0.006552 if &readonly || !&modifiable || !s:enabled || line('$') > max_lines || get(b:, 'airline_whitespace_disabled', 0) | |
9 0.000008 return '' | |
endif | |
1439 0.011117 let skip_check_ft = extend(s:skip_check_ft, get(g:, 'airline#extensions#whitespace#skip_indent_check_ft', {}), 'force') | |
1439 0.003358 if !exists('b:airline_whitespace_check') | |
let b:airline_whitespace_check = '' | |
let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks)) | |
let trailing = 0 | |
let check = 'trailing' | |
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0 | |
try | |
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$') | |
let trailing = search(regexp, 'nw') | |
catch | |
call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp)) | |
echomsg v:exception | |
return '' | |
endtry | |
endif | |
let mixed = 0 | |
let check = 'indent' | |
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0 | |
let mixed = s:check_mixed_indent() | |
endif | |
let mixed_file = '' | |
let check = 'mixed-indent-file' | |
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0 | |
let mixed_file = s:check_mixed_indent_file() | |
endif | |
let long = 0 | |
if index(checks, 'long') > -1 && &tw > 0 | |
let long = search('\%>'.&tw.'v.\+', 'nw') | |
endif | |
if trailing != 0 || mixed != 0 || long != 0 || !empty(mixed_file) | |
let b:airline_whitespace_check = s:symbol | |
if strlen(s:symbol) > 0 | |
let space = (g:airline_symbols.space) | |
else | |
let space = '' | |
endif | |
if s:show_message | |
if trailing != 0 | |
let trailing_fmt = get(g:, 'airline#extensions#whitespace#trailing_format', '[%s]trailing') | |
let b:airline_whitespace_check .= space.printf(trailing_fmt, trailing) | |
endif | |
if mixed != 0 | |
let mixed_indent_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_format', '[%s]mixed-indent') | |
let b:airline_whitespace_check .= space.printf(mixed_indent_fmt, mixed) | |
endif | |
if long != 0 | |
let long_fmt = get(g:, 'airline#extensions#whitespace#long_format', '[%s]long') | |
let b:airline_whitespace_check .= space.printf(long_fmt, long) | |
endif | |
if !empty(mixed_file) | |
let mixed_indent_file_fmt = get(g:, 'airline#extensions#whitespace#mixed_indent_file_format', '[%s]mix-indent-file') | |
let b:airline_whitespace_check .= space.printf(mixed_indent_file_fmt, mixed_file) | |
endif | |
endif | |
endif | |
endif | |
1439 0.021646 0.005805 return airline#util#shorten(b:airline_whitespace_check, 120, 9) | |
FUNCTION <SNR>61_is_excluded_window() | |
Called 519 times | |
Total time: 0.019420 | |
Self time: 0.019420 | |
count total (s) self (s) | |
519 0.001047 for matchft in g:airline_exclude_filetypes | |
if matchft ==# &ft | |
return 1 | |
endif | |
endfor | |
2076 0.002111 for matchw in g:airline_exclude_filenames | |
1557 0.008209 if matchstr(expand('%'), matchw) ==# matchw | |
return 1 | |
endif | |
1557 0.000670 endfor | |
519 0.000587 if g:airline_exclude_preview && &previewwindow | |
return 1 | |
endif | |
519 0.000294 return 0 | |
FUNCTION <SNR>38_ExpandMap() | |
Called 104 times | |
Total time: 0.002378 | |
Self time: 0.002378 | |
count total (s) self (s) | |
104 0.000178 let map = a:map | |
104 0.002000 let map = substitute(map, '\(<Plug>\w\+\)', '\=maparg(submatch(1), "i")', 'g') | |
104 0.000112 return map | |
FUNCTION AutoPairsInit() | |
Called 104 times | |
Total time: 0.047146 | |
Self time: 0.031548 | |
count total (s) self (s) | |
104 0.000165 let b:autopairs_loaded = 1 | |
104 0.000202 if !exists('b:autopairs_enabled') | |
104 0.000127 let b:autopairs_enabled = 1 | |
104 0.000046 end | |
104 0.000155 let b:AutoPairsClosedPairs = {} | |
104 0.000172 if !exists('b:AutoPairs') | |
104 0.000175 let b:AutoPairs = g:AutoPairs | |
104 0.000043 end | |
104 0.000187 if !exists('b:AutoPairsMoveCharacter') | |
104 0.000186 let b:AutoPairsMoveCharacter = g:AutoPairsMoveCharacter | |
104 0.000040 end | |
" buffer level map pairs keys | |
728 0.001730 for [open, close] in items(b:AutoPairs) | |
624 0.012951 0.002224 call AutoPairsMap(open) | |
624 0.000737 if open != close | |
312 0.005893 0.001021 call AutoPairsMap(close) | |
312 0.000159 end | |
624 0.001233 let b:AutoPairsClosedPairs[close] = open | |
624 0.000371 endfor | |
936 0.001965 for key in split(b:AutoPairsMoveCharacter, '\s*') | |
832 0.002724 let escaped_key = substitute(key, "'", "''", 'g') | |
832 0.006464 execute 'inoremap <silent> <buffer> <M-'.key."> <C-R>=AutoPairsMoveCharacter('".escaped_key."')<CR>" | |
832 0.000514 endfor | |
" Still use <buffer> level mapping for <BS> <SPACE> | |
104 0.000116 if g:AutoPairsMapBS | |
" Use <C-R> instead of <expr> for issue #14 sometimes press BS output strange words | |
104 0.000576 execute 'inoremap <buffer> <silent> <BS> <C-R>=AutoPairsDelete()<CR>' | |
104 0.000054 end | |
104 0.000081 if g:AutoPairsMapCh | |
104 0.000548 execute 'inoremap <buffer> <silent> <C-h> <C-R>=AutoPairsDelete()<CR>' | |
104 0.000045 endif | |
104 0.000088 if g:AutoPairsMapSpace | |
" Try to respect abbreviations on a <SPACE> | |
104 0.000116 let do_abbrev = "" | |
104 0.000234 if v:version == 703 && has("patch489") || v:version > 703 | |
104 0.000113 let do_abbrev = "<C-]>" | |
104 0.000044 endif | |
104 0.000699 execute 'inoremap <buffer> <silent> <SPACE> '.do_abbrev.'<C-R>=AutoPairsSpace()<CR>' | |
104 0.000043 end | |
104 0.000169 if g:AutoPairsShortcutFastWrap != '' | |
104 0.000705 execute 'inoremap <buffer> <silent> '.g:AutoPairsShortcutFastWrap.' <C-R>=AutoPairsFastWrap()<CR>' | |
104 0.000041 end | |
104 0.000135 if g:AutoPairsShortcutBackInsert != '' | |
104 0.000713 execute 'inoremap <buffer> <silent> '.g:AutoPairsShortcutBackInsert.' <C-R>=AutoPairsBackInsert()<CR>' | |
104 0.000040 end | |
104 0.000123 if g:AutoPairsShortcutToggle != '' | |
" use <expr> to ensure showing the status when toggle | |
104 0.000656 execute 'inoremap <buffer> <silent> <expr> '.g:AutoPairsShortcutToggle.' AutoPairsToggle()' | |
104 0.000757 execute 'noremap <buffer> <silent> '.g:AutoPairsShortcutToggle.' :call AutoPairsToggle()<CR>' | |
104 0.000040 end | |
104 0.000116 if g:AutoPairsShortcutJump != '' | |
104 0.000733 execute 'inoremap <buffer> <silent> ' . g:AutoPairsShortcutJump. ' <ESC>:call AutoPairsJump()<CR>a' | |
104 0.000726 execute 'noremap <buffer> <silent> ' . g:AutoPairsShortcutJump. ' :call AutoPairsJump()<CR>' | |
104 0.000040 end | |
FUNCTION <SNR>27_addtomrufs() | |
Called 214 times | |
Total time: 0.022753 | |
Self time: 0.022753 | |
count total (s) self (s) | |
214 0.005238 let fn = fnamemodify(a:fname, ':p') | |
214 0.001181 let fn = exists('+ssl') ? tr(fn, '/', '\') : fn | |
214 0.012696 if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} ) || !empty(getbufvar('^'.fn.'$', '&bt')) || !filereadable(fn) | retu | |
en | |
214 0.001182 let idx = index(s:mrufs, fn, 0, !{s:cseno}) | |
214 0.000143 if idx | |
cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn') | |
cal insert(s:mrufs, fn) | |
if {s:soup} && idx < 0 | |
cal s:savetofile(s:mergelists()) | |
en | |
en | |
FUNCTION ale#Queue() | |
Called 178 times | |
Total time: 0.014159 | |
Self time: 0.005379 | |
count total (s) self (s) | |
178 0.000245 if a:0 > 2 | |
throw 'too many arguments!' | |
endif | |
178 0.000490 let l:buffer = get(a:000, 1, v:null) | |
178 0.000205 if l:buffer is v:null | |
74 0.000166 let l:buffer = bufnr('') | |
74 0.000032 endif | |
178 0.000350 if type(l:buffer) isnot v:t_number | |
throw 'buffer_number must be a Number' | |
endif | |
178 0.009498 0.000718 if ale#ShouldDoNothing(l:buffer) | |
104 0.000052 return | |
endif | |
" Default linting_flag to '' | |
74 0.000200 let l:should_lint_file = get(a:000, 0) is# 'lint_file' | |
74 0.000089 if s:lint_timer != -1 | |
74 0.000190 call timer_stop(s:lint_timer) | |
74 0.000155 let s:lint_timer = -1 | |
74 0.000037 endif | |
74 0.000073 if a:delay > 0 | |
74 0.000533 let s:lint_timer = timer_start( a:delay, function('s:Lint', [l:buffer, l:should_lint_file])) | |
74 0.000040 else | |
call s:Lint(l:buffer, l:should_lint_file, 0) | |
endif | |
FUNCTION <SNR>120_BuildSignMap() | |
Called 74 times | |
Total time: 0.015596 | |
Self time: 0.009562 | |
count total (s) self (s) | |
74 0.001031 0.000319 let l:max_signs = ale#Var(a:buffer, 'max_signs') | |
74 0.000078 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 | |
74 0.000124 let l:selected_grouped_items = a:grouped_items | |
74 0.000044 endif | |
74 0.000093 let l:sign_map = {} | |
74 0.000105 let l:sign_offset = g:ale_sign_offset | |
196 0.000301 for [l:line, l:sign_id, l:name] in a:current_sign_list | |
122 0.000717 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. | |
122 0.000143 if l:sign_id > l:sign_offset | |
99 0.000100 let l:sign_offset = l:sign_id | |
99 0.000044 endif | |
" Remember the sign names and IDs in separate Lists, so they are easy | |
" to work with. | |
122 0.000233 call add(l:sign_info.current_id_list, l:sign_id) | |
122 0.000217 call add(l:sign_info.current_name_list, l:name) | |
122 0.000217 let l:sign_map[l:line] = l:sign_info | |
122 0.000074 endfor | |
196 0.000215 for l:group in l:selected_grouped_items | |
122 0.000159 let l:line = l:group[0].lnum | |
122 0.000761 let l:sign_info = get(l:sign_map, l:line, { 'current_id_list': [], 'current_name_list': [], 'new_id': 0, 'new_name': '', 'items': [],}) | |
122 0.005928 0.000607 let l:sign_info.new_name = ale#sign#GetSignName(l:group) | |
122 0.000156 let l:sign_info.items = l:group | |
122 0.000307 let l:index = index( l:sign_info.current_name_list, l:sign_info.new_name) | |
122 0.000105 if l:index >= 0 | |
" We have a sign with this name already, so use the same ID. | |
117 0.000196 let l:sign_info.new_id = l:sign_info.current_id_list[l:index] | |
117 0.000054 else | |
" This sign name replaces the previous name, so use a new ID. | |
5 0.000007 let l:sign_info.new_id = l:sign_offset + 1 | |
5 0.000006 let l:sign_offset += 1 | |
5 0.000002 endif | |
122 0.000185 let l:sign_map[l:line] = l:sign_info | |
122 0.000068 endfor | |
74 0.000059 return l:sign_map | |
FUNCTION phpcomplete#ParseDocBlock() | |
Called 7 times | |
Total time: 0.000621 | |
Self time: 0.000621 | |
count total (s) self (s) | |
7 0.000034 let res = { 'description': '', 'params': [], 'return': {}, 'throws': [], 'var': {}, 'properties': [], } | |
7 0.000103 let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') | |
7 0.000025 let docblock_lines = split(a:docblock, "\n") | |
7 0.000024 let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"') | |
7 0.000009 for param_line in param_lines | |
let parts = matchlist(param_line, '@param\s\+\(\S\+\)\s\+\(\S\+\)\s*\(.*\)') | |
if len(parts) > 0 | |
call add(res.params, { 'line': parts[0], 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 1, '')), 'name': get(parts, 2, ''), 'description': get(parts, 3, '')}) | |
endif | |
endfor | |
7 0.000020 let return_line = filter(copy(docblock_lines), 'v:val =~? "^@return"') | |
7 0.000011 if len(return_line) > 0 | |
let return_parts = matchlist(return_line[0], '@return\s\+\(\S\+\)\s*\(.*\)') | |
let res['return'] = { 'line': return_parts[0], 'type': phpcomplete#GetTypeFromDocBlockParam(get(return_parts, 1, '')), 'description': get(return_parts, 2, '')} | |
endif | |
7 0.000021 let exception_lines = filter(copy(docblock_lines), 'v:val =~? "^\\(@throws\\|@exception\\)"') | |
7 0.000009 for exception_line in exception_lines | |
let parts = matchlist(exception_line, '^\(@throws\|@exception\)\s\+\(\S\+\)\s*\(.*\)') | |
if len(parts) > 0 | |
call add(res.throws, { 'line': parts[0], 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')), 'description': get(parts, 3, '')}) | |
endif | |
endfor | |
7 0.000020 let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"') | |
7 0.000010 if len(var_line) > 0 | |
let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)') | |
let res['var'] = { 'line': var_parts[0], 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')), 'description': get(var_parts, 3, '')} | |
endif | |
7 0.000019 let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"') | |
7 0.000008 for property_line in property_lines | |
let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)') | |
if len(parts) > 0 | |
call add(res.properties, { 'line': parts[0], 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')), 'description': get(parts, 3, '')}) | |
endif | |
endfor | |
7 0.000006 return res | |
FUNCTION AutoPairsReturn() | |
Called 4 times | |
Total time: 0.000213 | |
Self time: 0.000213 | |
count total (s) self (s) | |
4 0.000012 if b:autopairs_enabled == 0 | |
return '' | |
end | |
4 0.000010 let line = getline('.') | |
4 0.000015 let pline = getline(line('.')-1) | |
4 0.000012 let prev_char = pline[strlen(pline)-1] | |
4 0.000004 let cmd = '' | |
4 0.000009 let cur_char = line[col('.')-1] | |
4 0.000043 if has_key(b:AutoPairs, prev_char) && b:AutoPairs[prev_char] == cur_char | |
1 0.000013 if g:AutoPairsCenterLine && winline() * 3 >= winheight(0) * 2 | |
" Recenter before adding new line to avoid replacing line content | |
let cmd = "zz" | |
end | |
" If equalprg has been set, then avoid call = | |
" https://github.com/jiangmiao/auto-pairs/issues/24 | |
1 0.000002 if &equalprg != '' | |
return "\<ESC>".cmd."O" | |
endif | |
" conflict with javascript and coffee | |
" javascript need indent new line | |
" coffeescript forbid indent new line | |
1 0.000002 if &filetype == 'coffeescript' || &filetype == 'coffee' | |
return "\<ESC>".cmd."k==o" | |
else | |
1 0.000003 return "\<ESC>".cmd."=ko" | |
endif | |
end | |
3 0.000002 return '' | |
FUNCTION <SNR>121_CloseWindowIfNeeded() | |
Called 47 times | |
Total time: 0.001537 | |
Self time: 0.000413 | |
count total (s) self (s) | |
47 0.001428 0.000305 if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer) | |
47 0.000032 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 | |
FUNCTION ale#engine#IsExecutable() | |
Called 26 times | |
Total time: 0.000271 | |
Self time: 0.000271 | |
count total (s) self (s) | |
26 0.000041 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. | |
26 0.000080 let l:result = get(s:executable_cache_map, a:executable, v:null) | |
26 0.000024 if l:result isnot v:null | |
26 0.000017 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 | |
FUNCTION ale#Escape() | |
Called 107 times | |
Total time: 0.001348 | |
Self time: 0.001348 | |
count total (s) self (s) | |
107 0.000379 if fnamemodify(&shell, ':t') is? 'cmd.exe' | |
" If the string contains spaces, it will be surrounded by quotes. | |
" Otherwise, special characters will be escaped with carets (^). | |
return substitute( a:str =~# ' ' ? '"' . substitute(a:str, '"', '""', 'g') . '"' : substitute(a:str, '\v([&|<>^])', '^\1', 'g'), '%', '%%', 'g',) | |
endif | |
107 0.000294 return shellescape (a:str) | |
FUNCTION airline#update_statusline_inactive() | |
Called 311 times | |
Total time: 0.629251 | |
Self time: 0.013864 | |
count total (s) self (s) | |
311 0.002125 0.001327 if airline#util#getwinvar(winnr(), 'airline_disabled', 0) | |
return | |
endif | |
519 0.000714 for nr in a:range | |
208 0.001309 0.000728 if airline#util#getwinvar(nr, 'airline_disabled', 0) | |
continue | |
endif | |
208 0.000568 call setwinvar(nr, 'airline_active', 0) | |
208 0.000888 let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) } | |
208 0.000438 if get(g:, 'airline_inactive_alt_sep', 0) | |
call extend(context, { 'left_sep': g:airline_left_alt_sep, 'right_sep': g:airline_right_alt_sep }, 'keep') | |
endif | |
208 0.616547 0.002539 call s:invoke_funcrefs(context, s:inactive_funcrefs) | |
208 0.000222 endfor | |
FUNCTION ale#lsp#response#ReadDiagnostics() | |
Called 48 times | |
Total time: 0.005719 | |
Self time: 0.005719 | |
count total (s) self (s) | |
48 0.000064 let l:loclist = [] | |
122 0.000156 for l:diagnostic in a:response.params.diagnostics | |
74 0.000163 let l:severity = get(l:diagnostic, 'severity', 0) | |
74 0.000509 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,} | |
74 0.000096 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 | |
74 0.000119 if has_key(l:diagnostic, 'code') | |
74 0.000130 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 | |
74 0.000033 endif | |
74 0.000126 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 | |
74 0.000117 if has_key(l:diagnostic, 'source') | |
74 0.000301 let l:loclist_item.detail = printf('[%s] %s', l:diagnostic.source, l:diagnostic.message) | |
74 0.000033 endif | |
74 0.000135 call add(l:loclist, l:loclist_item) | |
74 0.000055 endfor | |
48 0.000039 return l:loclist | |
FUNCTION <SNR>84_CreateTemporaryFileForJob() | |
Called 26 times | |
Total time: 0.159279 | |
Self time: 0.037265 | |
count total (s) self (s) | |
26 0.000049 if empty(a:temporary_file) | |
" There is no file, so we didn't create anything. | |
return 0 | |
endif | |
26 0.000078 let l:temporary_directory = fnamemodify(a:temporary_file, ':h') | |
" Create the temporary directory for the file, unreadable by 'other' | |
" users. | |
26 0.036154 call mkdir(l:temporary_directory, '', 0750) | |
" Automatically delete the directory later. | |
26 0.000671 0.000200 call ale#engine#ManageDirectory(a:buffer, l:temporary_directory) | |
" Write the buffer out to a file. | |
26 0.000285 let l:lines = getbufline(a:buffer, 1, '$') | |
26 0.121748 0.000206 call ale#util#Writefile(a:buffer, l:lines, a:temporary_file) | |
26 0.000089 return 1 | |
FUNCTION Skippmatch() | |
Called 13 times | |
Total time: 0.001814 | |
Self time: 0.001814 | |
count total (s) self (s) | |
13 0.001663 let synname = synIDattr(synID(line("."), col("."), 0), "name") | |
13 0.000120 if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment | |
13 0.000012 return 0 | |
else | |
return 1 | |
endif | |
FUNCTION <SNR>76_CheckDefined() | |
Called 3794 times | |
Total time: 0.100359 | |
Self time: 0.100359 | |
count total (s) self (s) | |
" Checks, whether the definition of the colors is valid and is not empty or NONE | |
" e.g. if the colors would expand to this: | |
" hi airline_c ctermfg=NONE ctermbg=NONE | |
" that means to clear that highlighting group, therefore, fallback to Normal | |
" highlighting group for the cterm values | |
" This only works, if the Normal highlighting group is actually defined, so | |
" return early, if it has been cleared | |
3794 0.009330 if !exists("g:airline#highlighter#normal_fg_hi") | |
let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm') | |
endif | |
3794 0.009569 if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0 | |
return a:colors | |
endif | |
10338 0.011518 for val in a:colors | |
10338 0.019411 if !empty(val) && val !=# 'NONE' | |
3794 0.002893 return a:colors | |
endif | |
6544 0.004382 endfor | |
" this adds the bold attribute to the term argument of the :hi command, | |
" but at least this makes sure, the group will be defined | |
let fg = g:airline#highlighter#normal_fg_hi | |
let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm') | |
if bg < 0 | |
" in case there is no background color defined for Normal | |
let bg = a:colors[3] | |
endif | |
return a:colors[0:1] + [fg, bg] + [a:colors[4]] | |
FUNCTION ale#lsp#ReadMessageData() | |
Called 1902 times | |
Total time: 0.208022 | |
Self time: 0.208022 | |
count total (s) self (s) | |
1902 0.002713 let l:response_list = [] | |
1902 0.002580 let l:remainder = a:data | |
4418 0.003453 while 1 | |
" Look for the end of the HTTP headers | |
4418 0.023847 let l:body_start_index = matchend(l:remainder, "\r\n\r\n") | |
4418 0.004628 if l:body_start_index < 0 | |
" No header end was found yet. | |
1902 0.001349 break | |
endif | |
" Parse the Content-Length header. | |
2516 0.007220 let l:header_data = l:remainder[:l:body_start_index - 4] | |
2516 0.032552 let l:length_match = matchlist( l:header_data, '\vContent-Length: *(\d+)') | |
2516 0.003911 if empty(l:length_match) | |
throw "Invalid JSON-RPC header:\n" . l:header_data | |
endif | |
" Split the body and the remainder of the text. | |
2516 0.008227 let l:remainder_start_index = l:body_start_index + str2nr(l:length_match[1]) | |
2516 0.006808 if len(l:remainder) < l:remainder_start_index | |
" We don't have enough data yet. | |
break | |
endif | |
2516 0.006798 let l:body = l:remainder[l:body_start_index : l:remainder_start_index - 1] | |
2516 0.005779 let l:remainder = l:remainder[l:remainder_start_index :] | |
" Parse the JSON object and add it to the list. | |
2516 0.022718 call add(l:response_list, json_decode(l:body)) | |
2516 0.003387 endwhile | |
1902 0.003249 return [l:remainder, l:response_list] | |
FUNCTION ale#job#SendRaw() | |
Called 77 times | |
Total time: 0.001363 | |
Self time: 0.001363 | |
count total (s) self (s) | |
77 0.000169 if has('nvim') | |
77 0.000838 call jobsend(a:job_id, a:string) | |
77 0.000049 else | |
call ch_sendraw(job_getchannel(s:job_map[a:job_id].job), a:string) | |
endif | |
FUNCTION phpcomplete#ClearCachedClassContents() | |
Called 1 time | |
Total time: 0.000009 | |
Self time: 0.000009 | |
count total (s) self (s) | |
1 0.000003 for [cache_key, cached_value] in items(s:cache_classstructures) | |
if stridx(cache_key, a:full_file_path.'#') == 0 | |
call remove(s:cache_classstructures, cache_key) | |
endif | |
endfor | |
FUNCTION FugitiveHead() | |
Called 1439 times | |
Total time: 0.143327 | |
Self time: 0.017575 | |
count total (s) self (s) | |
1439 0.012462 0.006252 let dir = FugitiveGitDir(a:0 > 1 ? a:2 : -1) | |
1439 0.002026 if empty(dir) | |
return '' | |
endif | |
1439 0.126345 0.006803 return fugitive#Head(a:0 ? a:1 : 0, dir) | |
FUNCTION <SNR>71_ale_refresh() | |
Called 74 times | |
Total time: 0.000625 | |
Self time: 0.000625 | |
count total (s) self (s) | |
74 0.000338 if get(g:, 'airline_skip_empty_sections', 0) | |
exe ':AirlineRefresh' | |
endif | |
FUNCTION ale#util#Tempname() | |
Called 26 times | |
Total time: 0.000484 | |
Self time: 0.000484 | |
count total (s) self (s) | |
26 0.000084 let l:clear_tempdir = 0 | |
26 0.000089 if exists('$TMPDIR') && empty($TMPDIR) | |
let l:clear_tempdir = 1 | |
let $TMPDIR = '/tmp' | |
endif | |
26 0.000018 try | |
26 0.000070 let l:name = tempname() " no-custom-checks | |
26 0.000019 finally | |
26 0.000020 if l:clear_tempdir | |
let $TMPDIR = '' | |
endif | |
26 0.000015 endtry | |
26 0.000021 return l:name | |
FUNCTION airline#highlighter#highlight() | |
Called 18 times | |
Total time: 0.383544 | |
Self time: 0.053640 | |
count total (s) self (s) | |
18 0.000031 let bufnr = a:0 ? a:1 : '' | |
18 0.000051 let p = g:airline#themes#{g:airline_theme}#palette | |
" draw the base mode, followed by any overrides | |
18 0.000150 let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') | |
18 0.000033 let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' | |
18 0.000023 let airline_grouplist = [] | |
18 0.000067 let buffers_in_tabpage = sort(tabpagebuflist()) | |
18 0.000034 if exists("*uniq") | |
18 0.000040 let buffers_in_tabpage = uniq(buffers_in_tabpage) | |
18 0.000007 endif | |
" mapped might be something like ['normal', 'normal_modified'] | |
" if a group is in both modes available, only define the second | |
" that is how this was done previously overwrite the previous definition | |
54 0.000098 for mode in reverse(mapped) | |
36 0.000203 if exists('g:airline#themes#{g:airline_theme}#palette[mode]') | |
32 0.000092 let dict = g:airline#themes#{g:airline_theme}#palette[mode] | |
691 0.001960 for kvp in items(dict) | |
659 0.000958 let mode_colors = kvp[1] | |
659 0.000815 let name = kvp[0] | |
659 0.001416 if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive' | |
4 0.000007 let name = 'airline_c'.bufnr | |
4 0.000002 endif | |
" do not re-create highlighting for buffers that are no longer visible | |
" in the current tabpage | |
659 0.004113 if name =~# 'airline_c\d\+' | |
221 0.001523 let bnr = matchstr(name, 'airline_c\zs\d\+') + 0 | |
221 0.000475 if bnr > 0 && index(buffers_in_tabpage, bnr) == -1 | |
185 0.000146 continue | |
endif | |
36 0.000076 elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix)) | |
" group will be redefined below at exec_separator | |
" or is not needed for tabline with '_inactive' suffix | |
" since active flag is 1 for builder) | |
224 0.000224 continue | |
endif | |
250 0.003165 0.001352 if s:group_not_done(airline_grouplist, name.suffix) | |
180 0.038955 0.001080 call airline#highlighter#exec(name.suffix, mode_colors) | |
180 0.000088 endif | |
750 0.001257 for accent in keys(s:accents) | |
500 0.001081 if !has_key(p.accents, accent) | |
continue | |
endif | |
500 0.001702 let colors = copy(mode_colors) | |
500 0.000984 if p.accents[accent][0] != '' | |
250 0.000542 let colors[0] = p.accents[accent][0] | |
250 0.000140 endif | |
500 0.000796 if p.accents[accent][2] != '' | |
250 0.000444 let colors[2] = p.accents[accent][2] | |
250 0.000124 endif | |
500 0.000668 if len(colors) >= 5 | |
500 0.001377 let colors[4] = get(p.accents[accent], 4, '') | |
500 0.000274 else | |
call add(colors, get(p.accents[accent], 4, '')) | |
endif | |
500 0.005888 0.002732 if s:group_not_done(airline_grouplist, name.suffix.'_'.accent) | |
360 0.078588 0.002418 call airline#highlighter#exec(name.suffix.'_'.accent, colors) | |
360 0.000194 endif | |
500 0.000373 endfor | |
250 0.000197 endfor | |
32 0.000052 if empty(s:separators) | |
" nothing to be done | |
continue | |
endif | |
" TODO: optimize this | |
487 0.001301 for sep in items(s:separators) | |
" we cannot check, that the group already exists, else the separators | |
" might not be correctly defined. But perhaps we can skip above groups | |
" that match the '_to_' name, because they would be redefined here... | |
455 0.214350 0.003462 call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) | |
455 0.000328 endfor | |
32 0.000015 endif | |
36 0.000044 endfor | |
FUNCTION <SNR>84_RunLinter() | |
Called 52 times | |
Total time: 0.263904 | |
Self time: 0.001282 | |
count total (s) self (s) | |
52 0.000105 if !empty(a:linter.lsp) | |
26 0.023529 0.000193 return ale#lsp_linter#CheckWithLSP(a:buffer, a:linter) | |
else | |
26 0.000848 0.000110 let l:executable = ale#linter#GetExecutable(a:buffer, a:linter) | |
26 0.000370 0.000100 if ale#engine#IsExecutable(a:buffer, l:executable) | |
26 0.238841 0.000563 return s:InvokeChain(a:buffer, l:executable, a:linter, 0, []) | |
endif | |
endif | |
return 0 | |
FUNCTION <SNR>85_CreateCountDict() | |
Called 92 times | |
Total time: 0.000698 | |
Self time: 0.000698 | |
count total (s) self (s) | |
" Keys 0 and 1 are for backwards compatibility. | |
" The count object used to be a List of [error_count, warning_count]. | |
92 0.000534 return { '0': 0, '1': 0, 'error': 0, 'warning': 0, 'info': 0, 'style_error': 0, 'style_warning': 0, 'total': 0,} | |
FUNCTION ale#lsp#message#GetNextVersionID() | |
Called 48 times | |
Total time: 0.000625 | |
Self time: 0.000625 | |
count total (s) self (s) | |
" Use the current ID | |
48 0.000088 let l:id = g:ale_lsp_next_version_id | |
" Increment the ID variable. | |
48 0.000127 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. | |
48 0.000050 if g:ale_lsp_next_version_id < 1 | |
let g:ale_lsp_next_version_id = 1 | |
endif | |
48 0.000034 return l:id | |
FUNCTION airline#parts#ffenc() | |
Called 1459 times | |
Total time: 0.025614 | |
Self time: 0.025614 | |
count total (s) self (s) | |
1459 0.004398 let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '') | |
1459 0.002282 let bomb = &l:bomb ? '[BOM]' : '' | |
1459 0.007589 let ff = strlen(&ff) ? '['.&ff.']' : '' | |
1459 0.004870 if expected is# &fenc.bomb.ff | |
return '' | |
else | |
1459 0.003439 return &fenc.bomb.ff | |
endif | |
FUNCTION ale#Var() | |
Called 807 times | |
Total time: 0.008205 | |
Self time: 0.008205 | |
count total (s) self (s) | |
807 0.001722 let l:full_name = 'ale_' . a:variable_name | |
807 0.002941 let l:vars = getbufvar(str2nr(a:buffer), '', {}) | |
807 0.002635 return get(l:vars, l:full_name, g:[l:full_name]) | |
FUNCTION airline#util#ignore_buf() | |
Called 1450 times | |
Total time: 0.051121 | |
Self time: 0.051121 | |
count total (s) self (s) | |
1450 0.008867 let pat = '\c\v'. get(g:, 'airline#ignore_bufadd_pat', ''). get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', 'gundo|undotree|vimfiler|tagbar|nerd_tree|startify|!') | |
1450 0.041109 return match(a:name, pat) > -1 | |
FUNCTION AutoPairsMap() | |
Called 936 times | |
Total time: 0.015598 | |
Self time: 0.015598 | |
count total (s) self (s) | |
" | is special key which separate map command from text | |
936 0.001065 let key = a:key | |
936 0.001002 if key == '|' | |
let key = '<BAR>' | |
end | |
936 0.003568 let escaped_key = substitute(key, "'", "''", 'g') | |
" use expr will cause search() doesn't work | |
936 0.007314 execute 'inoremap <buffer> <silent> '.key." <C-R>=AutoPairsInsert('".escaped_key."')<CR>" | |
FUNCTION airline#parts#paste() | |
Called 1439 times | |
Total time: 0.003022 | |
Self time: 0.003022 | |
count total (s) self (s) | |
1439 0.002548 return g:airline_detect_paste && &paste ? g:airline_symbols.paste : '' | |
FUNCTION airline#update_statusline() | |
Called 311 times | |
Total time: 2.679082 | |
Self time: 0.017450 | |
count total (s) self (s) | |
311 0.002636 0.001593 if airline#util#getwinvar(winnr(), 'airline_disabled', 0) | |
return | |
endif | |
311 0.001993 let range = filter(range(1, winnr('$')), 'v:val != winnr()') | |
" create inactive statusline | |
311 0.630705 0.001454 call airline#update_statusline_inactive(range) | |
311 0.000553 unlet! w:airline_render_left w:airline_render_right | |
311 0.003622 exe 'unlet! ' 'w:airline_section_'. join(s:sections, ' w:airline_section_') | |
" Now create the active statusline | |
311 0.000387 let w:airline_active = 1 | |
311 0.001467 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } | |
311 2.036280 0.004942 call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) | |
FUNCTION ale#util#GetLineCount() | |
Called 74 times | |
Total time: 0.001683 | |
Self time: 0.001683 | |
count total (s) self (s) | |
74 0.001574 return len(getbufline(a:buffer, 1, '$')) | |
FUNCTION ale#util#BinarySearch() | |
Called 13 times | |
Total time: 0.000526 | |
Self time: 0.000526 | |
count total (s) self (s) | |
13 0.000025 let l:min = 0 | |
13 0.000029 let l:max = len(a:loclist) - 1 | |
16 0.000016 while 1 | |
16 0.000056 if l:max < l:min | |
9 0.000007 return -1 | |
endif | |
7 0.000013 let l:mid = (l:min + l:max) / 2 | |
7 0.000012 let l:item = a:loclist[l:mid] | |
" Binary search for equal buffers, equal lines, then near columns. | |
7 0.000011 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 | |
3 0.000003 let l:max = l:mid - 1 | |
3 0.000001 else | |
" This part is a small sequential search. | |
4 0.000006 let l:index = l:mid | |
" Search backwards to find the first problem on the line. | |
6 0.000018 while l:index > 0&& a:loclist[l:index - 1].bufnr == a:buffer&& a:loclist[l:index - 1].lnum == a:line | |
2 0.000003 let l:index -= 1 | |
2 0.000002 endwhile | |
" Find the last problem on or before this column. | |
4 0.000020 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. | |
4 0.000010 let l:item_column = a:loclist[l:index].col | |
6 0.000033 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 | |
2 0.000002 let l:index += 1 | |
2 0.000001 endwhile | |
4 0.000005 return l:index | |
endif | |
3 0.000002 endwhile | |
FUNCTION phpcomplete#EvaluateModifiers() | |
Called 68 times | |
Total time: 0.001696 | |
Self time: 0.001696 | |
count total (s) self (s) | |
" if theres no modifier, and no modifier is allowed and no modifier is required | |
68 0.000185 if len(a:modifiers) == 0 && len(a:required_modifiers) == 0 | |
return 1 | |
else | |
" check if every requred modifier is present | |
68 0.000099 for required_modifier in a:required_modifiers | |
if index(a:modifiers, required_modifier) == -1 | |
return 0 | |
endif | |
endfor | |
170 0.000165 for modifier in a:modifiers | |
" if the modifier is prohibited it's a no match | |
102 0.000220 if index(a:prohibited_modifiers, modifier) != -1 | |
return 0 | |
endif | |
102 0.000047 endfor | |
" anything that is not explicitly required or prohibited is allowed | |
68 0.000043 return 1 | |
endif | |
FUNCTION airline#parts#readonly() | |
Called 1450 times | |
Total time: 0.072933 | |
Self time: 0.021812 | |
count total (s) self (s) | |
" only consider regular buffers (e.g. ones that represent actual files, | |
" but not special ones like e.g. NERDTree) | |
1450 0.061668 0.010548 if !empty(&buftype) || airline#util#ignore_buf(bufname('%')) | |
return '' | |
endif | |
1450 0.003117 if &readonly && !filereadable(bufname('%')) | |
return '[noperm]' | |
else | |
1450 0.001804 return &readonly ? g:airline_symbols.readonly : '' | |
endif | |
FUNCTION fugitive#Head() | |
Called 1439 times | |
Total time: 0.119542 | |
Self time: 0.119542 | |
count total (s) self (s) | |
1439 0.003288 let dir = a:0 > 1 ? a:2 : get(b:, 'git_dir', '') | |
1439 0.041517 if empty(dir) || !filereadable(dir . '/HEAD') | |
return '' | |
endif | |
1439 0.043211 let head = readfile(dir . '/HEAD')[0] | |
1439 0.010295 if head =~# '^ref: ' | |
1439 0.016889 return substitute(head, '\C^ref: \%(refs/\%(heads/\|remotes/\|tags/\)\=\)\=', '', '') | |
elseif head =~# '^\x\{40\}$' | |
let len = a:0 ? a:1 : 0 | |
return len < 0 ? head : len ? head[0:len-1] : '' | |
else | |
return '' | |
endif | |
FUNCTION ale#sign#ParseSigns() | |
Called 74 times | |
Total time: 0.009155 | |
Self time: 0.009155 | |
count total (s) self (s) | |
" 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 | |
74 0.000187 let l:pattern = '\v^.*\=(\d+).*\=(\d+).*\=(ALE[a-zA-Z]+Sign)' | |
74 0.000103 let l:result = [] | |
74 0.000093 let l:is_dummy_sign_set = 0 | |
330 0.000357 for l:line in a:line_list | |
256 0.004396 let l:match = matchlist(l:line, l:pattern) | |
256 0.000409 if len(l:match) > 0 | |
122 0.000183 if l:match[3] is# 'ALEDummySign' | |
let l:is_dummy_sign_set = 1 | |
else | |
122 0.000580 call add(l:result, [ str2nr(l:match[1]), str2nr(l:match[2]), l:match[3],]) | |
122 0.000060 endif | |
122 0.000052 endif | |
256 0.000175 endfor | |
74 0.000142 return [l:is_dummy_sign_set, l:result] | |
FUNCTION <SNR>41_dopopd() | |
Called 214 times | |
Total time: 0.000853 | |
Self time: 0.000853 | |
count total (s) self (s) | |
214 0.000551 if !exists('w:fzf_pushd') | |
214 0.000137 return | |
endif | |
" FIXME: We temporarily change the working directory to 'dir' entry | |
" of options dictionary (set to the current working directory if not given) | |
" before running fzf. | |
" | |
" e.g. call fzf#run({'dir': '/tmp', 'source': 'ls', 'sink': 'e'}) | |
" | |
" After processing the sink function, we have to restore the current working | |
" directory. But doing so may not be desirable if the function changed the | |
" working directory on purpose. | |
" | |
" So how can we tell if we should do it or not? A simple heuristic we use | |
" here is that we change directory only if the current working directory | |
" matches 'dir' entry. However, it is possible that the sink function did | |
" change the directory to 'dir'. In that case, the user will have an | |
" unexpected result. | |
if s:fzf_getcwd() ==# w:fzf_pushd.dir | |
execute w:fzf_pushd.command s:escape(w:fzf_pushd.origin) | |
endif | |
unlet w:fzf_pushd | |
FUNCTION ale#util#GetItemPriority() | |
Called 218 times | |
Total time: 0.003200 | |
Self time: 0.003200 | |
count total (s) self (s) | |
218 0.000329 if a:item.type is# 'I' | |
return g:ale#util#info_priority | |
endif | |
218 0.000228 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 | |
218 0.000491 if get(a:item, 'sub_type', '') is# 'style' | |
return g:ale#util#style_error_priority | |
endif | |
218 0.000220 return g:ale#util#error_priority | |
FUNCTION ale#cursor#TruncatedEcho() | |
Called 4 times | |
Total time: 0.000705 | |
Self time: 0.000692 | |
count total (s) self (s) | |
4 0.000006 let l:message = a:original_message | |
" Change tabs to spaces. | |
4 0.000017 let l:message = substitute(l:message, "\t", ' ', 'g') | |
" Remove any newlines in the message. | |
4 0.000013 let l:message = substitute(l:message, "\n", '', 'g') | |
" We need to remember the setting for shortmess and reset it again. | |
4 0.000011 let l:shortmess_options = &l:shortmess | |
4 0.000003 try | |
4 0.000011 let l:cursor_position = getcurpos() | |
" The message is truncated and saved to the history. | |
4 0.000040 0.000030 setlocal shortmess+=T | |
4 0.000003 try | |
4 0.000426 exec "norm! :echomsg l:message\n" | |
4 0.000005 catch /^Vim\%((\a\+)\)\=:E523/ | |
" Fallback into manual truncate (#1987) | |
let l:winwidth = winwidth(0) | |
if l:winwidth < strdisplaywidth(l:message) | |
" Truncate message longer than window width with trailing '...' | |
let l:message = l:message[:l:winwidth - 4] . '...' | |
endif | |
exec 'echomsg l:message' | |
endtry | |
" 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. | |
4 0.000022 if l:cursor_position != getcurpos() | |
call setpos('.', l:cursor_position) | |
endif | |
4 0.000004 finally | |
4 0.000022 0.000019 let &l:shortmess = l:shortmess_options | |
4 0.000003 endtry | |
FUNCTION ale#engine#RunLinters() | |
Called 26 times | |
Total time: 0.269908 | |
Self time: 0.003380 | |
count total (s) self (s) | |
" Initialise the buffer information if needed. | |
26 0.000668 0.000139 let l:new_buffer = ale#engine#InitBufferInfo(a:buffer) | |
26 0.001051 0.000130 call s:StopCurrentJobs(a:buffer, a:should_lint_file) | |
26 0.000865 0.000131 call s:RemoveProblemsForDisabledLinters(a:buffer, a:linters) | |
" We can only clear the results if we aren't checking the buffer. | |
26 0.000304 0.000101 let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer) | |
26 0.001118 0.000883 silent doautocmd <nomodeline> User ALELintPre | |
78 0.000386 for l:linter in a:linters | |
" Only run lint_file linters if we should. | |
52 0.000075 if !l:linter.lint_file || a:should_lint_file | |
52 0.264317 0.000413 if s:RunLinter(a:buffer, l:linter) | |
" If a single linter ran, we shouldn't clear everything. | |
45 0.000080 let l:can_clear_results = 0 | |
45 0.000023 endif | |
52 0.000026 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 | |
52 0.000076 endfor | |
" Clear the results if we can. This needs to be done when linters are | |
" disabled, or ALE itself is disabled. | |
26 0.000027 if l:can_clear_results | |
call ale#engine#SetResults(a:buffer, []) | |
elseif l:new_buffer | |
call s:AddProblemsFromOtherBuffers(a:buffer, a:linters) | |
endif | |
FUNCTION airline#builder#should_change_group() | |
Called 2282 times | |
Total time: 0.490868 | |
Self time: 0.036922 | |
count total (s) self (s) | |
2282 0.003232 if a:group1 == a:group2 | |
return 0 | |
endif | |
2282 0.242381 0.008886 let color1 = airline#highlighter#get_highlight(a:group1) | |
2282 0.229149 0.008698 let color2 = airline#highlighter#get_highlight(a:group2) | |
2282 0.002621 if g:airline_gui_mode ==# 'gui' | |
return color1[1] != color2[1] || color1[0] != color2[0] | |
else | |
2282 0.004528 return color1[3] != color2[3] || color1[2] != color2[2] | |
endif | |
FUNCTION ale#path#FindNearestDirectory() | |
Called 55 times | |
Total time: 0.010233 | |
Self time: 0.010233 | |
count total (s) self (s) | |
55 0.001182 let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p') | |
55 0.000250 let l:buffer_filename = fnameescape(l:buffer_filename) | |
55 0.007229 let l:relative_path = finddir(a:directory_name, l:buffer_filename . ';') | |
55 0.000134 if !empty(l:relative_path) | |
55 0.001307 return fnamemodify(l:relative_path, ':p') | |
endif | |
return '' | |
FUNCTION airline#highlighter#exec() | |
Called 3794 times | |
Total time: 0.702255 | |
Self time: 0.166518 | |
count total (s) self (s) | |
3794 0.004663 if pumvisible() | |
return | |
endif | |
3794 0.004088 let colors = a:colors | |
3794 0.002875 if s:is_win32term | |
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, '')) | |
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, '')) | |
endif | |
3794 0.386337 0.015414 let old_hi = airline#highlighter#get_highlight(a:group) | |
3794 0.005700 if len(colors) == 4 | |
3236 0.005766 call add(colors, '') | |
3236 0.001355 endif | |
3794 0.004353 if g:airline_gui_mode ==# 'gui' | |
let new_hi = [colors[0], colors[1], '', '', colors[4]] | |
else | |
3794 0.019756 let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]] | |
3794 0.001570 endif | |
3794 0.114775 0.014416 let colors = s:CheckDefined(colors) | |
3794 0.051723 0.015222 if old_hi != new_hi || !s:hl_group_exists(a:group) | |
350 0.030092 0.002138 let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors)) | |
350 0.003117 exe cmd | |
350 0.000811 if has_key(s:hl_groups, a:group) | |
350 0.000648 let s:hl_groups[a:group] = colors | |
350 0.000174 endif | |
350 0.000137 endif | |
FUNCTION <SNR>84_InvokeChain() | |
Called 26 times | |
Total time: 0.238278 | |
Self time: 0.001033 | |
count total (s) self (s) | |
26 0.001633 0.000142 let l:options = ale#engine#ProcessChain(a:buffer, a:linter, a:chain_index, a:input) | |
26 0.000045 let l:options.executable = a:executable | |
26 0.236541 0.000786 return s:RunJob(l:options) | |
FUNCTION Skippmatch2() | |
Called 10 times | |
Total time: 0.000189 | |
Self time: 0.000189 | |
count total (s) self (s) | |
10 0.000037 let line = getline(".") | |
10 0.000112 if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*' | |
return 1 | |
else | |
10 0.000006 return 0 | |
endif | |
FUNCTION <SNR>69_update_untracked() | |
Called 1439 times | |
Total time: 0.108476 | |
Self time: 0.093474 | |
count total (s) self (s) | |
1439 0.017541 let file = expand("%:p") | |
1439 0.009871 if empty(file) || isdirectory(file) | |
return | |
endif | |
1439 0.001886 let needs_update = 1 | |
4317 0.006863 for vcs in keys(s:vcs_config) | |
2878 0.010838 if file =~ s:vcs_config[vcs].exclude | |
" Skip check for files that live in the exclude directory | |
let needs_update = 0 | |
endif | |
2878 0.007151 if has_key(s:vcs_config[vcs].untracked, file) | |
1439 0.001520 let needs_update = 0 | |
1439 0.022134 0.007132 call airline#extensions#branch#update_untracked_config(file, vcs) | |
1439 0.000672 endif | |
2878 0.001638 endfor | |
1439 0.001177 if !needs_update | |
1439 0.000861 return | |
endif | |
for vcs in keys(s:vcs_config) | |
let config = s:vcs_config[vcs] | |
if g:airline#init#vim_async | |
" Note that asynchronous update updates s:vcs_config only, and only | |
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is | |
" invalidated again before s:update_untracked is called, then we lose the | |
" result of the previous call, i.e. the head string is not updated. It | |
" doesn't happen often in practice, so we let it be. | |
noa call airline#async#vim_vcs_untracked(config, file) | |
else | |
" nvim async or vim without job-feature | |
noa call airline#async#nvim_vcs_untracked(config, file, vcs) | |
endif | |
endfor | |
FUNCTION ale#util#FindItemAtCursor() | |
Called 13 times | |
Total time: 0.000847 | |
Self time: 0.000322 | |
count total (s) self (s) | |
13 0.000073 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
13 0.000038 let l:loclist = get(l:info, 'loclist', []) | |
13 0.000031 let l:pos = getcurpos() | |
13 0.000616 0.000090 let l:index = ale#util#BinarySearch(l:loclist, a:buffer, l:pos[1], l:pos[2]) | |
13 0.000029 let l:loc = l:index >= 0 ? l:loclist[l:index] : {} | |
13 0.000019 return [l:info, l:loc] | |
FUNCTION ale#completion#Show() | |
Called 68 times | |
Total time: 0.003843 | |
Self time: 0.001511 | |
count total (s) self (s) | |
68 0.000365 0.000205 if ale#util#Mode() isnot# 'i' | |
return | |
endif | |
" Set the list in the buffer, temporarily replace omnifunc with our | |
" function, and then start omni-completion. | |
68 0.000233 let b:ale_completion_response = a:response | |
68 0.000155 let b:ale_completion_parser = a:completion_parser | |
" Replace completion options shortly before opening the menu. | |
68 0.002385 0.000214 call s:ReplaceCompletionOptions() | |
68 0.000414 call timer_start(0, {-> ale#util#FeedKeys("\<Plug>(ale_show_completion_menu)")}) | |
FUNCTION ale#lsp#message#DidChange() | |
Called 48 times | |
Total time: 0.005218 | |
Self time: 0.002893 | |
count total (s) self (s) | |
48 0.000622 let l:lines = getbufline(a:buffer, 1, '$') | |
" For changes, we simply send the full text of the document to the server. | |
48 0.004513 0.002188 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"}]}] | |
FUNCTION <SNR>29_CompletionStillValid() | |
Called 2516 times | |
Total time: 0.037435 | |
Self time: 0.030669 | |
count total (s) self (s) | |
2516 0.011273 let [l:line, l:column] = getcurpos()[1:2] | |
2516 0.023921 0.017155 return ale#util#Mode() is# 'i'&& has_key(b:, 'ale_completion_info')&& b:ale_completion_info.request_id == a:request_id&& b:ale_completion_info.line == l:line&& b:ale_completion_info.column == l:column | |
FUNCTION ale#lsp#GetNextMessageID() | |
Called 29 times | |
Total time: 0.000277 | |
Self time: 0.000277 | |
count total (s) self (s) | |
" Use the current ID | |
29 0.000064 let l:id = g:ale_lsp_next_message_id | |
" Increment the ID variable. | |
29 0.000041 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. | |
29 0.000028 if g:ale_lsp_next_message_id < 1 | |
let g:ale_lsp_next_message_id = 1 | |
endif | |
29 0.000018 return l:id | |
FUNCTION ale#linter#GetCommand() | |
Called 81 times | |
Total time: 0.000346 | |
Self time: 0.000346 | |
count total (s) self (s) | |
81 0.000310 return has_key(a:linter, 'command_callback') ? ale#util#GetFunction(a:linter.command_callback)(a:buffer) : a:linter.command | |
FUNCTION ale#completion#Filter() | |
Called 12 times | |
Total time: 0.001281 | |
Self time: 0.000728 | |
count total (s) self (s) | |
12 0.000248 0.000082 let l:excluded_words = ale#Var(a:buffer, 'completion_excluded_words') | |
12 0.000486 0.000099 let l:triggers = s:GetFiletypeValue(s:trigger_character_map, a:filetype) | |
" For completing... | |
" foo. | |
" ^ | |
" We need to include all of the given suggestions. | |
12 0.000029 if index(l:triggers, a:prefix) >= 0 | |
let l:filtered_suggestions = a:suggestions | |
else | |
12 0.000016 let l:filtered_suggestions = [] | |
" Filter suggestions down to those starting with the prefix we used for | |
" finding suggestions in the first place. | |
" | |
" Some completion tools will include suggestions which don't even start | |
" with the characters we have already typed. | |
19 0.000030 for l:item in a:suggestions | |
" A List of String values or a List of completion item Dictionaries | |
" is accepted here. | |
7 0.000016 let l:word = type(l:item) is v:t_string ? l:item : l:item.word | |
" Add suggestions if the suggestion starts with a case-insensitive | |
" match for the prefix. | |
7 0.000017 if l:word[: len(a:prefix) - 1] is? a:prefix | |
7 0.000011 call add(l:filtered_suggestions, l:item) | |
7 0.000003 endif | |
7 0.000004 endfor | |
12 0.000006 endif | |
12 0.000026 if !empty(l:excluded_words) | |
" Copy the List if needed. We don't want to modify the argument. | |
" We shouldn't make a copy if we don't need to. | |
if l:filtered_suggestions is a:suggestions | |
let l:filtered_suggestions = copy(a:suggestions) | |
endif | |
" Remove suggestions with words in the exclusion List. | |
call filter( l:filtered_suggestions, 'index(l:excluded_words, type(v:val) is v:t_string ? v:val : v:val.word) < 0',) | |
endif | |
12 0.000011 return l:filtered_suggestions | |
FUNCTION ale#engine#Cleanup() | |
Called 102 times | |
Total time: 0.000917 | |
Self time: 0.000917 | |
count total (s) self (s) | |
" Don't bother with cleanup code when newer NeoVim versions are exiting. | |
102 0.000312 if get(v:, 'exiting', v:null) isnot v:null | |
return | |
endif | |
102 0.000258 if !has_key(g:ale_buffer_info, a:buffer) | |
102 0.000046 return | |
endif | |
call ale#engine#RunLinters(a:buffer, [], 1) | |
call remove(g:ale_buffer_info, a:buffer) | |
FUNCTION ale#util#FeedKeys() | |
Called 68 times | |
Total time: 0.000348 | |
Self time: 0.000348 | |
count total (s) self (s) | |
68 0.000311 return call('feedkeys', a:000) | |
FUNCTION ale#completion#ParseLSPCompletions() | |
Called 12 times | |
Total time: 0.002802 | |
Self time: 0.001513 | |
count total (s) self (s) | |
12 0.000050 let l:buffer = bufnr('') | |
12 0.000050 let l:info = get(b:, 'ale_completion_info', {}) | |
12 0.000042 let l:Filter = get(l:info, 'completion_filter', v:null) | |
12 0.000017 if l:Filter is v:null | |
12 0.000028 let l:Filter = function('ale#completion#NullFilter') | |
12 0.000007 else | |
let l:Filter = ale#util#GetFunction(l:Filter) | |
endif | |
12 0.000017 let l:item_list = [] | |
12 0.000046 if type(get(a:response, 'result')) is v:t_list | |
let l:item_list = a:response.result | |
elseif type(get(a:response, 'result')) is v:t_dict&& type(get(a:response.result, 'items')) is v:t_list | |
11 0.000017 let l:item_list = a:response.result.items | |
11 0.000005 endif | |
12 0.000013 let l:results = [] | |
19 0.000026 for l:item in l:item_list | |
7 0.000049 0.000041 if !call(l:Filter, [l:buffer, l:item]) | |
continue | |
endif | |
7 0.000057 let l:word = matchstr(l:item.label, '\v^[^(]+') | |
7 0.000010 if empty(l:word) | |
continue | |
endif | |
" See :help complete-items for Vim completion kinds | |
7 0.000011 if !has_key(l:item, 'kind') | |
let l:kind = 'v' | |
elseif l:item.kind is s:LSP_COMPLETION_METHOD_KIND | |
let l:kind = 'm' | |
elseif l:item.kind is s:LSP_COMPLETION_CONSTRUCTOR_KIND | |
let l:kind = 'm' | |
elseif l:item.kind is s:LSP_COMPLETION_FUNCTION_KIND | |
5 0.000005 let l:kind = 'f' | |
5 0.000006 elseif l:item.kind is s:LSP_COMPLETION_CLASS_KIND | |
let l:kind = 'f' | |
elseif l:item.kind is s:LSP_COMPLETION_INTERFACE_KIND | |
let l:kind = 'f' | |
else | |
2 0.000002 let l:kind = 'v' | |
2 0.000001 endif | |
7 0.000015 let l:doc = get(l:item, 'documentation', '') | |
7 0.000016 if type(l:doc) is v:t_dict && has_key(l:doc, 'value') | |
let l:doc = l:doc.value | |
endif | |
7 0.000059 call add(l:results, { 'word': l:word, 'kind': l:kind, 'icase': 1, 'menu': get(l:item, 'detail', ''), 'info': (type(l:doc) is v:t_string ? l:doc : ''),}) | |
7 0.000004 endfor | |
12 0.000024 if has_key(l:info, 'prefix') | |
12 0.001402 0.000121 return ale#completion#Filter(l:buffer, &filetype, l:results, l:info.prefix) | |
endif | |
return l:results | |
FUNCTION ale#util#StartPartialTimer() | |
Called 74 times | |
Total time: 0.001155 | |
Self time: 0.001155 | |
count total (s) self (s) | |
74 0.000592 let l:timer_id = timer_start(a:delay, function('s:ApplyPartialTimer')) | |
74 0.000370 let s:partial_timers[l:timer_id] = [a:callback, a:args] | |
74 0.000073 return l:timer_id | |
FUNCTION ale#completion#GetTriggerCharacter() | |
Called 29 times | |
Total time: 0.000980 | |
Self time: 0.000357 | |
count total (s) self (s) | |
29 0.000813 0.000190 let l:char_list = s:GetFiletypeValue(s:trigger_character_map, a:filetype) | |
29 0.000063 if index(l:char_list, a:prefix) >= 0 | |
return a:prefix | |
endif | |
29 0.000016 return '' | |
FUNCTION <SNR>80_add_section() | |
Called 3112 times | |
Total time: 0.180343 | |
Self time: 0.067206 | |
count total (s) self (s) | |
3112 0.010577 let condition = (a:key is# "warning" || a:key is# "error") && (v:version == 704 && !has("patch1511")) | |
" i have no idea why the warning section needs special treatment, but it's | |
" needed to prevent separators from showing up | |
3112 0.028982 0.012214 if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key))) | |
return | |
endif | |
3112 0.001784 if condition | |
call a:builder.add_raw('%(') | |
endif | |
3112 0.118574 0.022205 call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key)) | |
3112 0.001956 if condition | |
call a:builder.add_raw('%)') | |
endif | |
FUNCTION <SNR>102_LanguageGetter() | |
Called 55 times | |
Total time: 0.000109 | |
Self time: 0.000109 | |
count total (s) self (s) | |
55 0.000061 return l:self.language | |
FUNCTION ale#util#LocItemCompare() | |
Called 129 times | |
Total time: 0.003521 | |
Self time: 0.002727 | |
count total (s) self (s) | |
129 0.000194 if a:left.bufnr < a:right.bufnr | |
return -1 | |
endif | |
129 0.000148 if a:left.bufnr > a:right.bufnr | |
return 1 | |
endif | |
129 0.000105 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 | |
129 0.000116 if a:left.lnum < a:right.lnum | |
31 0.000018 return -1 | |
endif | |
98 0.000088 if a:left.lnum > a:right.lnum | |
51 0.000028 return 1 | |
endif | |
47 0.000043 if a:left.col < a:right.col | |
14 0.000008 return -1 | |
endif | |
33 0.000027 if a:left.col > a:right.col | |
8 0.000004 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. | |
25 0.000099 if !has_key(a:left, 'type') || !has_key(a:right, 'type') | |
return 0 | |
endif | |
25 0.000581 0.000118 let l:left_priority = ale#util#GetItemPriority(a:left) | |
25 0.000417 0.000085 let l:right_priority = ale#util#GetItemPriority(a:right) | |
25 0.000026 if l:left_priority < l:right_priority | |
return -1 | |
endif | |
25 0.000033 if l:left_priority > l:right_priority | |
return 1 | |
endif | |
25 0.000013 return 0 | |
FUNCTION phpcomplete#GetMethodStack() | |
Called 34 times | |
Total time: 0.007485 | |
Self time: 0.007485 | |
count total (s) self (s) | |
34 0.000042 let methodstack = [] | |
34 0.000030 let i = 0 | |
34 0.000065 let end = len(a:line) | |
34 0.000036 let current_part = '' | |
34 0.000031 let parent_depth = 0 | |
34 0.000029 let in_string = 0 | |
34 0.000029 let string_start = '' | |
34 0.000029 let next_char = '' | |
238 0.000170 while i < end | |
204 0.000282 let current_char = a:line[i] | |
204 0.000397 let next_char = i + 1 < end ? a:line[i + 1] : '' | |
204 0.000332 let prev_char = i >= 1 ? a:line[i - 1] : '' | |
204 0.000330 let prev_prev_char = i >= 2 ? a:line[i - 2] : '' | |
204 0.000559 if in_string == 0 && parent_depth == 0 && ((current_char == '-' && next_char == '>') || (current_char == ':' && next_char == ':')) | |
34 0.000082 call add(methodstack, current_part) | |
34 0.000032 let current_part = '' | |
34 0.000025 let i += 2 | |
34 0.000027 continue | |
endif | |
" if it's looks like a string | |
170 0.000257 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 | |
170 0.000247 if !in_string && a:line[i] == '(' | |
let parent_depth += 1 | |
endif | |
170 0.000213 if !in_string && a:line[i] == ')' | |
let parent_depth -= 1 | |
endif | |
170 0.000268 let current_part .= current_char | |
170 0.000145 let i += 1 | |
170 0.000073 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) | |
34 0.000040 if current_part != '' | |
call add(methodstack, current_part) | |
endif | |
34 0.000029 return methodstack | |
FUNCTION <SNR>102_GetAliasedFiletype() | |
Called 55 times | |
Total time: 0.002306 | |
Self time: 0.002306 | |
count total (s) self (s) | |
55 0.000234 let l:buffer_aliases = get(b:, 'ale_linter_aliases', {}) | |
" b:ale_linter_aliases can be set to a List or String. | |
55 0.000224 if type(l:buffer_aliases) is v:t_list|| type(l:buffer_aliases) is v:t_string | |
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. | |
220 0.000448 for l:dict in [ l:buffer_aliases, g:ale_linter_aliases, s:default_ale_linter_aliases,] | |
165 0.000370 if has_key(l:dict, a:original_filetype) | |
return l:dict[a:original_filetype] | |
endif | |
165 0.000099 endfor | |
55 0.000055 return a:original_filetype | |
FUNCTION phpcomplete#GetClassName() | |
Called 34 times | |
Total time: 0.038271 | |
Self time: 0.027522 | |
count total (s) self (s) | |
" 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 | |
34 0.000065 let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' | |
34 0.000050 let function_name_pattern = '[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*' | |
34 0.000053 let function_invocation_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*(' | |
34 0.000049 let variable_name_pattern = '\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' | |
34 0.000036 let classname_candidate = '' | |
34 0.000054 let class_candidate_namespace = a:current_namespace | |
34 0.000043 let class_candidate_imports = a:imports | |
34 0.007694 0.000209 let methodstack = phpcomplete#GetMethodStack(a:context) | |
34 0.000137 if a:context =~? '\$this->' || a:context =~? '\(self\|static\)::' || a:context =~? 'parent::' | |
34 0.000032 let i = 1 | |
1088 0.000828 while i < a:start_line | |
1088 0.001932 let line = getline(a:start_line - i) | |
" Don't complete self:: or $this if outside of a class | |
" (assumes correct indenting) | |
1088 0.001889 if line =~ '^}' | |
return '' | |
endif | |
1088 0.006172 if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class\s' | |
34 0.000446 let class_name = matchstr(line, '\cclass\s\+\zs'.class_name_pattern.'\ze') | |
34 0.000498 let extended_class = matchstr(line, '\cclass\s\+'.class_name_pattern.'\s\+extends\s\+\zs'.class_name_pattern.'\ze') | |
34 0.000148 let classname_candidate = a:context =~? 'parent::' ? extended_class : class_name | |
34 0.000042 if classname_candidate != '' | |
34 0.003586 0.000322 let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack) | |
" return absolute classname, without leading \ | |
34 0.000134 return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate | |
endif | |
endif | |
1054 0.000753 let i += 1 | |
1054 0.000453 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) | |
" the iterated expression should return an array type | |
if prev_class =~ '\[\]$' | |
let prev_class = matchstr(prev_class, '\v^[^[]+') | |
else | |
return | |
endif | |
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 | |
" catch clause with the variable in question | |
if line =~? 'catch\s*(\zs'.class_name_pattern.'\ze\s\+'.object | |
let classname = matchstr(line, 'catch\s*(\zs'.class_name_pattern.'\ze\s\+'.object) | |
if stridx(classname, '\') != -1 | |
let classname_parts = split(classname, '\\\+') | |
let classname_candidate = classname_parts[-1] | |
let class_candidate_namespace = join(classname_parts[0:-2], '\') | |
else | |
let classname_candidate = classname | |
let class_candidate_namespace = '\' | |
endif | |
break | |
endif | |
let i += 1 | |
endfor " }}} | |
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 | |
" OK, first way failed, now check tags file(s) | |
" This method is useless when local variables are not indexed by ctags and | |
" pretty inaccurate even if it is | |
if g:phpcomplete_search_tags_for_variables | |
let tags = phpcomplete#GetTaglist('^'.substitute(object, '^\$', '', '')) | |
if len(tags) == 0 | |
return | |
else | |
for tag in tags | |
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze' | |
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze') | |
" unescape the classname, it would have "\" doubled since it is an ex command | |
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g') | |
return classname | |
endif | |
endfor | |
endif | |
endif | |
endif | |
FUNCTION <SNR>19_init() | |
Called 311 times | |
Total time: 0.000786 | |
Self time: 0.000786 | |
count total (s) self (s) | |
311 0.000357 if s:airline_initialized | |
311 0.000203 return | |
endif | |
let s:airline_initialized = 1 | |
call airline#extensions#load() | |
call airline#init#sections() | |
let s:theme_in_vimrc = exists('g:airline_theme') | |
if s:theme_in_vimrc | |
try | |
let palette = g:airline#themes#{g:airline_theme}#palette | |
catch | |
call airline#util#warning(printf('Could not resolve airline theme "%s". Themes have been migrated to github.com/vim-airline/vim-airline-themes.', g:airline_theme)) | |
let g:airline_theme = 'dark' | |
endtry | |
silent call airline#switch_theme(g:airline_theme) | |
else | |
let g:airline_theme = 'dark' | |
silent call s:on_colorscheme_changed() | |
endif | |
call airline#util#doautocmd('AirlineAfterInit') | |
FUNCTION <SNR>119_StopCursorTimer() | |
Called 6 times | |
Total time: 0.000092 | |
Self time: 0.000092 | |
count total (s) self (s) | |
6 0.000027 if s:cursor_timer != -1 | |
6 0.000017 call timer_stop(s:cursor_timer) | |
6 0.000017 let s:cursor_timer = -1 | |
6 0.000003 endif | |
FUNCTION ale#highlight#CreatePositions() | |
Called 511 times | |
Total time: 0.002389 | |
Self time: 0.002389 | |
count total (s) self (s) | |
511 0.000609 if a:line >= a:end_line | |
" For single lines, just return the one position. | |
511 0.001293 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]',) | |
FUNCTION AutoPairsTryInit() | |
Called 214 times | |
Total time: 0.059326 | |
Self time: 0.009802 | |
count total (s) self (s) | |
214 0.000501 if exists('b:autopairs_loaded') | |
110 0.000076 return | |
end | |
" for auto-pairs starts with 'a', so the priority is higher than supertab and vim-endwise | |
" | |
" vim-endwise doesn't support <Plug>AutoPairsReturn | |
" when use <Plug>AutoPairsReturn will cause <Plug> isn't expanded | |
" | |
" supertab doesn't support <SID>AutoPairsReturn | |
" when use <SID>AutoPairsReturn will cause Duplicated <CR> | |
" | |
" and when load after vim-endwise will cause unexpected endwise inserted. | |
" so always load AutoPairs at last | |
" Buffer level keys mapping | |
" comptible with other plugin | |
104 0.000104 if g:AutoPairsMapCR | |
104 0.000234 if v:version == 703 && has('patch32') || v:version > 703 | |
" VIM 7.3 supports advancer maparg which could get <expr> info | |
" then auto-pairs could remap <CR> in any case. | |
104 0.001549 let info = maparg('<CR>', 'i', 0, 1) | |
104 0.000143 if empty(info) | |
let old_cr = '<CR>' | |
let is_expr = 0 | |
else | |
104 0.000180 let old_cr = info['rhs'] | |
104 0.003037 0.000659 let old_cr = s:ExpandMap(old_cr) | |
104 0.000666 let old_cr = substitute(old_cr, '<SID>', '<SNR>' . info['sid'] . '_', 'g') | |
104 0.000159 let is_expr = info['expr'] | |
104 0.000140 let wrapper_name = '<SID>AutoPairsOldCRWrapper73' | |
104 0.000053 endif | |
104 0.000061 else | |
" VIM version less than 7.3 | |
" the mapping's <expr> info is lost, so guess it is expr or not, it's | |
" not accurate. | |
let old_cr = maparg('<CR>', 'i') | |
if old_cr == '' | |
let old_cr = '<CR>' | |
let is_expr = 0 | |
else | |
let old_cr = s:ExpandMap(old_cr) | |
" old_cr contain (, I guess the old cr is in expr mode | |
let is_expr = old_cr =~ '\V(' && toupper(old_cr) !~ '\V<C-R>' | |
" The old_cr start with " it must be in expr mode | |
let is_expr = is_expr || old_cr =~ '\v^"' | |
let wrapper_name = '<SID>AutoPairsOldCRWrapper' | |
end | |
end | |
104 0.000373 if old_cr !~ 'AutoPairsReturn' | |
104 0.000073 if is_expr | |
" remap <expr> to `name` to avoid mix expr and non-expr mode | |
execute 'inoremap <buffer> <expr> <script> '. wrapper_name . ' ' . old_cr | |
let old_cr = wrapper_name | |
end | |
" Always silent mapping | |
104 0.001241 execute 'inoremap <script> <buffer> <silent> <CR> '.old_cr.'<SID>AutoPairsReturn' | |
104 0.000050 end | |
104 0.000043 endif | |
104 0.047622 0.000476 call AutoPairsInit() | |
FUNCTION <SNR>29_GetFiletypeValue() | |
Called 98 times | |
Total time: 0.002751 | |
Self time: 0.002751 | |
count total (s) self (s) | |
196 0.001034 for l:part in reverse(split(a:filetype, '\.')) | |
98 0.000336 let l:regex = get(a:map, l:part, []) | |
98 0.000166 if !empty(l:regex) | |
return l:regex | |
endif | |
98 0.000069 endfor | |
" Use the default regex for other files. | |
98 0.000169 return a:map['<default>'] | |
FUNCTION ale#completion#GetCompletions() | |
Called 45 times | |
Total time: 0.051223 | |
Self time: 0.002632 | |
count total (s) self (s) | |
45 0.000072 if !g:ale_completion_enabled | |
return | |
endif | |
45 0.000232 let [l:line, l:column] = getcurpos()[1:2] | |
45 0.003351 0.000414 let l:prefix = ale#completion#GetPrefix(&filetype, l:line, l:column) | |
45 0.000091 if empty(l:prefix) | |
16 0.000010 return | |
endif | |
29 0.000091 let l:line_length = len(getline('.')) | |
29 0.000340 let b:ale_completion_info = { 'line': l:line, 'line_length': l:line_length, 'column': l:column, 'prefix': l:prefix, 'conn_id': 0, 'request_id': 0,} | |
87 0.009820 0.000409 for l:linter in ale#linter#Get(&filetype) | |
58 0.000104 if !empty(l:linter.lsp) | |
29 0.036459 0.000216 call s:GetLSPCompletions(l:linter) | |
29 0.000014 endif | |
58 0.000032 endfor | |
FUNCTION ale#statusline#Update() | |
Called 74 times | |
Total time: 0.006507 | |
Self time: 0.005958 | |
count total (s) self (s) | |
74 0.000288 if !exists('g:ale_buffer_info') || !has_key(g:ale_buffer_info, a:buffer) | |
return | |
endif | |
74 0.000464 let l:loclist = filter(copy(a:loclist), 'v:val.bufnr == a:buffer') | |
74 0.000933 0.000384 let l:count = s:CreateCountDict() | |
74 0.000156 let l:count.total = len(l:loclist) | |
242 0.000268 for l:entry in l:loclist | |
168 0.000233 if l:entry.type is# 'W' | |
if get(l:entry, 'sub_type', '') is# 'style' | |
let l:count.style_warning += 1 | |
else | |
let l:count.warning += 1 | |
endif | |
elseif l:entry.type is# 'I' | |
let l:count.info += 1 | |
elseif get(l:entry, 'sub_type', '') is# 'style' | |
let l:count.style_error += 1 | |
else | |
168 0.000174 let l:count.error += 1 | |
168 0.000081 endif | |
168 0.000082 endfor | |
" Set keys for backwards compatibility. | |
74 0.000172 let l:count[0] = l:count.error + l:count.style_error | |
74 0.000139 let l:count[1] = l:count.total - l:count[0] | |
74 0.000489 let g:ale_buffer_info[a:buffer].count = l:count | |
FUNCTION ale#lsp#Send() | |
Called 77 times | |
Total time: 0.009487 | |
Self time: 0.002599 | |
count total (s) self (s) | |
77 0.000279 let l:conn = get(s:connections, a:conn_id, {}) | |
77 0.000095 if empty(l:conn) | |
return 0 | |
endif | |
" If we haven't initialized the server yet, then send the message for it. | |
77 0.000106 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 | |
77 0.004952 0.000498 let [l:id, l:data] = ale#lsp#CreateMessageData(a:message) | |
77 0.000060 if l:conn.initialized | |
" Send the message now. | |
77 0.002767 0.000334 call s:SendMessageData(l:conn, l:data) | |
77 0.000033 else | |
" Add the message we wanted to send to a List to send later. | |
call add(l:conn.message_queue, l:data) | |
endif | |
77 0.000091 return l:id == 0 ? -1 : l:id | |
FUNCTION airline#parts#spell() | |
Called 1439 times | |
Total time: 0.027544 | |
Self time: 0.027544 | |
count total (s) self (s) | |
1439 0.012839 let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : '' | |
1439 0.001883 if g:airline_detect_spell && &spell | |
if winwidth(0) >= 90 | |
return g:airline_symbols.spell . spelllang | |
elseif winwidth(0) >= 70 | |
return g:airline_symbols.spell | |
else | |
return split(g:airline_symbols.spell, '\zs')[0] | |
endif | |
endif | |
1439 0.000819 return '' | |
FUNCTION ale#linter#GetAll() | |
Called 55 times | |
Total time: 0.003002 | |
Self time: 0.002158 | |
count total (s) self (s) | |
" Don't return linters in the sandbox. | |
" Otherwise a sandboxed script could modify them. | |
55 0.001051 0.000208 if ale#util#InSandbox() | |
return [] | |
endif | |
55 0.000073 let l:combined_linters = [] | |
110 0.000131 for l:filetype in a:filetypes | |
" Load linters from runtimepath if we haven't done that yet. | |
55 0.000154 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 | |
55 0.000520 call extend(l:combined_linters, get(s:linters, l:filetype, [])) | |
55 0.000045 endfor | |
55 0.000057 return l:combined_linters | |
FUNCTION ale#linter#ResolveFiletype() | |
Called 55 times | |
Total time: 0.003057 | |
Self time: 0.000751 | |
count total (s) self (s) | |
55 0.002735 0.000429 let l:filetype = s:GetAliasedFiletype(a:original_filetype) | |
55 0.000120 if type(l:filetype) isnot v:t_list | |
55 0.000069 return [l:filetype] | |
endif | |
return l:filetype | |
FUNCTION ale#engine#RemoveManagedFiles() | |
Called 48 times | |
Total time: 0.009203 | |
Self time: 0.008669 | |
count total (s) self (s) | |
48 0.000190 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. | |
48 0.000686 0.000152 if ale#util#InSandbox() | |
return | |
endif | |
" Delete files with a call akin to a plan `rm` command. | |
48 0.000105 if has_key(l:info, 'temporary_file_list') | |
48 0.000077 for l:filename in l:info.temporary_file_list | |
call delete(l:filename) | |
endfor | |
48 0.000109 let l:info.temporary_file_list = [] | |
48 0.000021 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. | |
48 0.000093 if has_key(l:info, 'temporary_directory_list') | |
74 0.000108 for l:directory in l:info.temporary_directory_list | |
26 0.006905 call delete(l:directory, 'rf') | |
26 0.000051 endfor | |
48 0.000212 let l:info.temporary_directory_list = [] | |
48 0.000024 endif | |
FUNCTION ale#completion#OmniFunc() | |
Called 24 times | |
Total time: 0.004692 | |
Self time: 0.001222 | |
count total (s) self (s) | |
24 0.000066 if a:findstart | |
12 0.000023 let l:line = b:ale_completion_info.line | |
12 0.000016 let l:column = b:ale_completion_info.column | |
12 0.000377 0.000088 let l:regex = s:GetFiletypeValue(s:omni_start_map, &filetype) | |
12 0.000035 let l:up_to_column = getline(l:line)[: l:column - 2] | |
12 0.000128 let l:match = matchstr(l:up_to_column, l:regex) | |
12 0.000025 return l:column - len(l:match) - 1 | |
else | |
" Parse a new response if there is one. | |
12 0.000074 if exists('b:ale_completion_response')&& exists('b:ale_completion_parser') | |
12 0.000032 let l:response = b:ale_completion_response | |
12 0.000017 let l:parser = b:ale_completion_parser | |
12 0.000049 unlet b:ale_completion_response | |
12 0.000038 unlet b:ale_completion_parser | |
12 0.003038 0.000236 let b:ale_completion_result = function(l:parser)(l:response) | |
12 0.000007 endif | |
12 0.000432 0.000052 call s:ReplaceCompletionOptions() | |
12 0.000028 return get(b:, 'ale_completion_result', []) | |
endif | |
FUNCTION ale#util#Mode() | |
Called 2790 times | |
Total time: 0.007822 | |
Self time: 0.007822 | |
count total (s) self (s) | |
2790 0.006709 return call('mode', a:000) | |
FUNCTION phpcomplete#CompleteGeneral() | |
Called 19 times | |
Total time: 2.631055 | |
Self time: 1.116123 | |
count total (s) self (s) | |
" 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. | |
19 0.000043 if a:base =~? '^\' | |
let leading_slash = '\' | |
else | |
19 0.000033 let leading_slash = '' | |
19 0.000009 endif | |
19 0.000214 let file = getline(1, '$') | |
19 0.003477 call filter(file, 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("') | |
19 0.000068 let jfile = join(file, ' ') | |
19 0.000128 let int_values = split(jfile, 'function\s\+') | |
19 0.000024 let int_functions = {} | |
61 0.000076 for i in int_values | |
42 0.000368 let f_name = matchstr(i, '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') | |
42 0.000264 if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g') | |
3 0.000032 let f_args = matchstr(i, '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)') | |
3 0.000008 let int_functions[f_name.'('] = f_args.')' | |
3 0.000001 endif | |
42 0.000030 endfor | |
" Internal solution for finding constants in current file | |
19 0.000180 let file = getline(1, '$') | |
19 0.001901 call filter(file, 'v:val =~ "define\\s*("') | |
19 0.000045 let jfile = join(file, ' ') | |
19 0.000139 let int_values = split(jfile, 'define\s*(\s*') | |
19 0.000038 let int_constants = {} | |
19 0.000026 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 | |
19 0.000022 let ext_functions = {} | |
19 0.000019 let ext_constants = {} | |
19 0.000022 let ext_classes = {} | |
19 0.000020 let ext_traits = {} | |
19 0.000020 let ext_interfaces = {} | |
19 0.000020 let ext_namespaces = {} | |
19 0.000115 let base = substitute(a:base, '^\\', '', '') | |
19 0.001521 0.000190 let [tag_match_pattern, namespace_for_tag] = phpcomplete#ExpandClassName(a:base, a:current_namespace, a:imports) | |
19 0.000153 let namespace_match_pattern = substitute((namespace_for_tag == '' ? '' : namespace_for_tag.'\').tag_match_pattern, '\\', '\\\\', 'g') | |
19 0.000027 let tags = [] | |
19 0.000108 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 | |
19 1.513777 0.000177 let tags = phpcomplete#GetTaglist('\c^\('.tag_match_pattern.'\|'.namespace_match_pattern.'\)') | |
19 0.000041 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 | |
9110 0.005912 for tag in tags | |
9091 0.021056 if !has_key(tag, 'namespace') || tag.namespace ==? a:current_namespace || tag.namespace ==? namespace_for_tag | |
9091 0.012704 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 | |
9091 0.013295 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 | |
1956 0.002783 if has_key(tag, 'signature') | |
let prototype = tag.signature[1:-2] " drop the ()s around the string | |
else | |
1956 0.024200 let prototype = matchstr(tag.cmd, 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?') | |
1956 0.001023 endif | |
1956 0.004476 let info = prototype.') - '.tag.filename | |
1956 0.002947 if !has_key(tag, 'namespace') | |
1956 0.004514 let ext_functions[tag.name.'('] = info | |
1956 0.000868 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 | |
1956 0.001369 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' | |
442 0.000685 let info = ' - '.tag.filename | |
442 0.000341 let key = '' | |
442 0.000647 if !has_key(tag, 'namespace') | |
442 0.000461 let key = tag.name | |
442 0.000187 else | |
if tag.namespace ==? namespace_for_tag | |
if leading_slash == '' | |
let key = relative_name | |
else | |
let key = '\'.full_name | |
endif | |
endif | |
endif | |
442 0.000388 if key != '' | |
442 0.000408 if tag.kind ==? 'c' | |
413 0.000803 let ext_classes[key] = info | |
413 0.000276 elseif tag.kind ==? 'i' | |
29 0.000054 let ext_interfaces[key] = info | |
29 0.000020 elseif tag.kind ==? 't' | |
let ext_traits[key] = info | |
endif | |
442 0.000155 endif | |
442 0.000143 endif | |
9091 0.003353 endif | |
9091 0.004351 endfor | |
19 0.000035 let builtin_constants = {} | |
19 0.000024 let builtin_classnames = {} | |
19 0.000020 let builtin_interfaces = {} | |
19 0.000031 let builtin_functions = {} | |
19 0.000019 let builtin_keywords = {} | |
19 0.000095 let base = substitute(a:base, '^\', '', '') | |
19 0.000068 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 | |
22591 0.040947 for [constant, info] in items(g:php_constants) | |
22572 0.062835 if constant =~# '^'.base | |
1188 0.003504 let builtin_constants[leading_slash.constant] = info | |
1188 0.000480 endif | |
22572 0.009275 endfor | |
19 0.000039 if leading_slash == '' " keywords should not be completed when base starts with '\' | |
" Treat keywords as constants | |
2508 0.004480 for [constant, info] in items(g:php_keywords) | |
2489 0.006913 if constant =~? '^'.a:base | |
144 0.000255 let builtin_keywords[constant] = info | |
144 0.000055 endif | |
2489 0.001027 endfor | |
19 0.000012 endif | |
21964 0.041521 for [function_name, info] in items(g:php_builtin_functions) | |
21945 0.062671 if function_name =~? '^'.base | |
1182 0.003586 let builtin_functions[leading_slash.function_name] = info | |
1182 0.000443 endif | |
21945 0.008932 endfor | |
" All constants | |
19 0.000179 call extend(int_constants, ext_constants) | |
" All functions | |
19 0.000274 call extend(int_functions, ext_functions) | |
19 0.001114 call extend(int_functions, builtin_functions) | |
57 0.000164 for [imported_name, import] in items(a:imports) | |
38 0.000149 if imported_name =~? '^'.base | |
2 0.000003 if import.kind ==? 'c' | |
1 0.000001 if import.builtin | |
let builtin_classnames[imported_name] = ' '.import.name | |
else | |
1 0.000005 let ext_classes[imported_name] = ' '.import.name.' - '.import.filename | |
1 0.000000 endif | |
1 0.000001 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 | |
2 0.000002 if import.kind == 'n' | |
let ext_namespaces[imported_name.'\'] = ' '.import.name.' - '.import.filename | |
endif | |
2 0.000001 end | |
38 0.000057 endfor | |
19 0.000036 let all_values = {} | |
" Add functions found in this file | |
19 0.001309 call extend(all_values, int_functions) | |
" Add namespaces from tags | |
19 0.000045 call extend(all_values, ext_namespaces) | |
" Add constants from the current file | |
19 0.000038 call extend(all_values, int_constants) | |
" Add built-in constants | |
19 0.000285 call extend(all_values, builtin_constants) | |
" Add external classes | |
19 0.000973 call extend(all_values, ext_classes) | |
" Add external interfaces | |
19 0.000045 call extend(all_values, ext_interfaces) | |
" Add external traits | |
19 0.000037 call extend(all_values, ext_traits) | |
" Add built-in classes | |
19 0.000040 call extend(all_values, builtin_classnames) | |
" Add built-in interfaces | |
19 0.000037 call extend(all_values, builtin_interfaces) | |
" Add php keywords | |
19 0.000068 call extend(all_values, builtin_keywords) | |
19 0.000025 let final_list = [] | |
19 0.001358 let int_list = sort(keys(all_values)) | |
3520 0.002666 for i in int_list | |
3501 0.005176 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) | |
1812 0.009416 let final_list += [{'word':i, 'info':i.int_functions[i], 'menu':int_functions[i], 'kind':'f'}] | |
1812 0.003337 elseif has_key(ext_classes, i) || has_key(builtin_classnames, i) | |
343 0.000975 let info = has_key(ext_classes, i) ? ext_classes[i] : builtin_classnames[i].' - builtin' | |
343 0.001399 let final_list += [{'word':i, 'kind': 'c', 'menu': info, 'info': i.info}] | |
343 0.000607 elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i) | |
18 0.000052 let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin' | |
18 0.000073 let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}] | |
18 0.000021 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) | |
1188 0.002618 let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin' | |
1188 0.004702 let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}] | |
1188 0.000452 else | |
140 0.000297 let final_list += [{'word':i}] | |
140 0.000056 endif | |
3501 0.001597 endfor | |
19 0.000030 return final_list | |
FUNCTION <SNR>76_group_not_done() | |
Called 750 times | |
Total time: 0.004969 | |
Self time: 0.004969 | |
count total (s) self (s) | |
750 0.001789 if index(a:list, a:name) == -1 | |
540 0.001144 call add(a:list, a:name) | |
540 0.000348 return 1 | |
else | |
210 0.000194 if &vbs | |
echomsg printf("airline: group: %s already done, skipping", a:name) | |
endif | |
210 0.000106 return 0 | |
endif | |
FUNCTION ale#completion#Queue() | |
Called 72 times | |
Total time: 0.003333 | |
Self time: 0.002782 | |
count total (s) self (s) | |
72 0.000189 if !g:ale_completion_enabled | |
return | |
endif | |
72 0.000580 let s:timer_pos = getcurpos()[1:2] | |
72 0.000171 if s:timer_pos == s:last_done_pos | |
" Do not ask for completions if the cursor rests on the position we | |
" last completed on. | |
12 0.000008 return | |
endif | |
" If we changed the text again while we're still waiting for a response, | |
" then invalidate the requests before the timer ticks again. | |
60 0.000180 if exists('b:ale_completion_info') | |
60 0.000150 let b:ale_completion_info.request_id = 0 | |
60 0.000029 endif | |
60 0.000927 0.000376 call ale#completion#StopTimer() | |
60 0.000457 let s:timer_id = timer_start(g:ale_completion_delay, function('s:TimerHandler')) | |
FUNCTION ale#util#InSandbox() | |
Called 290 times | |
Total time: 0.003825 | |
Self time: 0.003547 | |
count total (s) self (s) | |
290 0.000328 try | |
290 0.002016 0.001738 let &l:equalprg=&l:equalprg | |
290 0.000298 catch /E48/ | |
" E48 is the sandbox error. | |
return 1 | |
endtry | |
290 0.000161 return 0 | |
FUNCTION airline#parts#crypt() | |
Called 1439 times | |
Total time: 0.007579 | |
Self time: 0.007579 | |
count total (s) self (s) | |
1439 0.006991 return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : '' | |
FUNCTION ale#lsp#CreateMessageData() | |
Called 77 times | |
Total time: 0.004455 | |
Self time: 0.004178 | |
count total (s) self (s) | |
77 0.000145 if a:message[1][:2] is# 'ts@' | |
return s:CreateTSServerMessageData(a:message) | |
endif | |
77 0.000130 let l:is_notification = a:message[0] | |
77 0.000200 let l:obj = { 'method': a:message[1], 'jsonrpc': '2.0',} | |
77 0.000059 if !l:is_notification | |
29 0.000393 0.000117 let l:obj.id = ale#lsp#GetNextMessageID() | |
29 0.000012 endif | |
77 0.000109 if len(a:message) > 2 | |
77 0.000154 let l:obj.params = a:message[2] | |
77 0.000032 endif | |
77 0.002149 let l:body = json_encode(l:obj) | |
77 0.000333 let l:data = 'Content-Length: ' . strlen(l:body) . "\r\n\r\n" . l:body | |
77 0.000176 return [l:is_notification ? 0 : l:obj.id, l:data] | |
FUNCTION <SNR>69_update_hg_branch() | |
Called 1439 times | |
Total time: 0.059658 | |
Self time: 0.055527 | |
count total (s) self (s) | |
1439 0.008483 0.004352 if airline#util#has_lawrencium() | |
let cmd='LC_ALL=C hg qtop' | |
let stl=lawrencium#statusline() | |
let file=expand('%:p') | |
if !empty(stl) && get(b:, 'airline_do_mq_check', 1) | |
if g:airline#init#vim_async | |
noa call airline#async#get_mq_async(cmd, file) | |
elseif has("nvim") | |
noa call airline#async#nvim_get_mq_async(cmd, file) | |
else | |
" remove \n at the end of the command | |
let output=system(cmd)[0:-2] | |
noa call airline#async#mq_output(output, file) | |
endif | |
endif | |
" do not do mq check anymore | |
let b:airline_do_mq_check = 0 | |
if exists("b:mq") && !empty(b:mq) | |
if stl is# 'default' | |
" Shorten default a bit | |
let stl='def' | |
endif | |
let stl.=' ['.b:mq.']' | |
endif | |
let s:vcs_config['mercurial'].branch = stl | |
else | |
1439 0.002842 let s:vcs_config['mercurial'].branch = '' | |
1439 0.000674 endif | |
FUNCTION phpcomplete#GetCallChainReturnType() | |
Called 34 times | |
Total time: 0.003265 | |
Self time: 0.001264 | |
count total (s) self (s) | |
" Tries to get the classname and namespace for a chained method call like: | |
" $this->foo()->bar()->baz()-> | |
34 0.000059 let classname_candidate = a:classname_candidate | |
34 0.000055 let class_candidate_namespace = a:class_candidate_namespace | |
34 0.000047 let methodstack = a:methodstack | |
34 0.000062 let unknown_result = ['', ''] | |
34 0.000196 let prev_method_is_array = (methodstack[0] =~ '\v^[^([]+\[' ? 1 : 0) | |
34 0.000114 let classname_candidate_is_array = (classname_candidate =~ '\[\]$' ? 1 : 0) | |
34 0.000028 if prev_method_is_array | |
if classname_candidate_is_array | |
let classname_candidate = substitute(classname_candidate, '\[\]$', '', '') | |
else | |
return unknown_result | |
endif | |
endif | |
34 0.000054 if (len(methodstack) == 1) | |
34 0.002274 0.000273 let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, a:imports) | |
34 0.000059 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 | |
FUNCTION <SNR>120_GroupLoclistItems() | |
Called 74 times | |
Total time: 0.002988 | |
Self time: 0.002988 | |
count total (s) self (s) | |
74 0.000131 let l:grouped_items = [] | |
74 0.000088 let l:last_lnum = -1 | |
242 0.000205 for l:obj in a:loclist | |
168 0.000167 if l:obj.bufnr != a:buffer | |
continue | |
endif | |
" Create a new sub-List when we hit a new line. | |
168 0.000163 if l:obj.lnum != l:last_lnum | |
122 0.000189 call add(l:grouped_items, []) | |
122 0.000052 endif | |
168 0.000297 call add(l:grouped_items[-1], l:obj) | |
168 0.000174 let l:last_lnum = l:obj.lnum | |
168 0.000080 endfor | |
74 0.000063 return l:grouped_items | |
FUNCTION <SNR>29_ReplaceCompletionOptions() | |
Called 80 times | |
Total time: 0.002551 | |
Self time: 0.002357 | |
count total (s) self (s) | |
" Remember the old omnifunc value, if there is one. | |
" If we don't store an old one, we'll just never reset the option. | |
" This will stop some random exceptions from appearing. | |
80 0.000286 if !exists('b:ale_old_omnifunc') && !empty(&l:omnifunc) | |
20 0.000056 let b:ale_old_omnifunc = &l:omnifunc | |
20 0.000020 endif | |
80 0.000423 0.000363 let &l:omnifunc = 'ale#completion#OmniFunc' | |
80 0.000201 if !exists('b:ale_old_completopt') | |
20 0.000056 let b:ale_old_completopt = &l:completeopt | |
20 0.000008 endif | |
80 0.000325 if &l:completeopt =~# 'preview' | |
80 0.000552 0.000418 let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' | |
80 0.000057 else | |
let &l:completeopt = 'menu,menuone,noselect,noinsert' | |
endif | |
FUNCTION airline#extensions#branch#head() | |
Called 1439 times | |
Total time: 0.425723 | |
Self time: 0.026038 | |
count total (s) self (s) | |
1439 0.003355 if !exists('b:buffer_vcs_config') | |
call s:init_buffer() | |
endif | |
1439 0.296681 0.005471 call s:update_branch() | |
1439 0.113979 0.005503 call s:update_untracked() | |
1439 0.004614 if exists('b:airline_head') && !empty(b:airline_head) | |
1439 0.001296 return b:airline_head | |
endif | |
let b:airline_head = '' | |
let vcs_priority = get(g:, "airline#extensions#branch#vcs_priority", ["git", "mercurial"]) | |
let heads = [] | |
for vcs in vcs_priority | |
if !empty(b:buffer_vcs_config[vcs].branch) | |
let heads += [vcs] | |
endif | |
endfor | |
for vcs in heads | |
if !empty(b:airline_head) | |
let b:airline_head .= ' | ' | |
endif | |
if len(heads) > 1 | |
let b:airline_head .= s:vcs_config[vcs].exe .':' | |
endif | |
let b:airline_head .= s:format_name({s:vcs_config[vcs].display_branch}()) | |
let b:airline_head .= b:buffer_vcs_config[vcs].untracked | |
endfor | |
if empty(heads) | |
if airline#util#has_vcscommand() | |
noa call VCSCommandEnableBufferSetup() | |
if exists('b:VCSCommandBufferInfo') | |
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, '')) | |
endif | |
endif | |
endif | |
if empty(heads) | |
if airline#util#has_custom_scm() | |
try | |
let Fn = function(g:airline#extensions#branch#custom_head) | |
let b:airline_head = Fn() | |
endtry | |
endif | |
endif | |
if exists("g:airline#extensions#branch#displayed_head_limit") | |
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit | |
if len(b:airline_head) > w:displayed_head_limit - 1 | |
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.') | |
endif | |
endif | |
let minwidth = empty(get(b:, 'airline_hunks', '')) ? 14 : 7 | |
let b:airline_head = airline#util#shorten(b:airline_head, 120, minwidth) | |
return b:airline_head | |
FUNCTION <SNR>47_Highlight_Matching_Pair() | |
Called 369 times | |
Total time: 1.364804 | |
Self time: 1.364804 | |
count total (s) self (s) | |
" Remove any previous match. | |
369 0.001380 if exists('w:paren_hl_on') && w:paren_hl_on | |
7 0.000038 silent! call matchdelete(3) | |
7 0.000029 let w:paren_hl_on = 0 | |
7 0.000008 endif | |
" Avoid that we remove the popup menu. | |
" Return when there are no colors (looks like the cursor jumps). | |
369 0.001171 if pumvisible() || (&t_Co < 8 && !has("gui_running")) | |
10 0.000008 return | |
endif | |
" Get the character under the cursor and check if it's in 'matchpairs'. | |
359 0.000834 let c_lnum = line('.') | |
359 0.000695 let c_col = col('.') | |
359 0.000341 let before = 0 | |
359 0.000832 let text = getline(c_lnum) | |
359 0.005522 let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') | |
359 0.000618 if empty(matches) | |
let [c_before, c] = ['', ''] | |
else | |
359 0.001275 let [c_before, c] = matches[1:2] | |
359 0.000171 endif | |
359 0.005149 let plist = split(&matchpairs, '.\zs[:,]') | |
359 0.001036 let i = index(plist, c) | |
359 0.000356 if i < 0 | |
" not found, in Insert mode try character before the cursor | |
357 0.001130 if c_col > 1 && (mode() == 'i' || mode() == 'R') | |
349 0.000784 let before = strlen(c_before) | |
349 0.000392 let c = c_before | |
349 0.000672 let i = index(plist, c) | |
349 0.000178 endif | |
357 0.000251 if i < 0 | |
" not found, nothing to do | |
202 0.000155 return | |
endif | |
155 0.000061 endif | |
" Figure out the arguments for searchpairpos(). | |
157 0.000135 if i % 2 == 0 | |
6 0.000007 let s_flags = 'nW' | |
6 0.000011 let c2 = plist[i + 1] | |
6 0.000004 else | |
151 0.000172 let s_flags = 'nbW' | |
151 0.000153 let c2 = c | |
151 0.000209 let c = plist[i - 1] | |
151 0.000065 endif | |
157 0.000142 if c == '[' | |
let c = '\[' | |
let c2 = '\]' | |
endif | |
" Find the match. When it was just before the cursor move it there for a | |
" moment. | |
157 0.000128 if before > 0 | |
155 0.000423 let has_getcurpos = exists("*getcurpos") | |
155 0.000122 if has_getcurpos | |
" getcurpos() is more efficient but doesn't exist before 7.4.313. | |
155 0.000346 let save_cursor = getcurpos() | |
155 0.000071 else | |
let save_cursor = winsaveview() | |
endif | |
155 0.000358 call cursor(c_lnum, c_col - before) | |
155 0.000072 endif | |
" Build an expression that detects whether the current cursor position is in | |
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s | |
" skip argument. | |
" We match "escape" for special items, such as lispEscapeSpecial. | |
157 0.000477 let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' | |
" If executing the expression determines that the cursor is currently in | |
" one of the syntax types, then we want searchpairpos() to find the pair | |
" within those syntax types (i.e., not skip). Otherwise, the cursor is | |
" outside of the syntax types and s_skip should keep its value so we skip any | |
" matching pair inside the syntax types. | |
157 0.040284 execute 'if' s_skip '| let s_skip = 0 | endif' | |
" Limit the search to lines visible in the window. | |
157 0.000615 let stoplinebottom = line('w$') | |
157 0.000469 let stoplinetop = line('w0') | |
157 0.000156 if i % 2 == 0 | |
6 0.000008 let stopline = stoplinebottom | |
6 0.000004 else | |
151 0.000172 let stopline = stoplinetop | |
151 0.000064 endif | |
" Limit the search time to 300 msec to avoid a hang on very long lines. | |
" This fails when a timeout is not supported. | |
157 0.000348 if mode() == 'i' || mode() == 'R' | |
157 0.000584 let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout | |
157 0.000068 else | |
let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout | |
endif | |
157 0.000165 try | |
157 1.278077 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout) | |
157 0.000397 catch /E118/ | |
" Can't use the timeout, restrict the stopline a bit more to avoid taking | |
" a long time on closed folds and long lines. | |
" The "viewable" variables give a range in which we can scroll while | |
" keeping the cursor at the same position. | |
" adjustedScrolloff accounts for very large numbers of scrolloff. | |
let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2]) | |
let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2]) | |
let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2]) | |
" one of these stoplines will be adjusted below, but the current values are | |
" minimal boundaries within the current window | |
if i % 2 == 0 | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2]) | |
let stopline = min([bottom_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = min([bottom_viewable, c_lnum + 100]) | |
endif | |
let stoplinebottom = stopline | |
else | |
if has("byte_offset") && has("syntax_items") && &smc > 0 | |
let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2]) | |
let stopline = max([top_viewable, byte2line(stopbyte)]) | |
else | |
let stopline = max([top_viewable, c_lnum - 100]) | |
endif | |
let stoplinetop = stopline | |
endif | |
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) | |
endtry | |
157 0.000156 if before > 0 | |
155 0.000128 if has_getcurpos | |
155 0.000466 call setpos('.', save_cursor) | |
155 0.000072 else | |
call winrestview(save_cursor) | |
endif | |
155 0.000069 endif | |
" If a match is found setup match highlighting. | |
157 0.000246 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom | |
7 0.000016 if exists('*matchaddpos') | |
7 0.000166 call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) | |
7 0.000004 else | |
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' | |
endif | |
7 0.000022 let w:paren_hl_on = 1 | |
7 0.000004 endif | |
FUNCTION ale#lsp#NotifyForChanges() | |
Called 55 times | |
Total time: 0.013842 | |
Self time: 0.002100 | |
count total (s) self (s) | |
55 0.000137 let l:conn = get(s:connections, a:conn_id, {}) | |
55 0.000054 let l:notified = 0 | |
55 0.000131 if !empty(l:conn) && has_key(l:conn.open_documents, a:buffer) | |
55 0.000157 let l:new_tick = getbufvar(a:buffer, 'changedtick') | |
55 0.000088 if l:conn.open_documents[a:buffer] < l:new_tick | |
48 0.000037 if l:conn.is_tsserver | |
let l:message = ale#lsp#tsserver_message#Change(a:buffer) | |
else | |
48 0.005827 0.000609 let l:message = ale#lsp#message#DidChange(a:buffer) | |
48 0.000040 endif | |
48 0.006763 0.000239 call ale#lsp#Send(a:conn_id, l:message) | |
48 0.000118 let l:conn.open_documents[a:buffer] = l:new_tick | |
48 0.000057 let l:notified = 1 | |
48 0.000021 endif | |
55 0.000020 endif | |
55 0.000038 return l:notified | |
FUNCTION ale#engine#FixLocList() | |
Called 74 times | |
Total time: 0.017776 | |
Self time: 0.015240 | |
count total (s) self (s) | |
74 0.000163 let l:bufnr_map = {} | |
74 0.000091 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. | |
74 0.002022 0.000339 let l:last_line_number = ale#util#GetLineCount(a:buffer) | |
166 0.000189 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.. | |
92 0.001064 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,} | |
92 0.000087 if a:from_other_source | |
let l:item.from_other_source = 1 | |
endif | |
92 0.000148 if has_key(l:old_item, 'code') | |
let l:item.code = l:old_item.code | |
endif | |
92 0.000239 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 | |
92 0.000139 if has_key(l:old_item, 'detail') | |
74 0.000122 let l:item.detail = l:old_item.detail | |
74 0.000045 endif | |
" Pass on a end_col key if set, used for highlights. | |
92 0.000139 if has_key(l:old_item, 'end_col') | |
92 0.000205 let l:item.end_col = str2nr(l:old_item.end_col) | |
92 0.000039 endif | |
92 0.000166 if has_key(l:old_item, 'end_lnum') | |
74 0.000153 let l:item.end_lnum = str2nr(l:old_item.end_lnum) | |
74 0.000029 endif | |
92 0.000129 if has_key(l:old_item, 'sub_type') | |
let l:item.sub_type = l:old_item.sub_type | |
endif | |
92 0.000085 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 | |
92 0.000195 call add(l:new_loclist, l:item) | |
92 0.000080 endfor | |
74 0.001424 0.000572 let l:type_map = get(ale#Var(a:buffer, 'type_map'), a:linter_name, {}) | |
74 0.000127 if !empty(l:type_map) | |
call s:RemapItemTypes(l:type_map, l:new_loclist) | |
endif | |
74 0.000066 return l:new_loclist | |
FUNCTION airline#parts#mode() | |
Called 1439 times | |
Total time: 0.026357 | |
Self time: 0.008721 | |
count total (s) self (s) | |
1439 0.025695 0.008060 return airline#util#shorten(get(w:, 'airline_current_mode', ''), 79, 1) | |
FUNCTION ale#highlight#BufferHidden() | |
Called 102 times | |
Total time: 0.001375 | |
Self time: 0.000587 | |
count total (s) self (s) | |
" Remove highlights right away when buffers are hidden. | |
" They will be restored later when buffers are entered. | |
102 0.001223 0.000435 call ale#highlight#RemoveHighlights() | |
FUNCTION <SNR>76_get_array() | |
Called 14830 times | |
Total time: 0.099471 | |
Self time: 0.099471 | |
count total (s) self (s) | |
14830 0.038162 let opts=empty(a:opts) ? '' : join(a:opts, ',') | |
14830 0.054392 return g:airline_gui_mode ==# 'gui' ? [ a:fg, a:bg, '', '', opts ] : [ '', '', a:fg, a:bg, opts ] | |
FUNCTION ale#highlight#SetHighlights() | |
Called 74 times | |
Total time: 0.014794 | |
Self time: 0.002278 | |
count total (s) self (s) | |
74 0.000690 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. | |
74 0.000983 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. | |
74 0.012844 0.000329 call ale#highlight#UpdateHighlights() | |
FUNCTION airline#extensions#quickfix#apply() | |
Called 311 times | |
Total time: 0.002464 | |
Self time: 0.002464 | |
count total (s) self (s) | |
311 0.000721 if &buftype == 'quickfix' | |
let w:airline_section_a = airline#extensions#quickfix#get_type() | |
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}' | |
let w:airline_section_c = '' | |
let w:airline_section_x = '' | |
endif | |
FUNCTION ale#engine#SetResults() | |
Called 74 times | |
Total time: 0.309244 | |
Self time: 0.007340 | |
count total (s) self (s) | |
74 0.001027 0.000374 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. | |
74 0.000080 if g:ale_set_signs | |
74 0.266371 0.000969 call ale#sign#SetSigns(a:buffer, a:loclist) | |
74 0.000038 endif | |
74 0.000113 if g:ale_set_quickfix || g:ale_set_loclist | |
74 0.003375 0.000523 call ale#list#SetLists(a:buffer, a:loclist) | |
74 0.000031 endif | |
74 0.000179 if exists('*ale#statusline#Update') | |
" Don't load/run if not already loaded. | |
74 0.006924 0.000417 call ale#statusline#Update(a:buffer, a:loclist) | |
74 0.000035 endif | |
74 0.000081 if g:ale_set_highlights | |
74 0.015176 0.000382 call ale#highlight#SetHighlights(a:buffer, a:loclist) | |
74 0.000033 endif | |
74 0.000071 if l:linting_is_done | |
48 0.000040 if g:ale_echo_cursor | |
" Try and echo the warning now. | |
" This will only do something meaningful if we're in normal mode. | |
48 0.001233 0.000251 call ale#cursor#EchoCursorWarning() | |
48 0.000021 endif | |
48 0.000049 if g:ale_virtualtext_cursor | |
" Try and show the warning now. | |
" This will only do something meaningful if we're in normal mode. | |
call ale#virtualtext#ShowCursorWarning() | |
endif | |
" Reset the save event marker, used for opening windows, etc. | |
48 0.000122 call setbufvar(a:buffer, 'ale_save_event_fired', 0) | |
" Set a marker showing how many times a buffer has been checked. | |
48 0.000174 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. | |
48 0.009392 0.000189 call ale#engine#RemoveManagedFiles(a:buffer) | |
" Call user autocommands. This allows users to hook into ALE's lint cycle. | |
48 0.003404 0.001891 silent doautocmd <nomodeline> User ALELintPost | |
48 0.000023 endif | |
FUNCTION <SNR>121_ShouldOpen() | |
Called 121 times | |
Total time: 0.002148 | |
Self time: 0.001105 | |
count total (s) self (s) | |
121 0.001528 0.000486 let l:val = ale#Var(a:buffer, 'open_list') | |
121 0.000292 let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) | |
121 0.000214 return l:val is 1 || (l:val is# 'on_save' && l:saved) | |
FUNCTION phpcomplete#GetCurrentNameSpace() | |
Called 101 times | |
Total time: 4.570509 | |
Self time: 0.409061 | |
count total (s) self (s) | |
101 0.000232 let original_window = winnr() | |
101 2.123977 0.020013 silent! below 1new | |
101 0.026016 silent! 0put =a:file_lines | |
101 0.002471 normal! G | |
" clear out classes, functions and other blocks | |
387 0.000390 while 1 | |
387 0.034159 let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web') | |
387 0.000788 if block_start_pos == [0, 0] | |
101 0.000065 break | |
endif | |
286 0.022113 let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') | |
286 0.000520 if block_end_pos != [0, 0] | |
" end of the block found, just delete it | |
286 0.004826 silent! exec block_start_pos[0].','.block_end_pos[0].'d _' | |
286 0.000297 else | |
" block pair not found, use block start as beginning and the end | |
" of the buffer instead | |
silent! exec block_start_pos[0].',$d _' | |
endif | |
286 0.000354 endwhile | |
101 0.000780 normal! G | |
" grab the remains | |
101 0.000576 let file_lines = reverse(getline(1, line('.') - 1)) | |
101 2.147680 0.184375 silent! bw! % | |
101 0.000892 exe original_window.'wincmd w' | |
101 0.000277 let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' | |
101 0.000132 let i = 0 | |
101 0.000274 let file_length = len(file_lines) | |
101 0.000133 let imports = {} | |
101 0.000123 let current_namespace = '\' | |
505 0.000637 while i < file_length | |
505 0.000885 let line = file_lines[i] | |
505 0.006015 if line =~? '^\(<?php\)\?\s*namespace\s*'.namespace_name_pattern | |
101 0.002018 let current_namespace = matchstr(line, '\c^\(<?php\)\?\s*namespace\s*\zs'.namespace_name_pattern.'\ze') | |
101 0.000068 break | |
endif | |
404 0.001548 if line =~? '^\s*use\>' | |
202 0.000460 if line =~? ';' | |
202 0.000250 let use_line = line | |
202 0.000103 else | |
" try to find the next line containing ';' | |
let l = i | |
let search_line = line | |
let use_line = line | |
" add lines from the file until theres no ';' in them | |
while search_line !~? ';' && l > 0 | |
" file lines are reversed so we need to go backwards | |
let l -= 1 | |
let search_line = file_lines[l] | |
let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') | |
endwhile | |
endif | |
202 0.002793 let use_expression = matchstr(use_line, '^\c\s*use\s\+\zs.\{-}\ze;') | |
202 0.003741 let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') | |
404 0.000464 for part in use_parts | |
202 0.001263 if part =~? '\s\+as\s\+' | |
let [object, name] = split(part, '\s\+as\s\+\c') | |
let object = substitute(object, '^\\', '', '') | |
let name = substitute(name, '^\\', '', '') | |
else | |
202 0.000309 let object = part | |
202 0.000205 let name = part | |
202 0.000850 let object = substitute(object, '^\\', '', '') | |
202 0.000719 let name = substitute(name, '^\\', '', '') | |
202 0.000429 if name =~? '\\' | |
202 0.001927 let name = matchstr(name, '\\\zs[^\\]\+\ze$') | |
202 0.000107 endif | |
202 0.000078 endif | |
" leading slash is not required use imports are always absolute | |
202 0.000781 let imports[name] = {'name': object, 'kind': ''} | |
202 0.000112 endfor | |
" find kind flags from tags or built in methods for the objects we extracted | |
" they can be either classes, interfaces or namespaces, no other thing is importable in php | |
505 0.001139 for [key, import] in items(imports) | |
" if theres a \ in the name we have it's definetly not a built in thing, look for tags | |
303 0.000812 if import.name =~ '\\' | |
202 0.000269 let patched_ctags_detected = 0 | |
202 0.016522 0.002034 let [classname, namespace_for_classes] = phpcomplete#ExpandClassName(import.name, '\', {}) | |
202 0.001139 let namespace_name_candidate = substitute(import.name, '\\', '\\\\', 'g') | |
" can be a namespace name as is, or can be a tagname at the end with a namespace | |
202 0.056071 0.001629 let tags = phpcomplete#GetTaglist('^\('.namespace_name_candidate.'\|'.classname.'\)$') | |
202 0.000337 if len(tags) > 0 | |
101 0.000168 for tag in tags | |
" if there's a namespace with the name of the import | |
101 0.000241 if tag.kind == 'n' && tag.name == import.name | |
call extend(import, tag) | |
let import['builtin'] = 0 | |
let patched_ctags_detected = 1 | |
break | |
endif | |
" if the name matches with the extracted classname and namespace | |
101 0.000307 if (tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') && tag.name == classname | |
101 0.000189 if has_key(tag, 'namespace') | |
101 0.000115 let patched_ctags_detected = 1 | |
101 0.000175 if tag.namespace == namespace_for_classes | |
101 0.000727 call extend(import, tag) | |
101 0.000208 let import['builtin'] = 0 | |
101 0.000064 break | |
endif | |
elseif !exists('no_namespace_candidate') | |
" save the first namespacless match to be used if no better | |
" candidate found later on | |
let tag.namespace = namespace_for_classes | |
let no_namespace_candidate = tag | |
endif | |
endif | |
endfor | |
" there were a namespacless class name match, if we think that the | |
" tags are not generated with patched ctags we will take it as a match | |
101 0.000230 if exists('no_namespace_candidate') && !patched_ctags_detected | |
call extend(import, no_namespace_candidate) | |
let import['builtin'] = 0 | |
endif | |
101 0.000044 else | |
" if no tags are found, extract the namespace from the name | |
101 0.001867 let ns = matchstr(import.name, '\c\zs[a-zA-Z0-9\\]\+\ze\\' . name) | |
101 0.000210 if len(ns) > 0 | |
101 0.000180 let import['name'] = name | |
101 0.000200 let import['namespace'] = ns | |
101 0.000141 let import['builtin'] = 0 | |
101 0.000047 endif | |
101 0.000039 endif | |
202 0.000089 else | |
" if no \ in the name, it can be a built in class | |
101 0.000454 if has_key(g:php_builtin_classnames, tolower(import.name)) | |
let import['kind'] = 'c' | |
let import['builtin'] = 1 | |
elseif has_key(g:php_builtin_interfacenames, tolower(import.name)) | |
let import['kind'] = 'i' | |
let import['builtin'] = 1 | |
else | |
" or can be a tag with exactly matchign name | |
101 0.025971 0.000722 let tags = phpcomplete#GetTaglist('^'.import['name'].'$') | |
101 0.000142 for tag in tags | |
" search for the first matchin namespace, class, interface with no namespace | |
101 0.000433 if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') | |
101 0.000676 call extend(import, tag) | |
101 0.000167 let import['builtin'] = 0 | |
101 0.000066 break | |
endif | |
endfor | |
101 0.000049 endif | |
101 0.000037 endif | |
303 0.000605 if exists('no_namespace_candidate') | |
unlet no_namespace_candidate | |
endif | |
303 0.000144 endfor | |
202 0.000082 endif | |
404 0.000466 let i += 1 | |
404 0.000285 endwhile | |
101 0.000153 let sorted_imports = {} | |
303 0.000626 for name in sort(keys(imports)) | |
202 0.000468 let sorted_imports[name] = imports[name] | |
202 0.000099 endfor | |
101 0.000197 return [current_namespace, sorted_imports] | |
FUNCTION phpcomplete#GetClassContents() | |
Called 34 times | |
Total time: 0.150885 | |
Self time: 0.000735 | |
count total (s) self (s) | |
34 0.150402 0.000252 let classcontents = phpcomplete#GetCachedClassContents(a:classlocation, a:class_name) | |
34 0.000035 let result = [] | |
68 0.000068 for classstructure in classcontents | |
34 0.000129 call add(result, classstructure.content) | |
34 0.000018 endfor | |
34 0.000100 return join(result, "\n") | |
FUNCTION airline#extensions#wordcount#apply() | |
Called 311 times | |
Total time: 0.007361 | |
Self time: 0.007361 | |
count total (s) self (s) | |
311 0.001064 let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', s:filetypes) | |
" Check if filetype needs testing | |
311 0.000659 if did_filetype() || filetypes isnot s:filetypes | |
let s:filetypes = filetypes | |
" Select test based on type of "filetypes": new=list, old=string | |
if type(filetypes) == get(v:, 't_list', type([])) ? index(filetypes, &filetype) > -1 || index(filetypes, 'all') > -1 : match(&filetype, filetypes) > -1 | |
let b:airline_changedtick = -1 | |
call s:update_wordcount(1) " force update: ensures initial worcount exists | |
elseif exists('b:airline_wordcount') " cleanup when filetype is removed | |
unlet b:airline_wordcount | |
endif | |
endif | |
311 0.000605 if exists('b:airline_wordcount') | |
call airline#extensions#prepend_to_section( 'z', '%{airline#extensions#wordcount#get()}') | |
endif | |
FUNCTION <SNR>111_HandleLSPDiagnostics() | |
Called 48 times | |
Total time: 0.262354 | |
Self time: 0.002217 | |
count total (s) self (s) | |
48 0.000190 let l:linter_name = s:lsp_linter_map[a:conn_id] | |
48 0.001813 0.000303 let l:filename = ale#path#FromURI(a:response.params.uri) | |
48 0.000530 let l:buffer = bufnr(l:filename) | |
48 0.001197 0.000229 if s:ShouldIgnore(l:buffer, l:linter_name) | |
return | |
endif | |
48 0.000040 if l:buffer <= 0 | |
return | |
endif | |
48 0.006027 0.000308 let l:loclist = ale#lsp#response#ReadDiagnostics(a:response) | |
48 0.252270 0.000331 call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0) | |
FUNCTION ale#util#GetMatches() | |
Called 26 times | |
Total time: 0.003449 | |
Self time: 0.003449 | |
count total (s) self (s) | |
26 0.000067 let l:matches = [] | |
26 0.000081 let l:lines = type(a:lines) is v:t_list ? a:lines : [a:lines] | |
26 0.000080 let l:patterns = type(a:patterns) is v:t_list ? a:patterns : [a:patterns] | |
88 0.000091 for l:line in l:lines | |
106 0.000111 for l:pattern in l:patterns | |
62 0.002041 let l:match = matchlist(l:line, l:pattern) | |
62 0.000102 if !empty(l:match) | |
18 0.000034 call add(l:matches, l:match) | |
18 0.000013 break | |
endif | |
44 0.000025 endfor | |
62 0.000028 endfor | |
26 0.000024 return l:matches | |
FUNCTION phpcomplete#GetCachedClassContents() | |
Called 34 times | |
Total time: 0.150150 | |
Self time: 0.001799 | |
count total (s) self (s) | |
34 0.000330 let full_file_path = fnamemodify(a:classlocation, ':p') | |
34 0.000289 let cache_key = full_file_path.'#'.a:class_name.'#'.getftime(full_file_path) | |
" try to read from the cache first | |
34 0.000103 if has_key(s:cache_classstructures, cache_key) | |
33 0.000077 let classcontents = s:cache_classstructures[cache_key] | |
" cached class contents can contain content from multiple files (superclasses) so we have to | |
" validate cached result's validness by the filemtimes used to create the cached value | |
33 0.000032 let valid = 1 | |
66 0.000091 for classstructure in classcontents | |
33 0.000222 if getftime(classstructure.file) != classstructure.mtime | |
let valid = 0 | |
" we could break here, but the time required for checking probably worth | |
" the the memory we can free by checking every file in the cached hirearchy | |
call phpcomplete#ClearCachedClassContents(classstructure.file) | |
endif | |
33 0.000023 endfor | |
33 0.000023 if valid | |
" cache hit, we found an entry for this file + class pair and every | |
" file in the response is also valid | |
33 0.000029 return classcontents | |
else | |
" clear the outdated cached value from the cache store | |
call remove(s:cache_classstructures, cache_key) | |
call phpcomplete#ClearCachedClassContents(full_file_path) | |
" fall trough for the read from files path | |
endif | |
else | |
1 0.000018 0.000009 call phpcomplete#ClearCachedClassContents(full_file_path) | |
1 0.000000 endif | |
" cache miss, fetch the content from the files itself | |
1 0.000032 let classfile = readfile(a:classlocation) | |
1 0.148372 0.000030 let classcontents = phpcomplete#GetClassContentsStructure(full_file_path, classfile, a:class_name) | |
1 0.000003 let s:cache_classstructures[cache_key] = classcontents | |
1 0.000001 return classcontents | |
FUNCTION <SNR>118_FindHistoryItem() | |
Called 52 times | |
Total time: 0.001262 | |
Self time: 0.000737 | |
count total (s) self (s) | |
" Search backwards to find a matching job ID. IDs might be recycled, | |
" so finding the last one should be good enough. | |
52 0.000849 0.000323 for l:obj in reverse(ale#history#Get(a:buffer)) | |
52 0.000081 if l:obj.job_id == a:job_id | |
52 0.000046 return l:obj | |
endif | |
endfor | |
return {} | |
FUNCTION ale#job#Stop() | |
Called 26 times | |
Total time: 0.000691 | |
Self time: 0.000691 | |
count total (s) self (s) | |
26 0.000083 if !has_key(s:job_map, a:job_id) | |
return | |
endif | |
26 0.000072 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. | |
26 0.000072 silent! call jobstop(a:job_id) | |
26 0.000012 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 | |
FUNCTION ale#lsp_linter#GetConfig() | |
Called 55 times | |
Total time: 0.000565 | |
Self time: 0.000565 | |
count total (s) self (s) | |
55 0.000076 let l:config = {} | |
55 0.000103 if has_key(a:linter, 'lsp_config_callback') | |
let l:config = ale#util#GetFunction(a:linter.lsp_config_callback)(a:buffer) | |
elseif has_key(a:linter, 'lsp_config') | |
let l:config = a:linter.lsp_config | |
endif | |
55 0.000036 return l:config | |
FUNCTION <lambda>1() | |
Called 55 times | |
Total time: 0.002042 | |
Self time: 0.000394 | |
count total (s) self (s) | |
55 0.001977 0.000328 return ale#node#FindExecutable(buf, a:base_var_name, a:path_list) | |
FUNCTION <lambda>2() | |
Called 26 times | |
Total time: 0.000385 | |
Self time: 0.000121 | |
count total (s) self (s) | |
26 0.000372 0.000109 return ale#Var(buf, a:variable_name) | |
FUNCTION <lambda>6() | |
Called 1902 times | |
Total time: 0.761704 | |
Self time: 0.016988 | |
count total (s) self (s) | |
1902 0.760870 0.016154 return ale#lsp#HandleMessage(a:conn_id, message) | |
FUNCTION <SNR>29_TimerHandler() | |
Called 45 times | |
Total time: 0.053665 | |
Self time: 0.002155 | |
count total (s) self (s) | |
45 0.000546 let s:timer_id = -1 | |
45 0.000467 let [l:line, l:column] = getcurpos()[1:2] | |
" When running the timer callback, we have to be sure that the cursor | |
" hasn't moved from where it was when we requested completions by typing. | |
45 0.000806 0.000519 if s:timer_pos == [l:line, l:column] && ale#util#Mode() is# 'i' | |
45 0.051460 0.000237 call ale#completion#GetCompletions() | |
45 0.000023 endif | |
FUNCTION <SNR>71_airline_ale_get_line_number() | |
Called 2638 times | |
Total time: 0.035007 | |
Self time: 0.030358 | |
count total (s) self (s) | |
2638 0.002080 if a:cnt == 0 | |
1794 0.000999 return '' | |
endif | |
844 0.001440 let buffer = bufnr('') | |
844 0.001770 let problem_type = (a:type ==# 'error') ? 'E' : 'W' | |
844 0.008874 0.004225 let problems = copy(ale#engine#GetLoclist(buffer)) | |
844 0.006666 call filter(problems, 'v:val.bufnr is buffer && v:val.type is# problem_type') | |
844 0.001026 if empty(problems) | |
return '' | |
endif | |
844 0.002503 let open_lnum_symbol = get(g:, 'airline#extensions#ale#open_lnum_symbol', '(L') | |
844 0.002340 let close_lnum_symbol = get(g:, 'airline#extensions#ale#close_lnum_symbol', ')') | |
844 0.002250 return open_lnum_symbol . problems[0].lnum . close_lnum_symbol | |
FUNCTION ale#engine#HandleLoclist() | |
Called 74 times | |
Total time: 0.341727 | |
Self time: 0.004459 | |
count total (s) self (s) | |
74 0.000300 let l:info = get(g:ale_buffer_info, a:buffer, {}) | |
74 0.000103 if empty(l:info) | |
return | |
endif | |
74 0.000077 if !a:from_other_source | |
" Remove this linter from the list of active linters. | |
" This may have already been done when the job exits. | |
74 0.000353 call filter(l:info.active_linter_list, 'v:val isnot# a:linter_name') | |
74 0.000036 endif | |
" Make some adjustments to the loclists to fix common problems, and also | |
" to set default values for loclist items. | |
74 0.018355 0.000579 let l:linter_loclist = ale#engine#FixLocList( a:buffer, a:linter_name, a:from_other_source, a:loclist,) | |
" Remove previous items for this linter. | |
74 0.000538 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. | |
74 0.000108 if !empty(l:linter_loclist) | |
" Add the new items. | |
58 0.000115 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. | |
58 0.004147 0.000626 call sort(l:info.loclist, 'ale#util#LocItemCompare') | |
58 0.000036 endif | |
74 0.006998 0.000271 if ale#ShouldDoNothing(a:buffer) | |
return | |
endif | |
74 0.309659 0.000415 call ale#engine#SetResults(a:buffer, l:info.loclist) | |
FUNCTION airline#statusline() | |
Called 1459 times | |
Total time: 0.014560 | |
Self time: 0.014560 | |
count total (s) self (s) | |
1459 0.005127 if has_key(s:contexts, a:winnr) | |
1459 0.008034 return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line | |
endif | |
" in rare circumstances this happens...see #276 | |
return '' | |
FUNCTION <SNR>84_GatherOutput() | |
Called 62 times | |
Total time: 0.000565 | |
Self time: 0.000565 | |
count total (s) self (s) | |
62 0.000205 if has_key(s:job_info_map, a:job_id) | |
62 0.000203 call add(s:job_info_map[a:job_id].output, a:line) | |
62 0.000030 endif | |
FUNCTION <SNR>80_build_sections() | |
Called 830 times | |
Total time: 0.214772 | |
Self time: 0.034429 | |
count total (s) self (s) | |
4358 0.004019 for key in a:keys | |
3528 0.007537 if (key == 'warning' || key == 'error') && !a:context.active | |
416 0.000278 continue | |
endif | |
3112 0.192412 0.012069 call s:add_section(a:builder, a:context, key) | |
3112 0.001784 endfor | |
FUNCTION ale#lsp#StartProgram() | |
Called 55 times | |
Total time: 0.001920 | |
Self time: 0.001293 | |
count total (s) self (s) | |
55 0.000131 let l:conn = s:connections[a:conn_id] | |
55 0.000930 0.000304 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 | |
55 0.000071 let l:job_id = l:conn.job_id | |
55 0.000025 endif | |
55 0.000061 if l:job_id > 0 | |
55 0.000145 let l:conn.job_id = l:job_id | |
55 0.000025 endif | |
55 0.000056 return l:job_id > 0 | |
FUNCTION <SNR>20_invoke_funcrefs() | |
Called 519 times | |
Total time: 2.645346 | |
Self time: 0.020063 | |
count total (s) self (s) | |
519 0.013827 0.002171 let builder = airline#builder#new(a:context) | |
519 0.360098 0.005066 let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context) | |
519 0.000412 if err == 1 | |
519 2.262185 0.003591 let a:context.line = builder.build() | |
519 0.003175 let s:contexts[a:context.winnr] = a:context | |
519 0.004616 call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')') | |
519 0.000230 endif | |
FUNCTION ale#history#Get() | |
Called 52 times | |
Total time: 0.000526 | |
Self time: 0.000526 | |
count total (s) self (s) | |
52 0.000429 return copy(getbufvar(a:buffer, 'ale_history', [])) | |
FUNCTION <SNR>19_on_window_changed() | |
Called 488 times | |
Total time: 2.696310 | |
Self time: 0.016442 | |
count total (s) self (s) | |
488 0.001493 let s:active_winnr = winnr() | |
488 0.001034 if pumvisible() && (!&previewwindow || g:airline_exclude_preview) | |
7 0.000007 return | |
endif | |
" Handle each window only once, since we might come here several times for | |
" different autocommands. | |
481 0.003843 let l:key = [bufnr('%'), s:active_winnr, winnr('$'), tabpagenr(), &ft] | |
481 0.003333 if get(g:, 'airline_last_window_changed', []) == l:key && &stl is# '%!airline#statusline('.s:active_winnr.')' && &ft !~? 'gitcommit' | |
" fugitive is special, it changes names and filetypes several times, | |
" make sure the caching does not get into its way | |
170 0.000100 return | |
endif | |
311 0.000928 let g:airline_last_window_changed = l:key | |
311 0.002108 0.001323 call s:init() | |
311 2.680556 0.001474 call airline#update_statusline() | |
FUNCTION airline#extensions#apply() | |
Called 519 times | |
Total time: 0.038133 | |
Self time: 0.018713 | |
count total (s) self (s) | |
519 0.021604 0.002184 if s:is_excluded_window() | |
return -1 | |
endif | |
519 0.000671 if &buftype == 'help' | |
call airline#extensions#apply_left_override('Help', '%f') | |
let w:airline_section_x = '' | |
let w:airline_section_y = '' | |
let w:airline_render_right = 1 | |
endif | |
519 0.000561 if &buftype == 'terminal' | |
let w:airline_section_x = '' | |
let w:airline_section_y = '' | |
endif | |
519 0.000407 if &previewwindow | |
4 0.000006 let w:airline_section_a = 'Preview' | |
4 0.000004 let w:airline_section_b = '' | |
4 0.000013 let w:airline_section_c = bufname(winbufnr(winnr())) | |
4 0.000002 endif | |
519 0.001748 if has_key(s:filetype_overrides, &ft) | |
let args = s:filetype_overrides[&ft] | |
call airline#extensions#apply_left_override(args[0], args[1]) | |
endif | |
519 0.001270 for item in items(s:filetype_regex_overrides) | |
if match(&ft, item[0]) >= 0 | |
call airline#extensions#apply_left_override(item[1][0], item[1][1]) | |
endif | |
endfor | |
FUNCTION ale#engine#GetLoclist() | |
Called 844 times | |
Total time: 0.004649 | |
Self time: 0.004649 | |
count total (s) self (s) | |
844 0.001658 if !has_key(g:ale_buffer_info, a:buffer) | |
return [] | |
endif | |
844 0.001197 return g:ale_buffer_info[a:buffer].loclist | |
FUNCTION <SNR>121_SetListsImpl() | |
Called 74 times | |
Total time: 0.025929 | |
Self time: 0.008601 | |
count total (s) self (s) | |
74 0.001301 let l:title = expand('#' . a:buffer . ':p') | |
74 0.000080 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. | |
74 0.000926 0.000448 let l:id = s:BufWinId(a:buffer) | |
74 0.000215 if has('nvim') | |
74 0.015003 0.001755 call setloclist(l:id, s:FixList(a:buffer, a:loclist), ' ', l:title) | |
74 0.000049 else | |
call setloclist(l:id, s:FixList(a:buffer, a:loclist)) | |
call setloclist(l:id, [], 'r', {'title': l:title}) | |
endif | |
74 0.000037 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. | |
74 0.001764 0.000348 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. | |
74 0.000913 0.000263 if !ale#engine#IsCheckingBuffer(a:buffer) | |
47 0.001710 0.000174 call s:CloseWindowIfNeeded(a:buffer) | |
47 0.000023 endif | |
FUNCTION ale#lsp#OpenDocument() | |
Called 55 times | |
Total time: 0.001083 | |
Self time: 0.001083 | |
count total (s) self (s) | |
55 0.000144 let l:conn = get(s:connections, a:conn_id, {}) | |
55 0.000055 let l:opened = 0 | |
55 0.000175 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 | |
55 0.000036 return l:opened | |
FUNCTION <SNR>71_airline_ale_count() | |
Called 2638 times | |
Total time: 0.004555 | |
Self time: 0.004555 | |
count total (s) self (s) | |
2638 0.003751 return a:cnt ? a:symbol. a:cnt : '' | |
FUNCTION airline#util#has_lawrencium() | |
Called 1439 times | |
Total time: 0.004131 | |
Self time: 0.004131 | |
count total (s) self (s) | |
1439 0.003646 return exists('*lawrencium#statusline') | |
FUNCTION GetLastRealCodeLNum() | |
Called 33 times | |
Total time: 0.005487 | |
Self time: 0.005298 | |
count total (s) self (s) | |
33 0.000067 let lnum = a:startline | |
33 0.000048 if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1 | |
let lnum = b:GetLastRealCodeLNum_ADD | |
endif | |
43 0.000048 while lnum > 1 | |
43 0.000082 let lnum = prevnonblank(lnum) | |
43 0.000100 let lastline = getline(lnum) | |
43 0.000051 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*$' | |
10 0.000019 call cursor(lnum, 1) | |
10 0.000026 if lastline !~ '^\*/' | |
10 0.000033 call search('\*/', 'W') | |
10 0.000014 endif | |
10 0.000855 0.000666 let lnum = searchpair('/\*', '', '\*/', s:searchpairflags, 'Skippmatch2()') | |
10 0.000020 let lastline = getline(lnum) | |
10 0.000059 if lastline =~ '^\s*/\*' | |
10 0.000011 let lnum = lnum - 1 | |
10 0.000008 else | |
break | |
endif | |
10 0.000009 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 | |
33 0.000019 break | |
endif | |
10 0.000006 endwhile | |
33 0.000051 if lnum==1 && getline(lnum) !~ '<?' | |
let lnum=0 | |
endif | |
33 0.000057 if b:InPHPcode_and_script && 1 > b:InPHPcode | |
let b:InPHPcode_and_script = 0 | |
endif | |
33 0.000025 return lnum | |
FUNCTION airline#highlighter#get_highlight() | |
Called 14830 times | |
Total time: 1.483138 | |
Self time: 0.680103 | |
count total (s) self (s) | |
14830 0.206492 let reverse = get(g:, 'airline_gui_mode', '') ==# 'gui' ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term') | |
14830 0.041885 if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group) | |
let res = s:hl_groups[a:group] | |
return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res | |
else | |
14830 0.423701 0.062613 let fg = s:get_syn(a:group, 'fg') | |
14830 0.397228 0.054752 let bg = s:get_syn(a:group, 'bg') | |
14830 0.070388 let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold') | |
14830 0.015040 let opts = a:000 | |
14830 0.010017 if bold | |
180 0.000219 let opts = ['bold'] | |
180 0.000078 endif | |
14830 0.178867 0.079395 let res = reverse ? s:get_array(bg, fg, opts) : s:get_array(fg, bg, opts) | |
14830 0.006568 endif | |
14830 0.028832 let s:hl_groups[a:group] = res | |
14830 0.009393 return res | |
FUNCTION phpcomplete#GetClassLocation() | |
Called 35 times | |
Total time: 1.722174 | |
Self time: 0.021010 | |
count total (s) self (s) | |
" Check classname may be name of built in object | |
35 0.000153 if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\') | |
return 'VIMPHP_BUILTINOBJECT' | |
endif | |
35 0.000125 if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\') | |
return 'VIMPHP_BUILTINOBJECT' | |
endif | |
35 0.000055 if a:namespace == '' || a:namespace == '\' | |
let search_namespace = '\' | |
else | |
35 0.000073 let search_namespace = tolower(a:namespace) | |
35 0.000015 endif | |
35 1.699668 0.001239 let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) | |
" do in-file lookup for class definition | |
35 0.000040 let i = 1 | |
1128 0.001344 while i < line('.') | |
1127 0.002396 let line = getline(line('.')-i) | |
1127 0.011812 if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace | |
34 0.000359 return expand('%:p') | |
else | |
1093 0.000794 let i += 1 | |
1093 0.000603 continue | |
endif | |
endwhile | |
" Get class location from tags | |
1 0.000001 let no_namespace_candidate = '' | |
1 0.002741 0.000007 let tags = phpcomplete#GetTaglist('^'.a:classname.'$') | |
1 0.000001 for tag in tags | |
" We'll allow interfaces and traits to be handled classes since you | |
" can't have colliding names with different kinds anyway | |
if tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't' | |
if !has_key(tag, 'namespace') | |
let no_namespace_candidate = tag.filename | |
else | |
if search_namespace == tolower(tag.namespace) | |
return tag.filename | |
endif | |
endif | |
endif | |
endfor | |
1 0.000002 if no_namespace_candidate != '' | |
return no_namespace_candidate | |
endif | |
1 0.000001 return '' | |
FUNCTION AutoPairsInsert() | |
Called 3 times | |
Total time: 0.000444 | |
Self time: 0.000444 | |
count total (s) self (s) | |
3 0.000023 if !b:autopairs_enabled | |
return a:key | |
end | |
3 0.000008 let line = getline('.') | |
3 0.000016 let pos = col('.') - 1 | |
3 0.000008 let before = strpart(line, 0, pos) | |
3 0.000006 let after = strpart(line, pos) | |
3 0.000025 let next_chars = split(after, '\zs') | |
3 0.000007 let current_char = get(next_chars, 0, '') | |
3 0.000005 let next_char = get(next_chars, 1, '') | |
3 0.000127 let prev_chars = split(before, '\zs') | |
3 0.000006 let prev_char = get(prev_chars, -1, '') | |
3 0.000002 let eol = 0 | |
3 0.000007 if col('$') - col('.') <= 1 | |
3 0.000003 let eol = 1 | |
3 0.000001 end | |
" Ignore auto close if prev character is \ | |
3 0.000004 if prev_char == '\' | |
return a:key | |
end | |
" The key is difference open-pair, then it means only for ) ] } by default | |
3 0.000007 if !has_key(b:AutoPairs, a:key) | |
1 0.000005 let b:autopairs_saved_pair = [a:key, getpos('.')] | |
" Skip the character if current character is the same as input | |
1 0.000001 if current_char == a:key | |
1 0.000001 return s:Right | |
end | |
if !g:AutoPairsFlyMode | |
" Skip the character if next character is space | |
if current_char == ' ' && next_char == a:key | |
return s:Right.s:Right | |
end | |
" Skip the character if closed pair is next character | |
if current_char == '' | |
if g:AutoPairsMultilineClose | |
let next_lineno = line('.')+1 | |
let next_line = getline(nextnonblank(next_lineno)) | |
let next_char = matchstr(next_line, '\s*\zs.') | |
else | |
let next_char = matchstr(line, '\s*\zs.') | |
end | |
if next_char == a:key | |
return "\<ESC>e^a" | |
endif | |
endif | |
endif | |
" Fly Mode, and the key is closed-pairs, search closed-pair and jump | |
if g:AutoPairsFlyMode && has_key(b:AutoPairsClosedPairs, a:key) | |
let n = stridx(after, a:key) | |
if n != -1 | |
return repeat(s:Right, n+1) | |
end | |
if search(a:key, 'W') | |
" force break the '.' when jump to different line | |
return "\<Right>" | |
endif | |
endif | |
" Insert directly if the key is not an open key | |
return a:key | |
end | |
2 0.000002 let open = a:key | |
2 0.000004 let close = b:AutoPairs[open] | |
2 0.000003 if current_char == close && open == close | |
return s:Right | |
end | |
" Ignore auto close ' if follows a word | |
" MUST after closed check. 'hello|' | |
2 0.000003 if a:key == "'" && prev_char =~ '\v\w' | |
return a:key | |
end | |
" support for ''' ``` and """ | |
2 0.000002 if open == close | |
" The key must be ' " ` | |
let pprev_char = line[col('.')-3] | |
if pprev_char == open && prev_char == open | |
" Double pair found | |
return repeat(a:key, 4) . repeat(s:Left, 3) | |
end | |
end | |
2 0.000002 let quotes_num = 0 | |
" Ignore comment line for vim file | |
2 0.000004 if &filetype == 'vim' && a:key == '"' | |
if before =~ '^\s*$' | |
return a:key | |
end | |
if before =~ '^\s*"' | |
let quotes_num = -1 | |
end | |
end | |
" Keep quote number is odd. | |
" Because quotes should be matched in the same line in most of situation | |
2 0.000003 if g:AutoPairsSmartQuotes && open == close | |
" Remove \\ \" \' | |
let cleaned_line = substitute(line, '\v(\\.)', '', 'g') | |
let n = quotes_num | |
let pos = 0 | |
while 1 | |
let pos = stridx(cleaned_line, open, pos) | |
if pos == -1 | |
break | |
end | |
let n = n + 1 | |
let pos = pos + 1 | |
endwhile | |
if n % 2 == 1 | |
return a:key | |
endif | |
endif | |
2 0.000004 return open.close.s:Left | |
FUNCTION airline#util#shorten() | |
Called 2878 times | |
Total time: 0.033477 | |
Self time: 0.033477 | |
count total (s) self (s) | |
2878 0.009492 if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth | |
if get(a:000, 0, 0) | |
" shorten from tail | |
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$') | |
else | |
" shorten from beginning of string | |
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…' | |
endif | |
else | |
2878 0.002416 return a:text | |
endif | |
FUNCTION <SNR>76_get_syn() | |
Called 29660 times | |
Total time: 0.703564 | |
Self time: 0.703564 | |
count total (s) self (s) | |
29660 0.060404 if !exists("g:airline_gui_mode") | |
let g:airline_gui_mode = airline#init#gui_mode() | |
endif | |
29660 0.024964 let color = '' | |
29660 0.089831 if hlexists(a:group) | |
28818 0.158571 let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode) | |
28818 0.012791 endif | |
29660 0.052581 if empty(color) || color == -1 | |
" should always exists | |
846 0.005889 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode) | |
" however, just in case | |
846 0.001640 if empty(color) || color == -1 | |
let color = 'NONE' | |
endif | |
846 0.000329 endif | |
29660 0.021090 return color | |
FUNCTION ale#linter#GetExecutable() | |
Called 81 times | |
Total time: 0.003574 | |
Self time: 0.000723 | |
count total (s) self (s) | |
81 0.003517 0.000666 return has_key(a:linter, 'executable_callback') ? ale#util#GetFunction(a:linter.executable_callback)(a:buffer) : a:linter.executable | |
FUNCTION airline#highlighter#highlight_modified_inactive() | |
Called 18 times | |
Total time: 0.005702 | |
Self time: 0.000651 | |
count total (s) self (s) | |
18 0.000072 if getbufvar(a:bufnr, '&modified') | |
16 0.000208 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : [] | |
16 0.000010 else | |
2 0.000015 let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : [] | |
2 0.000001 endif | |
18 0.000044 if !empty(colors) | |
18 0.005234 0.000183 call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) | |
18 0.000008 endif | |
FUNCTION <SNR>84_RemoveProblemsForDisabledLinters() | |
Called 26 times | |
Total time: 0.000734 | |
Self time: 0.000734 | |
count total (s) self (s) | |
" Figure out which linters are still enabled, and remove | |
" problems for linters which are no longer enabled. | |
" Problems from other sources will be kept. | |
26 0.000031 let l:name_map = {} | |
78 0.000074 for l:linter in a:linters | |
52 0.000106 let l:name_map[l:linter.name] = 1 | |
52 0.000033 endfor | |
26 0.000357 call filter( get(g:ale_buffer_info[a:buffer], 'loclist', []), 'get(v:val, ''from_other_source'') || get(l:name_map, get(v:val, ''linter_name''))',) | |
FUNCTION ale#job#PrepareCommand() | |
Called 81 times | |
Total time: 0.004630 | |
Self time: 0.003720 | |
count total (s) self (s) | |
81 0.001285 0.000374 let l:wrapper = ale#Var(a:buffer, 'command_wrapper') | |
81 0.000369 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. | |
81 0.000309 if has('win32') | |
return 'cmd /s/c "' . l:command . '"' | |
endif | |
81 0.000758 if &shell =~? 'fish$\|pwsh$' | |
return ['/bin/sh', '-c', l:command] | |
endif | |
81 0.001193 return split(&shell) + split(&shellcmdflag) + [l:command] | |
FUNCTION airline#extensions#branch#get_head() | |
Called 1439 times | |
Total time: 0.449601 | |
Self time: 0.023878 | |
count total (s) self (s) | |
1439 0.431343 0.005619 let head = airline#extensions#branch#head() | |
1439 0.004443 let empty_message = get(g:, 'airline#extensions#branch#empty_message', '') | |
1439 0.004487 let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) | |
1439 0.008003 return empty(head) ? empty_message : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head) | |
FUNCTION ale#util#GetFunction() | |
Called 7229 times | |
Total time: 0.043554 | |
Self time: 0.043554 | |
count total (s) self (s) | |
7229 0.016365 if type(a:string_or_ref) is v:t_string | |
81 0.000206 return function(a:string_or_ref) | |
endif | |
7148 0.006509 return a:string_or_ref | |
FUNCTION airline#extensions#keymap#status() | |
Called 1439 times | |
Total time: 0.012194 | |
Self time: 0.012194 | |
count total (s) self (s) | |
1439 0.005776 if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap')) | |
1439 0.005515 return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : '')) | |
else | |
return '' | |
endif | |
FUNCTION phpcomplete#CompletePHP() | |
Called 130 times | |
Total time: 7.821862 | |
Self time: 0.044970 | |
count total (s) self (s) | |
130 0.000283 if a:findstart | |
65 0.000092 unlet! b:php_menu | |
" Check if we are inside of PHP markup | |
65 0.000187 let pos = getpos('.') | |
65 0.015156 let phpbegin = searchpairpos('<?', '', '?>', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') | |
65 0.000877 let phpend = searchpairpos('<?', '', '?>', 'Wn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') | |
65 0.000178 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 | |
65 0.000151 let line = getline('.') | |
65 0.000123 let start = col('.') - 1 | |
65 0.000115 let compl_begin = col('.') - 2 | |
547 0.002178 while start >= 0 && line[start - 1] =~ '[\\a-zA-Z_0-9\x7f-\xff$]' | |
482 0.000431 let start -= 1 | |
482 0.000241 endwhile | |
65 0.000184 let b:phpbegin = phpbegin | |
65 0.408877 0.001237 let b:compl_context = phpcomplete#GetCurrentInstruction(line('.'), max([0, col('.') - 2]), phpbegin) | |
65 0.000072 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 | |
65 0.000185 if exists("b:php_menu") | |
return b:php_menu | |
endif | |
65 0.000267 if !exists('g:php_builtin_functions') | |
call phpcomplete#LoadData() | |
endif | |
" a:base is very short - we need context | |
65 0.000164 if exists("b:compl_context") | |
65 0.000112 let context = b:compl_context | |
65 0.000255 unlet! b:compl_context | |
" chop of the "base" from the end of the current instruction | |
65 0.000090 if a:base != "" | |
64 0.000888 let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '') | |
64 0.000036 end | |
65 0.000039 else | |
let context = '' | |
end | |
65 0.000098 try | |
65 0.000148 let winheight = winheight(0) | |
65 0.000119 let winnr = winnr() | |
65 2.826226 0.002803 let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) | |
65 0.000287 if context =~? '^use\s' || context ==? 'use' | |
return phpcomplete#CompleteUse(a:base) | |
endif | |
65 0.000360 if context =~ '\(->\|::\)$' | |
" {{{ | |
" Get name of the class | |
34 0.038600 0.000329 let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports) | |
" Get location of class definition, we have to iterate through all | |
34 0.000039 if classname != '' | |
34 0.000070 if classname =~ '\' | |
" split the last \ segment as a classname, everything else is the namespace | |
34 0.000122 let classname_parts = split(classname, '\') | |
34 0.000213 let namespace = join(classname_parts[0:-2], '\') | |
34 0.000046 let classname = classname_parts[-1] | |
34 0.000015 else | |
let namespace = '\' | |
endif | |
34 1.670262 0.000391 let classlocation = phpcomplete#GetClassLocation(classname, namespace) | |
34 0.000024 else | |
let classlocation = '' | |
endif | |
34 0.000045 if classlocation != '' | |
34 0.000100 if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname)) | |
return phpcomplete#CompleteBuiltInClass(context, classname, a:base) | |
endif | |
34 0.000542 if filereadable(classlocation) | |
34 0.001246 let classfile = readfile(classlocation) | |
34 0.000053 let classcontent = '' | |
34 0.151210 0.000325 let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname) | |
34 0.000346 let sccontent = split(classcontent, "\n") | |
34 0.000496 let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public' | |
34 0.048499 0.000534 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 | |
31 0.000085 if a:base =~ '^\$' | |
12 0.008079 0.000297 return phpcomplete#CompleteVariable(a:base) | |
else | |
19 2.634107 0.003052 return phpcomplete#CompleteGeneral(a:base, current_namespace, imports) | |
endif | |
finally | |
65 0.000436 silent! exec winnr.'resize '.winheight | |
65 0.000068 endtry | |
FUNCTION <SNR>113_SendMessageData() | |
Called 77 times | |
Total time: 0.002433 | |
Self time: 0.001070 | |
count total (s) self (s) | |
77 0.000172 if has_key(a:conn, 'job_id') | |
77 0.001668 0.000305 call ale#job#SendRaw(a:conn.job_id, a:data) | |
77 0.000185 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 | |
77 0.000041 return 1 | |
FUNCTION <SNR>48_LocalBrowse() | |
Called 214 times | |
Total time: 0.007739 | |
Self time: 0.007739 | |
count total (s) self (s) | |
" Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. | |
" Otherwise, the BufEnter event gets triggered when attempts to write to | |
" the DBG buffer are made. | |
214 0.000457 if !exists("s:vimentered") | |
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, | |
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") | |
" call Dret("s:LocalBrowse") | |
return | |
endif | |
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") | |
214 0.000690 if has("amiga") | |
" The check against '' is made for the Amiga, where the empty | |
" string is the current directory and not checking would break | |
" things such as the help command. | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") | |
if a:dirname != '' && isdirectory(a:dirname) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
endif | |
endif | |
elseif isdirectory(a:dirname) | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") | |
" call Dredir("LocalBrowse ft last set: ","verbose set ft") | |
" call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
sil! call netrw#LocalBrowseCheck(a:dirname) | |
" call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | |
exe w:netrw_bannercnt | |
" call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
endif | |
else | |
" not a directory, ignore it | |
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") | |
214 0.000104 endif | |
" call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col(".")) | |
" call Dret("s:LocalBrowse") | |
FUNCTION ale#lsp_linter#CheckWithLSP() | |
Called 26 times | |
Total time: 0.023336 | |
Self time: 0.001404 | |
count total (s) self (s) | |
26 0.000053 let l:info = g:ale_buffer_info[a:buffer] | |
26 0.016199 0.000172 let l:lsp_details = ale#lsp_linter#StartLSP(a:buffer, a:linter) | |
26 0.000031 if empty(l:lsp_details) | |
return 0 | |
endif | |
26 0.000036 let l:id = l:lsp_details.connection_id | |
" Register a callback now for handling errors now. | |
26 0.000077 let l:Callback = function('ale#lsp_linter#HandleLSPResponse') | |
26 0.000512 0.000109 call ale#lsp#RegisterCallback(l:id, l:Callback) | |
" Remember the linter this connection is for. | |
26 0.000083 let s:lsp_linter_map[l:id] = a:linter.name | |
26 0.000030 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 | |
26 0.005665 0.000163 let l:notified = ale#lsp#NotifyForChanges(l:id, a:buffer) | |
26 0.000011 endif | |
" If this was a file save event, also notify the server of that. | |
26 0.000087 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 | |
26 0.000016 if l:notified | |
19 0.000041 if index(l:info.active_linter_list, a:linter.name) < 0 | |
19 0.000039 call add(l:info.active_linter_list, a:linter.name) | |
19 0.000008 endif | |
19 0.000006 endif | |
26 0.000017 return l:notified | |
FUNCTION airline#extensions#ctrlp#apply() | |
Called 311 times | |
Total time: 0.002069 | |
Self time: 0.002069 | |
count total (s) self (s) | |
" disable statusline overwrite if ctrlp already did it | |
311 0.001811 return match(&statusline, 'CtrlPwhite') >= 0 ? -1 : 0 | |
FUNCTION ale#uri#Encode() | |
Called 77 times | |
Total time: 0.001419 | |
Self time: 0.001419 | |
count total (s) self (s) | |
77 0.001343 return substitute( a:value, '\([^a-zA-Z0-9\\/$\-_.!*''(),]\)', '\=printf(''%%%02x'', char2nr(submatch(1)))', 'g') | |
FUNCTION ale#lsp#WaitForCapability() | |
Called 29 times | |
Total time: 0.017031 | |
Self time: 0.000786 | |
count total (s) self (s) | |
29 0.000088 let l:conn = get(s:connections, a:conn_id, {}) | |
29 0.000033 if empty(l:conn) | |
return | |
endif | |
29 0.000099 if type(get(l:conn.capabilities, a:capability, v:null)) isnot v:t_number | |
throw 'Invalid capability ' . a:capability | |
endif | |
29 0.000020 if l:conn.initialized | |
29 0.000042 if l:conn.capabilities[a:capability] | |
" The project has been initialized, so call the callback now. | |
29 0.016484 0.000239 call call(a:callback, [a:conn_id]) | |
29 0.000012 endif | |
29 0.000011 else | |
" Call the callback later, once we have the information we need. | |
call add(l:conn.capabilities_queue, [a:capability, a:callback]) | |
endif | |
FUNCTION <SNR>115_NeoVimCallback() | |
Called 1980 times | |
Total time: 0.996603 | |
Self time: 0.090017 | |
count total (s) self (s) | |
1980 0.014096 let l:info = s:job_map[a:job] | |
1980 0.004146 if a:event is# 'stdout' | |
1954 0.828989 0.022771 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),) | |
1954 0.001530 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 | |
26 0.000140 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 | |
26 0.000063 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 | |
26 0.000018 try | |
26 0.100796 0.000428 call ale#util#GetFunction(l:info.exit_cb)(a:job, a:data) | |
26 0.000023 finally | |
" Automatically forget about the job after it's done. | |
26 0.000071 if has_key(s:job_map, a:job) | |
26 0.000071 call remove(s:job_map, a:job) | |
26 0.000012 endif | |
26 0.000017 endtry | |
26 0.000010 endif | |
FUNCTION ale#command#FormatCommand() | |
Called 81 times | |
Total time: 0.006759 | |
Self time: 0.004449 | |
count total (s) self (s) | |
81 0.000105 let l:temporary_file = '' | |
81 0.000091 let l:command = a:command | |
" First replace all uses of %%, used for literal percent characters, | |
" with an ugly string. | |
81 0.000447 let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g') | |
" Replace %e with the escaped executable, if available. | |
81 0.000287 if !empty(a:executable) && l:command =~# '%e' | |
81 0.001820 0.000739 let l:command = substitute(l:command, '%e', '\=ale#Escape(a:executable)', 'g') | |
81 0.000039 endif | |
" Replace all %s occurrences in the string with the name of the current | |
" file. | |
81 0.000178 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 | |
81 0.000138 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 %. | |
81 0.000364 let l:command = substitute(l:command, '<<PERCENTS>>', '%', 'g') | |
81 0.000149 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. | |
26 0.001078 0.000117 let l:temporary_file = s:TemporaryFilename(a:buffer) | |
26 0.000388 0.000120 let l:command = l:command . ' < ' . ale#Escape(l:temporary_file) | |
26 0.000011 endif | |
81 0.000133 return [l:temporary_file, l:command] | |
FUNCTION ale_linters#php#php#Handle() | |
Called 26 times | |
Total time: 0.004585 | |
Self time: 0.001137 | |
count total (s) self (s) | |
" 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 | |
26 0.000091 let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in %(-|Standard input code) on line (\d+)' | |
26 0.000034 let l:output = [] | |
44 0.003636 0.000187 for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
18 0.000110 let l:col = empty(l:match[2]) ? 0 : stridx(getline(l:match[3]), l:match[2]) + 1 | |
18 0.000076 let l:obj = { 'lnum': l:match[3] + 0, 'col': l:col, 'text': l:match[1],} | |
18 0.000017 if l:col != 0 | |
18 0.000059 let l:obj.end_col = l:col + strlen(l:match[2]) - 1 | |
18 0.000009 endif | |
18 0.000033 call add(l:output, l:obj) | |
18 0.000021 endfor | |
26 0.000020 return l:output | |
FUNCTION <SNR>79_section_is_empty() | |
Called 3839 times | |
Total time: 0.032137 | |
Self time: 0.032137 | |
count total (s) self (s) | |
3839 0.003665 let start=1 | |
" do not check for inactive windows or the tabline | |
3839 0.004038 if a:self._context.active == 0 | |
1040 0.000679 return 0 | |
elseif get(a:self._context, 'tabline', 0) | |
return 0 | |
endif | |
" only check, if airline#skip_empty_sections == 1 | |
2799 0.005617 if get(g:, 'airline_skip_empty_sections', 0) == 0 | |
2799 0.001582 return 0 | |
endif | |
" only check, if airline#skip_empty_sections == 1 | |
if get(w:, 'airline_skip_empty_sections', -1) == 0 | |
return 0 | |
endif | |
" assume accents sections to be never empty | |
" (avoides, that on startup the mode message becomes empty) | |
if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1 | |
return 0 | |
endif | |
if empty(a:content) | |
return 1 | |
endif | |
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) | |
if empty(list) | |
return 0 " no function in statusline text | |
endif | |
while len(list) > 0 | |
let expr = list[0] | |
try | |
" catch all exceptions, just in case | |
if !empty(eval(expr)) | |
return 0 | |
endif | |
catch | |
return 0 | |
endtry | |
let start += 1 | |
let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) | |
endw | |
return 1 | |
FUNCTION phpcomplete#CompleteUserClass() | |
Called 34 times | |
Total time: 0.047965 | |
Self time: 0.045368 | |
count total (s) self (s) | |
34 0.000047 let final_list = [] | |
34 0.000032 let res = [] | |
34 0.000041 let required_modifiers = [] | |
34 0.000037 let prohibited_modifiers = [] | |
34 0.000044 if a:visibility == 'public' | |
let prohibited_modifiers += ['private', 'protected'] | |
endif | |
" limit based on context to static or normal methods | |
34 0.000036 let static_con = '' | |
34 0.000109 if a:context =~ '::$' && a:context !~? 'parent::$' | |
if g:phpcomplete_relax_static_constraint != 1 | |
let required_modifiers += ['static'] | |
endif | |
elseif a:context =~ '->$' | |
34 0.000089 let prohibited_modifiers += ['static'] | |
34 0.000016 endif | |
34 0.009006 let all_function = filter(deepcopy(a:sccontent), 'v:val =~ "^\\s*\\(public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)*function"') | |
34 0.000041 let functions = [] | |
68 0.000079 for i in all_function | |
34 0.000646 let modifiers = split(matchstr(tolower(i), '\zs.\+\zefunction'), '\s\+') | |
34 0.001015 0.000211 if phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) == 1 | |
34 0.000078 call add(functions, i) | |
34 0.000016 endif | |
34 0.000015 endfor | |
34 0.000048 let c_functions = {} | |
34 0.000034 let c_doc = {} | |
68 0.000065 for i in functions | |
34 0.000415 let f_name = matchstr(i, 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') | |
34 0.000545 let f_args = matchstr(i, 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)') | |
34 0.000102 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 | |
34 0.000017 endfor | |
" limit based on context to static or normal attributes | |
34 0.000096 if a:context =~ '::$' && a:context !~? 'parent::$' | |
" variables must have static to be accessed as static unlike functions | |
let required_modifiers += ['static'] | |
endif | |
34 0.020824 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*$\\)"') | |
34 0.000059 let variables = [] | |
68 0.000075 for i in all_variable | |
34 0.000611 let modifiers = split(matchstr(tolower(i), '\zs.\+\ze\$'), '\s\+') | |
34 0.001096 0.000204 if phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) == 1 | |
34 0.000085 call add(variables, i) | |
34 0.000016 endif | |
34 0.000014 endfor | |
34 0.000194 let static_vars = split(join(variables, ' '), '\$') | |
34 0.000045 let c_variables = {} | |
34 0.000034 let var_index = 0 | |
136 0.000117 for i in static_vars | |
102 0.000733 let c_var = matchstr(i, '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') | |
102 0.000115 if c_var != '' | |
68 0.000145 if a:context =~ '::$' | |
let c_var = '$'.c_var | |
endif | |
68 0.000129 let c_variables[c_var] = '' | |
68 0.000164 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 | |
68 0.000070 let var_index += 1 | |
68 0.000029 endif | |
102 0.000045 endfor | |
34 0.003842 let constants = filter(deepcopy(a:sccontent), 'v:val =~ "^\\s*const\\s\\+"') | |
34 0.000073 let jcons = join(constants, ' ') | |
34 0.000114 let scons = split(jcons, 'const') | |
34 0.000037 let c_constants = {} | |
34 0.000036 let const_index = 0 | |
34 0.000037 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 | |
34 0.000037 let all_values = {} | |
34 0.000171 call extend(all_values, c_functions) | |
34 0.000107 call extend(all_values, c_variables) | |
34 0.000070 call extend(all_values, c_constants) | |
102 0.000195 for m in sort(keys(all_values)) | |
68 0.000140 if stridx(m, a:base) == 0 | |
7 0.000013 call add(res, m) | |
7 0.000003 endif | |
68 0.000029 endfor | |
34 0.000037 let start_list = res | |
34 0.000035 let final_list = [] | |
41 0.000043 for i in start_list | |
7 0.000685 0.000064 let docblock = phpcomplete#ParseDocBlock(get(c_doc, i, '')) | |
7 0.000014 if has_key(c_variables, i) | |
7 0.000351 0.000071 let final_list += [{'word': i, 'info':phpcomplete#FormatDocBlock(docblock), 'menu':get(docblock.var, 'type', ''), 'kind':'v'}] | |
7 0.000011 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 | |
7 0.000004 endfor | |
34 0.000032 return final_list | |
FUNCTION ale#completion#Done() | |
Called 68 times | |
Total time: 0.002674 | |
Self time: 0.001583 | |
count total (s) self (s) | |
68 0.000737 silent! pclose | |
68 0.001403 0.000312 call ale#completion#RestoreCompletionOptions() | |
68 0.000388 let s:last_done_pos = getcurpos()[1:2] | |
FUNCTION GetPhpIndent() | |
Called 10 times | |
Total time: 0.017143 | |
Self time: 0.006177 | |
count total (s) self (s) | |
10 0.000050 let b:GetLastRealCodeLNum_ADD = 0 | |
10 0.000013 let UserIsEditing=0 | |
10 0.000017 if b:PHP_oldchangetick != b:changedtick | |
9 0.000035 let b:PHP_oldchangetick = b:changedtick | |
9 0.000014 let UserIsEditing=1 | |
9 0.000006 endif | |
10 0.000009 if b:PHP_default_indenting | |
let b:PHP_default_indenting = g:PHP_default_indenting * shiftwidth() | |
endif | |
10 0.000027 let cline = getline(v:lnum) | |
10 0.000019 if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast | |
10 0.000008 if b:PHP_indentbeforelast | |
3 0.000005 let b:PHP_indentinghuge = 1 | |
3 0.000001 endif | |
10 0.000021 let b:PHP_indentbeforelast = b:PHP_lastindented | |
10 0.000005 endif | |
10 0.000037 if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented | |
7 0.000014 if b:PHP_indentinghuge | |
3 0.000003 let b:PHP_indentinghuge = 0 | |
3 0.000004 let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
3 0.000001 endif | |
7 0.000010 let real_PHP_lastindented = v:lnum | |
7 0.000008 let b:PHP_LastIndentedWasComment=0 | |
7 0.000007 let b:PHP_InsideMultilineComment=0 | |
7 0.000006 let b:PHP_indentbeforelast = 0 | |
7 0.000006 let b:InPHPcode = 0 | |
7 0.000006 let b:InPHPcode_checked = 0 | |
7 0.000007 let b:InPHPcode_and_script = 0 | |
7 0.000016 let b:InPHPcode_tofind = "" | |
7 0.000007 elseif v:lnum > b:PHP_lastindented | |
3 0.000015 let real_PHP_lastindented = b:PHP_lastindented | |
3 0.000001 else | |
let real_PHP_lastindented = v:lnum | |
endif | |
10 0.000021 let b:PHP_lastindented = v:lnum | |
10 0.000008 if !b:InPHPcode_checked " {{{ One time check | |
7 0.000006 let b:InPHPcode_checked = 1 | |
7 0.000007 let b:UserIsTypingComment = 0 | |
7 0.000007 let synname = "" | |
7 0.000042 if cline !~ '<?.*?>' | |
7 0.002011 0.000059 let synname = IslinePHP (prevnonblank(v:lnum), "") | |
7 0.000003 endif | |
7 0.000007 if synname!="" | |
7 0.000008 if synname == "SpecStringEntrails" | |
let b:InPHPcode = -1 " thumb down | |
let b:InPHPcode_tofind = "" | |
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter" | |
7 0.000007 let b:InPHPcode = 1 | |
7 0.000008 let b:InPHPcode_tofind = "" | |
7 0.000056 if synname =~# '^php\%(Doc\)\?Comment' | |
let b:UserIsTypingComment = 1 | |
let b:InPHPcode_checked = 0 | |
endif | |
7 0.000021 if synname =~? '^javaScript' | |
let b:InPHPcode_and_script = 1 | |
endif | |
7 0.000003 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 | |
7 0.000003 else | |
let b:InPHPcode = 0 | |
let b:InPHPcode_tofind = s:PHP_startindenttag | |
endif | |
7 0.000004 endif "!b:InPHPcode_checked }}} | |
" Test if we are indenting PHP code {{{ | |
10 0.000022 let lnum = prevnonblank(v:lnum - 1) | |
10 0.000019 let last_line = getline(lnum) | |
10 0.000014 let endline= s:endline | |
10 0.000013 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 | |
10 0.000009 if 1 == b:InPHPcode | |
10 0.000097 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 | |
10 0.000005 endif " }}} | |
10 0.000023 if 1 > b:InPHPcode && !b:InPHPcode_and_script | |
return -1 | |
endif | |
" Indent successive // or # comment the same way the first is {{{ | |
10 0.000012 let addSpecial = 0 | |
10 0.000049 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 | |
10 0.000012 let b:PHP_LastIndentedWasComment = 0 | |
10 0.000005 endif " }}} | |
" Indent multiline /* comments correctly {{{ | |
10 0.000013 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 | |
10 0.000041 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) {{{ | |
10 0.000035 if cline =~# '^\s*<?' && cline !~ '?>' && b:PHP_outdentphpescape | |
return 0 | |
endif | |
10 0.000030 if cline =~ '^\s*?>' && cline !~# '<?' && b:PHP_outdentphpescape | |
return 0 | |
endif | |
10 0.000074 if cline =~? '^\s*\a\w*;$\|^\a\w*$\|^\s*[''"`][;,]' && cline !~? s:notPhpHereDoc | |
return 0 | |
endif " }}} | |
10 0.000035 let s:level = 0 | |
10 0.001277 0.000076 let lnum = GetLastRealCodeLNum(v:lnum - 1) | |
10 0.000019 let last_line = getline(lnum) | |
10 0.000019 let ind = indent(lnum) | |
10 0.000011 if ind==0 && b:PHP_default_indenting | |
let ind = b:PHP_default_indenting | |
endif | |
10 0.000007 if lnum == 0 | |
return b:PHP_default_indenting + addSpecial | |
endif | |
10 0.000041 if cline =~ '^\s*}\%(}}\)\@!' | |
3 0.001429 0.000023 let ind = indent(FindOpenBracket(v:lnum, 1)) | |
3 0.000005 let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
3 0.000002 return ind | |
endif | |
7 0.000019 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 | |
7 0.000090 if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase | |
5 0.000006 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 | |
5 0.000002 endif | |
7 0.000010 let LastLineClosed = 0 | |
7 0.000024 let terminated = s:terminated | |
7 0.000011 let unstated = s:unstated | |
7 0.000032 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 | |
5 0.000009 let previous_line = last_line | |
5 0.000006 let last_line_num = lnum | |
5 0.000005 let LastLineClosed = 1 | |
5 0.000009 let isSingleLineBlock = 0 | |
10 0.000007 while 1 | |
10 0.000101 if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX | |
5 0.000013 call cursor(last_line_num, 1) | |
5 0.000017 if previous_line !~ '^}' | |
5 0.000037 call search('}\|;\s*}'.endline, 'W') | |
5 0.000003 end | |
5 0.000007 let oldLastLine = last_line_num | |
5 0.001123 0.000597 let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()') | |
5 0.000030 if getline(last_line_num) =~ '^\s*{' | |
5 0.000682 0.000039 let last_line_num = GetLastRealCodeLNum(last_line_num - 1) | |
5 0.000005 elseif oldLastLine == last_line_num | |
let isSingleLineBlock = 1 | |
continue | |
endif | |
5 0.000011 let previous_line = getline(last_line_num) | |
5 0.000004 continue | |
else | |
5 0.000006 let isSingleLineBlock = 0 | |
5 0.000036 if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' | |
let last_line_num = FindTheIfOfAnElse(last_line_num, 0) | |
continue | |
endif | |
5 0.000007 let last_match = last_line_num | |
5 0.000011 let one_ahead_indent = indent(last_line_num) | |
5 0.001441 0.000025 let last_line_num = GetLastRealCodeLNum(last_line_num - 1) | |
5 0.000012 let two_ahead_indent = indent(last_line_num) | |
5 0.000008 let after_previous_line = previous_line | |
5 0.000009 let previous_line = getline(last_line_num) | |
5 0.000070 if previous_line =~# s:defaultORcase.'\|{'.endline | |
break | |
endif | |
5 0.000200 if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline | |
break | |
endif | |
5 0.000009 if one_ahead_indent == two_ahead_indent || last_line_num < 1 | |
5 0.000054 if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1 | |
5 0.000003 break | |
endif | |
endif | |
endif | |
endwhile | |
5 0.000010 if indent(last_match) != ind | |
let ind = indent(last_match) | |
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting | |
return ind + addSpecial | |
endif | |
5 0.000002 endif | |
7 0.000034 if (last_line !~ '^\s*}\%(}}\)\@!') | |
2 0.000194 0.000010 let plinnum = GetLastRealCodeLNum(lnum - 1) | |
2 0.000001 else | |
5 0.003687 0.000047 let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1) | |
5 0.000002 endif | |
7 0.000015 let AntepenultimateLine = getline(plinnum) | |
7 0.000085 let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','') | |
7 0.000009 if ind == b:PHP_default_indenting | |
if last_line =~ terminated && last_line !~# s:defaultORcase | |
let LastLineClosed = 1 | |
endif | |
endif | |
7 0.000006 if !LastLineClosed | |
2 0.000023 if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0 | |
2 0.000003 let dontIndent = 0 | |
2 0.000115 if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead | |
let dontIndent = 1 | |
endif | |
2 0.000004 if !dontIndent && (!b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{') | |
2 0.000004 let ind = ind + shiftwidth() | |
2 0.000001 endif | |
2 0.000003 if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 | |
let b:PHP_CurrentIndentLevel = ind | |
return ind + addSpecial | |
endif | |
2 0.000004 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 | |
2 0.000001 endif | |
7 0.000028 if cline =~ '^\s*[)\]];\=' | |
let ind = ind - shiftwidth() | |
endif | |
7 0.000009 let b:PHP_CurrentIndentLevel = ind | |
7 0.000008 return ind + addSpecial | |
FUNCTION ale#sign#GetSignCommands() | |
Called 74 times | |
Total time: 0.006605 | |
Self time: 0.006605 | |
count total (s) self (s) | |
74 0.000090 let l:command_list = [] | |
74 0.000103 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. | |
74 0.000190 if !l:is_dummy_sign_set && (!empty(a:sign_map) || g:ale_sign_column_always) | |
62 0.000263 call add(l:command_list, 'sign place ' . g:ale_sign_offset . ' line=1 name=ALEDummySign buffer=' . a:buffer) | |
62 0.000066 let l:is_dummy_sign_set = 1 | |
62 0.000028 endif | |
" Place new items first. | |
201 0.000445 for [l:line_str, l:info] in items(a:sign_map) | |
127 0.000097 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. | |
290 0.000250 for l:item in l:info.items | |
168 0.000236 let l:item.sign_id = l:info.new_id | |
168 0.000097 endfor | |
122 0.000240 if index(l:info.current_id_list, l:info.new_id) < 0 | |
5 0.000026 call add(l:command_list, 'sign place ' . (l:info.new_id) . ' line=' . l:line_str . ' name=' . (l:info.new_name) . ' buffer=' . a:buffer) | |
5 0.000003 endif | |
122 0.000052 endif | |
127 0.000065 endfor | |
" Remove signs without new IDs. | |
201 0.000267 for l:info in values(a:sign_map) | |
249 0.000225 for l:current_id in l:info.current_id_list | |
122 0.000133 if l:current_id isnot l:info.new_id | |
5 0.000017 call add(l:command_list, 'sign unplace ' . l:current_id . ' buffer=' . a:buffer) | |
5 0.000002 endif | |
122 0.000056 endfor | |
127 0.000063 endfor | |
" Remove the dummy sign to close the sign column if we need to. | |
74 0.000107 if l:is_dummy_sign_set && !g:ale_sign_column_always | |
62 0.000223 call add(l:command_list, 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer) | |
62 0.000028 endif | |
74 0.000065 return l:command_list | |
FUNCTION airline#util#prepend() | |
Called 2918 times | |
Total time: 0.014474 | |
Self time: 0.014474 | |
count total (s) self (s) | |
2918 0.004515 if a:minwidth > 0 && winwidth(0) < a:minwidth | |
return '' | |
endif | |
2918 0.006008 return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc | |
FUNCTION <SNR>85_GetCounts() | |
Called 2638 times | |
Total time: 0.035169 | |
Self time: 0.035020 | |
count total (s) self (s) | |
2638 0.008922 if !exists('g:ale_buffer_info') || !has_key(g:ale_buffer_info, a:buffer) | |
18 0.000211 0.000062 return s:CreateCountDict() | |
endif | |
" Cache is cold, so manually ask for an update. | |
2620 0.005957 if !has_key(g:ale_buffer_info[a:buffer], 'count') | |
call ale#statusline#Update(a:buffer, g:ale_buffer_info[a:buffer].loclist) | |
endif | |
2620 0.003526 return g:ale_buffer_info[a:buffer].count | |
FUNCTION airline#extensions#ale#get_warning() | |
Called 1448 times | |
Total time: 0.125625 | |
Self time: 0.009298 | |
count total (s) self (s) | |
1448 0.124984 0.008657 return airline#extensions#ale#get('warning') | |
FUNCTION ale#cursor#EchoCursorWarningWithDelay() | |
Called 6 times | |
Total time: 0.000591 | |
Self time: 0.000399 | |
count total (s) self (s) | |
6 0.000024 let l:buffer = bufnr('') | |
6 0.000010 if !g:ale_echo_cursor && !g:ale_cursor_detail | |
return | |
endif | |
" Only echo the warnings in normal mode, otherwise we will get problems. | |
6 0.000014 if mode(1) isnot# 'n' | |
return | |
endif | |
6 0.000135 0.000043 call s:StopCursorTimer() | |
6 0.000024 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. | |
6 0.000016 if l:pos != s:last_pos | |
6 0.000132 0.000032 let l:delay = ale#Var(l:buffer, 'echo_delay') | |
6 0.000065 let s:last_pos = l:pos | |
6 0.000069 let s:cursor_timer = timer_start( l:delay, function('ale#cursor#EchoCursorWarning')) | |
6 0.000019 endif | |
FUNCTION <SNR>120_UpdateLineNumbers() | |
Called 74 times | |
Total time: 0.003828 | |
Self time: 0.003828 | |
count total (s) self (s) | |
74 0.000130 let l:line_map = {} | |
74 0.000105 let l:line_numbers_changed = 0 | |
196 0.000294 for [l:line, l:sign_id, l:name] in a:current_sign_list | |
122 0.000245 let l:line_map[l:sign_id] = l:line | |
122 0.000072 endfor | |
242 0.000228 for l:item in a:loclist | |
168 0.000177 if l:item.bufnr == a:buffer | |
168 0.000541 let l:lnum = get(l:line_map, get(l:item, 'sign_id', 0), 0) | |
168 0.000204 if l:lnum && l:item.lnum != l:lnum | |
let l:item.lnum = l:lnum | |
let l:line_numbers_changed = 1 | |
endif | |
168 0.000068 endif | |
168 0.000096 endfor | |
" When the line numbers change, sort the list again | |
74 0.000067 if l:line_numbers_changed | |
call sort(a:loclist, 'ale#util#LocItemCompare') | |
endif | |
FUNCTION IslinePHP() | |
Called 7 times | |
Total time: 0.001952 | |
Self time: 0.001952 | |
count total (s) self (s) | |
7 0.000022 let cline = getline(a:lnum) | |
7 0.000009 if a:tofind=="" | |
7 0.000009 let tofind = "^\\s*[\"'`]*\\s*\\zs\\S" | |
7 0.000003 else | |
let tofind = a:tofind | |
endif | |
7 0.000013 let tofind = tofind . '\c' | |
7 0.000073 let coltotest = match (cline, tofind) + 1 | |
7 0.001666 let synname = synIDattr(synID(a:lnum, coltotest, 0), "name") | |
7 0.000022 if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick' | |
if cline !~ '^\s*[''"`]' | |
return "SpecStringEntrails" | |
else | |
return synname | |
end | |
end | |
7 0.000037 if get(s:SynPHPMatchGroups, synname) || synname =~ '^php' || synname =~? '^javaScript' | |
7 0.000006 return synname | |
else | |
return "" | |
endif | |
FUNCTION ale#sign#ReadSigns() | |
Called 74 times | |
Total time: 0.002038 | |
Self time: 0.002038 | |
count total (s) self (s) | |
74 0.000224 redir => l:output | |
74 0.001046 silent execute 'sign place buffer=' . a:buffer | |
74 0.000162 redir end | |
74 0.000431 return split(l:output, "\n") | |
FUNCTION ale#completion#HandleLSPResponse() | |
Called 2516 times | |
Total time: 0.056927 | |
Self time: 0.015649 | |
count total (s) self (s) | |
2516 0.049884 0.012449 if !s:CompletionStillValid(get(a:response, 'id')) | |
2448 0.001330 return | |
endif | |
68 0.004139 0.000296 call ale#completion#Show( a:response, 'ale#completion#ParseLSPCompletions',) | |
FUNCTION phpcomplete#FormatDocBlock() | |
Called 7 times | |
Total time: 0.000279 | |
Self time: 0.000279 | |
count total (s) self (s) | |
7 0.000008 let res = '' | |
7 0.000012 if len(a:info.description) | |
let res .= "Description:\n".join(map(split(a:info['description'], "\n"), '"\t".v:val'), "\n")."\n" | |
endif | |
7 0.000008 if len(a:info.params) | |
let res .= "\nArguments:\n" | |
for arginfo in a:info.params | |
let res .= "\t".arginfo['name'].' '.arginfo['type'] | |
if len(arginfo.description) > 0 | |
let res .= ': '.arginfo['description'] | |
endif | |
let res .= "\n" | |
endfor | |
endif | |
7 0.000011 if has_key(a:info.return, 'type') | |
let res .= "\nReturn:\n\t".a:info['return']['type'] | |
if len(a:info.return.description) > 0 | |
let res .= ": ".a:info['return']['description'] | |
endif | |
let res .= "\n" | |
endif | |
7 0.000008 if len(a:info.throws) | |
let res .= "\nThrows:\n" | |
for excinfo in a:info.throws | |
let res .= "\t".excinfo['type'] | |
if len(excinfo['description']) > 0 | |
let res .= ": ".excinfo['description'] | |
endif | |
let res .= "\n" | |
endfor | |
endif | |
7 0.000010 if has_key(a:info.var, 'type') | |
let res .= "Type:\n\t".a:info['var']['type']."\n" | |
if len(a:info['var']['description']) > 0 | |
let res .= ': '.a:info['var']['description'] | |
endif | |
endif | |
7 0.000006 return res | |
FUNCTION airline#builder#new() | |
Called 519 times | |
Total time: 0.011656 | |
Self time: 0.011656 | |
count total (s) self (s) | |
519 0.003030 let builder = copy(s:prototype) | |
519 0.000844 let builder._context = a:context | |
519 0.000667 let builder._sections = [] | |
519 0.005787 call extend(builder._context, { 'left_sep': g:airline_left_sep, 'left_alt_sep': g:airline_left_alt_sep, 'right_sep': g:airline_right_sep, 'right_alt_sep': g:airline_right_alt_sep, }, 'keep') | |
519 0.000442 return builder | |
FUNCTIONS SORTED ON TOTAL TIME | |
count total (s) self (s) function | |
130 7.821862 0.044970 phpcomplete#CompletePHP() | |
101 4.570509 0.409061 phpcomplete#GetCurrentNameSpace() | |
488 2.696310 0.016442 <SNR>19_on_window_changed() | |
311 2.679082 0.017450 airline#update_statusline() | |
519 2.645346 0.020063 <SNR>20_invoke_funcrefs() | |
19 2.631055 1.116123 phpcomplete#CompleteGeneral() | |
519 2.258594 0.267428 15() | |
35 1.722174 0.021010 phpcomplete#GetClassLocation() | |
323 1.596026 phpcomplete#GetTaglist() | |
2282 1.545116 0.023007 <SNR>79_get_seperator() | |
14830 1.483138 0.680103 airline#highlighter#get_highlight() | |
3256 1.378914 0.098159 <SNR>76_exec_separator() | |
369 1.364804 <SNR>47_Highlight_Matching_Pair() | |
2801 1.272395 0.069367 <SNR>79_get_transitioned_seperator() | |
2801 1.203029 0.035003 airline#highlighter#add_separator() | |
1980 0.996603 0.090017 <SNR>115_NeoVimCallback() | |
1954 0.791096 0.028827 ale#util#JoinNeovimOutput() | |
1902 0.761704 0.016988 <lambda>6() | |
1902 0.744716 0.130838 ale#lsp#HandleMessage() | |
29660 0.703564 <SNR>76_get_syn() | |
FUNCTIONS SORTED ON SELF TIME | |
count total (s) self (s) function | |
323 1.596026 phpcomplete#GetTaglist() | |
369 1.364804 <SNR>47_Highlight_Matching_Pair() | |
19 2.631055 1.116123 phpcomplete#CompleteGeneral() | |
29660 0.703564 <SNR>76_get_syn() | |
14830 1.483138 0.680103 airline#highlighter#get_highlight() | |
101 4.570509 0.409061 phpcomplete#GetCurrentNameSpace() | |
65 0.407640 phpcomplete#GetCurrentInstruction() | |
519 2.258594 0.267428 15() | |
74 0.265402 0.224143 ale#sign#SetSigns() | |
1902 0.208022 ale#lsp#ReadMessageData() | |
3794 0.702255 0.166518 airline#highlighter#exec() | |
3320 0.138265 <SNR>79_get_accented_line() | |
2896 0.254669 0.136769 airline#extensions#ale#get() | |
1902 0.744716 0.130838 ale#lsp#HandleMessage() | |
1459 0.518493 0.127202 airline#check_mode() | |
1448 0.137771 0.121930 airline#extensions#whitespace#check() | |
26 0.121542 ale#util#Writefile() | |
1439 0.119542 fugitive#Head() | |
4461 0.124985 0.113094 <SNR>80_get_section() | |
3794 0.100359 <SNR>76_CheckDefined() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment