Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
3.72k stars 127 forks source link

The executable never gets extracted on windows #32

Closed TheLeoP closed 1 year ago

TheLeoP commented 1 year ago

The following code for downloading and extracting the executable (located in server.vim) does not work on windows since it doesn't have gzip nor chmod

  if empty(glob(bin))
    let url = 'https://github.com/Exafunction/codeium/releases/download/language-server-v' . s:language_server_version . '/language_server_' . bin_suffix . '.gz'
    call system('curl -Lo ' . bin . '.gz' . ' ' . url)
    call system('gzip -d ' . bin . '.gz')
    call system('chmod +x ' . bin)
    if empty(glob(bin))
      call codeium#log#Error('Failed to download language server binary.')
      return ''
    endif
  endif
pqn commented 1 year ago

IIRC there's no executable attribute on Windows, so we can probably skip chmod +x on Windows?

It looks like there is probably a way to use PowerShell to replace gzip -d: https://scatteredcode.net/download-and-extract-gzip-tar-with-powershell/

I'd welcome a pull request if you wanted to try these out.