fix lint issues and enable linting for autoload folder (#224)

This commit is contained in:
Prabir Shrestha
2018-12-27 23:03:49 -08:00
committed by GitHub
parent 2db2c45de6
commit 74ad1e1c0d
6 changed files with 16 additions and 16 deletions

View File

@@ -28,4 +28,4 @@ before_script:
- vim --version
script:
- vint plugin ftplugin
- vint autoload ftplugin plugin

View File

@@ -65,22 +65,22 @@ endfunction
function! s:server_status(server_name) abort
if !has_key(s:servers, a:server_name)
return "unknown server"
return 'unknown server'
endif
let l:server = s:servers[a:server_name]
if has_key(l:server, 'exited')
return "exited"
return 'exited'
endif
if has_key(l:server, 'init_callbacks')
return "starting"
return 'starting'
endif
if has_key(l:server, 'failed')
return "failed"
return 'failed'
endif
if has_key(l:server, 'init_result')
return "running"
return 'running'
endif
return "not running"
return 'not running'
endfunction
" Returns the current status of all servers (if called with no arguments) or

View File

@@ -162,10 +162,10 @@ function! lsp#omni#get_vim_completion_item(item) abort
let l:abbr = a:item['label']
endif
let l:menu = lsp#omni#get_kind_text(a:item)
let l:completion = { 'word': l:word, 'abbr': l:abbr, 'menu': l:menu, 'info': "", 'icase': 1, 'dup': 1 }
let l:completion = { 'word': l:word, 'abbr': l:abbr, 'menu': l:menu, 'info': '', 'icase': 1, 'dup': 1 }
if has_key(a:item, 'detail')
let l:completion['info'] .= a:item['detail'] . " "
let l:completion['info'] .= a:item['detail'] . ' '
endif
if has_key(a:item, 'documentation')

View File

@@ -1,4 +1,4 @@
function! lsp#ui#vim#diagnostics#echo#cursor_moved()
function! lsp#ui#vim#diagnostics#echo#cursor_moved() abort
if !g:lsp_diagnostics_echo_cursor
return
endif

View File

@@ -44,6 +44,6 @@ function! s:append(data) abort
elseif type(a:data) == type({}) && has_key(a:data, 'kind')
silent put =a:data.value
return a:data.kind == 'plaintext' ? 'text' : a:data.kind
return a:data.kind ==? 'plaintext' ? 'text' : a:data.kind
endif
endfunction

View File

@@ -56,7 +56,7 @@ function! lsp#ui#vim#signs#next_error() abort
let l:view.lnum = l:next_line
let l:view.topline = 1
let l:height = winheight(0)
let totalnum = line("$")
let totalnum = line('$')
if totalnum > l:height
let l:half = l:height / 2
if l:totalnum - l:half < l:view.lnum
@@ -91,7 +91,7 @@ function! lsp#ui#vim#signs#previous_error() abort
let l:view.lnum = l:next_line
let l:view.topline = 1
let l:height = winheight(0)
let totalnum = line("$")
let totalnum = line('$')
if totalnum > l:height
let l:half = l:height / 2
if l:totalnum - l:half < l:view.lnum
@@ -178,7 +178,7 @@ function! s:clear_signs(server_name, path) abort
endif
for l:id in s:signs[a:server_name][a:path]
execute ":sign unplace " . l:id . " file=" . a:path
execute ':sign unplace ' . l:id . ' file=' . a:path
endfor
let s:signs[a:server_name][a:path] = []
@@ -194,12 +194,12 @@ function! s:place_signs(server_name, path, diagnostics) abort
let l:name = 'LspError'
if has_key(l:item, 'severity') && !empty(l:item['severity'])
let l:name = get(s:severity_sign_names_mapping, l:item['severity'], 'LspError')
execute ":sign place " . g:lsp_next_sign_id . " name=" . l:name . " line=" . l:line . " file=" . a:path
execute ':sign place ' . g:lsp_next_sign_id . ' name=' . l:name . ' line=' . l:line . ' file=' . a:path
call add(s:signs[a:server_name][a:path], g:lsp_next_sign_id)
call lsp#log('add signs')
let g:lsp_next_sign_id += 1
if l:name == 'LspError'
if l:name ==? 'LspError'
call add(s:err_loc, l:line)
endif
let s:err_loc = sort(s:err_loc)