Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
Prototype for functions in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdevries committed Nov 23, 2016
1 parent afacd8d commit c92a91e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions autoload/langserver/default.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ function! langserver#default#cmd() abort
let l:bad_cmd = [-1]

if has_key(g:langserver_executables, &filetype)
let l:tmp_cmd = g:langserver_executables[&filetype]['cmd']

if type(l:tmp_cmd) != type([])
echoerr 'Make sure your dictionary is structued like: {"filetype": {"cmd": [cmd, list, here]}}'
return l:bad_cmd
endif
let l:tmp_cmd = g:langserver_executables[&filetype]['cmd']

if type(l:tmp_cmd) == type([])
return l:tmp_cmd
return
else
return l:bad_cmd
elseif type(l:tmp_cmd) == type(function('tr'))
let l:result = l:tmp_cmd()
if type(l:result) == type([])
return l:result
endif
endif
endif

" If we didn't return anything, there was an error.
echoerr 'Please consult the documentation for how to configure the langserver'
return l:bad_cmd
endfunction

0 comments on commit c92a91e

Please sign in to comment.