Skip to content

Commit

Permalink
Accept 'preview' as an install parameter.
Browse files Browse the repository at this point in the history
Testing type of parameter to make sure string is tested as string and
dict as dict. Type information can be found with `:help type`
  • Loading branch information
corbob committed Apr 28, 2019
1 parent 307e00f commit 1008959
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions autoload/coc/powershell.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ let s:is_vim = !has('nvim')
let s:install_script = s:root.'/install.ps1'

function! coc#powershell#install(...)
if(exists('a:1.preview') && a:1.preview)
let s:flags = '-AllowPreRelease'
else
let s:flags = ''
let s:flags = ''
if(exists('a:1'))
let paramType = type(a:1)
" Type 1 seems to be a string...
if(paramType == 1)
if(a:1 == 'preview')
let s:flags = '-AllowPreRelease'
endif
" Type 4 is a dictionary...
elseif(s:paramType == 4)
if(exists('a:1.preview') && a:1.preview)
let s:flags = '-AllowPreRelease'
endif
endif
endif
let s:powershell_executable = ''
let s:powershell_executable = 'pwsh'
if(exists('a:1.powershellExecutable'))
let s:powershell_executable = a:1.powershellExecutable
else
let s:powershell_executable = 'pwsh'
if(s:is_win)
let s:powershell_executable = "powershell"
if(executable("pwsh"))
Expand Down

0 comments on commit 1008959

Please sign in to comment.