diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-03-31 17:52:49 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-03-31 17:52:49 +0300 |
commit | 7217c7749e5403c9c7856c1d12c7986eb9c3b460 (patch) | |
tree | d60a112d9119a51af1cf5f590c5efad81751edf6 /dotfiles/.vim/autoload/airline/extensions/languageclient.vim | |
parent | 9a3aa7b20a67c1b7991da1da9508ad5f78f76352 (diff) | |
download | vimrice-7217c7749e5403c9c7856c1d12c7986eb9c3b460.tar.gz vimrice-7217c7749e5403c9c7856c1d12c7986eb9c3b460.zip |
Goodbye vim, been using neovim for ages now; home directory cleanup
Diffstat (limited to 'dotfiles/.vim/autoload/airline/extensions/languageclient.vim')
-rw-r--r-- | dotfiles/.vim/autoload/airline/extensions/languageclient.vim | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/dotfiles/.vim/autoload/airline/extensions/languageclient.vim b/dotfiles/.vim/autoload/airline/extensions/languageclient.vim deleted file mode 100644 index 82fed28..0000000 --- a/dotfiles/.vim/autoload/airline/extensions/languageclient.vim +++ /dev/null @@ -1,101 +0,0 @@ -" MIT License. Copyright (c) 2013-2018 Bjorn Neergaard, w0rp, hallettj et al. -" vim: et ts=2 sts=2 sw=2 - -scriptencoding utf-8 - -let s:error_symbol = get(g:, 'airline#extensions#languageclient#error_symbol', 'E:') -let s:warning_symbol = get(g:, 'airline#extensions#languageclient#warning_symbol', 'W:') -let s:show_line_numbers = get(g:, 'airline#extensions#languageclient#show_line_numbers', 1) - -" Severity codes from the LSP spec -let s:severity_error = 1 -let s:severity_warning = 2 -let s:severity_info = 3 -let s:severity_hint = 4 - -" After each LanguageClient state change `s:diagnostics` will be populated with -" a map from file names to lists of errors, warnings, informational messages, -" and hints. -let s:diagnostics = {} - -function! s:languageclient_refresh() - if get(g:, 'airline_skip_empty_sections', 0) - exe ':AirlineRefresh' - endif -endfunction - -function! s:record_diagnostics(state) - let result = json_decode(a:state.result) - let s:diagnostics = result.diagnostics - call s:languageclient_refresh() -endfunction - -function! s:get_diagnostics() - call LanguageClient#getState(function("s:record_diagnostics")) -endfunction - -function! s:diagnostics_for_buffer() - return get(s:diagnostics, expand('%:p'), []) -endfunction - -function! s:airline_languageclient_count(cnt, symbol) - return a:cnt ? a:symbol. a:cnt : '' -endfunction - -function! s:airline_languageclient_get_line_number(type) abort - let linenumber_of_first_problem = 0 - for d in s:diagnostics_for_buffer() - if has_key(d, 'severity') && d.severity == a:type - let linenumber_of_first_problem = d.range.start.line - break - endif - endfor - - if linenumber_of_first_problem == 0 - return '' - endif - - let open_lnum_symbol = get(g:, 'airline#extensions#languageclient#open_lnum_symbol', '(L') - let close_lnum_symbol = get(g:, 'airline#extensions#languageclient#close_lnum_symbol', ')') - - return open_lnum_symbol . linenumber_of_first_problem . close_lnum_symbol -endfunction - -function! airline#extensions#languageclient#get(type) - let is_err = a:type == s:severity_error - let symbol = is_err ? s:error_symbol : s:warning_symbol - - let cnt = 0 - for d in s:diagnostics_for_buffer() - if has_key(d, 'severity') && d.severity == a:type - let cnt += 1 - endif - endfor - - if cnt == 0 - return '' - endif - - if s:show_line_numbers == 1 - return s:airline_languageclient_count(cnt, symbol) . <sid>airline_languageclient_get_line_number(a:type) - else - return s:airline_languageclient_count(cnt, symbol) - endif -endfunction - -function! airline#extensions#languageclient#get_warning() - return airline#extensions#languageclient#get(s:severity_warning) -endfunction - -function! airline#extensions#languageclient#get_error() - return airline#extensions#languageclient#get(s:severity_error) -endfunction - -function! airline#extensions#languageclient#init(ext) - call airline#parts#define_function('languageclient_error_count', 'airline#extensions#languageclient#get_error') - call airline#parts#define_function('languageclient_warning_count', 'airline#extensions#languageclient#get_warning') - augroup airline_languageclient - autocmd! - autocmd User LanguageClientDiagnosticsChanged call <sid>get_diagnostics() - augroup END -endfunction |