Skip to content

Commit eb59013

Browse files
committed
Merge branch 'feature/filetypes-disabled-by-default' of https://github.com/MissLov3ly/codeium.vim into feature/filetypes-disabled-by-default
2 parents 576685f + c6fa5bb commit eb59013

2 files changed

Lines changed: 8 additions & 39 deletions

File tree

autoload/codeium/server.vim

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
let s:language_server_version = '1.6.28'
2-
let s:language_server_sha = 'f485965568948013d9f47815917f2f1f3a99089d'
1+
let s:language_server_version = '1.2.104'
2+
let s:language_server_sha = 'ab59278dfa738977096f6bfc2299d9941fcc3252'
33
let s:root = expand('<sfile>:h:h:h')
44
let s:bin = v:null
55

@@ -31,7 +31,7 @@ function! s:OnExit(result, status, on_complete_cb) abort
3131
let did_close = has_key(a:result, 'closed')
3232
if did_close
3333
call remove(a:result, 'closed')
34-
call a:on_complete_cb(a:result.out, a:result.err, a:status)
34+
call a:on_complete_cb(a:result.out, a:status)
3535
else
3636
" Wait until we receive OnClose, and call on_complete_cb then.
3737
let a:result.exit_status = a:status
@@ -41,7 +41,7 @@ endfunction
4141
function! s:OnClose(result, on_complete_cb) abort
4242
let did_exit = has_key(a:result, 'exit_status')
4343
if did_exit
44-
call a:on_complete_cb(a:result.out, a:result.err, a:result.exit_status)
44+
call a:on_complete_cb(a:result.out, a:result.exit_status)
4545
else
4646
" Wait until we receive OnExit, and call on_complete_cb then.
4747
let a:result.closed = v:true
@@ -65,21 +65,20 @@ function! codeium#server#Request(type, data, ...) abort
6565
if s:server_port is# v:null
6666
throw 'Server port has not been properly initialized.'
6767
endif
68-
let uri = 'http://127.0.0.1:' . s:server_port .
68+
let uri = 'http://localhost:' . s:server_port .
6969
\ '/exa.language_server_pb.LanguageServerService/' . a:type
7070
let data = json_encode(a:data)
7171
let args = [
7272
\ 'curl', uri,
7373
\ '--header', 'Content-Type: application/json',
7474
\ '-d@-'
7575
\ ]
76-
let result = {'out': [], 'err': []}
76+
let result = {'out': []}
7777
let ExitCallback = a:0 && !empty(a:1) ? a:1 : function('s:NoopCallback')
7878
if has('nvim')
7979
let jobid = jobstart(args, {
8080
\ 'on_stdout': { channel, data, t -> add(result.out, join(data, "\n")) },
81-
\ 'on_stderr': { channel, data, t -> add(result.err, join(data, "\n")) },
82-
\ 'on_exit': { job, status, t -> ExitCallback(result.out, result.err, status) },
81+
\ 'on_exit': { job, status, t -> ExitCallback(result.out, status) },
8382
\ })
8483
call chansend(jobid, data)
8584
call chanclose(jobid, 'stdin')
@@ -89,7 +88,6 @@ function! codeium#server#Request(type, data, ...) abort
8988
\ 'in_mode': 'raw',
9089
\ 'out_mode': 'raw',
9190
\ 'out_cb': { channel, data -> add(result.out, data) },
92-
\ 'err_cb': { channel, data -> add(result.err, data) },
9391
\ 'exit_cb': { job, status -> s:OnExit(result, status, ExitCallback) },
9492
\ 'close_cb': { channel -> s:OnClose(result, ExitCallback) }
9593
\ })
@@ -122,14 +120,6 @@ function! s:SendHeartbeat(timer) abort
122120
endfunction
123121

124122
function! codeium#server#Start(...) abort
125-
let user_defined_codeium_bin = get(g:, 'codeium_bin', '')
126-
127-
if user_defined_codeium_bin != '' && filereadable(user_defined_codeium_bin)
128-
let s:bin = user_defined_codeium_bin
129-
call s:ActuallyStart()
130-
return
131-
endif
132-
133123
silent let os = substitute(system('uname'), '\n', '', '')
134124
silent let arch = substitute(system('uname -m'), '\n', '', '')
135125
let is_arm = stridx(arch, 'arm') == 0 || stridx(arch, 'aarch64') == 0
@@ -154,14 +144,7 @@ function! codeium#server#Start(...) abort
154144
if !filereadable(s:bin)
155145
call delete(s:bin)
156146
if sha ==# s:language_server_sha
157-
let config = get(g:, 'codeium_server_config', {})
158-
if has_key(config, 'portal_url') && !empty(config.portal_url)
159-
let base_url = config.portal_url
160-
else
161-
let base_url = 'https://github.com/Exafunction/codeium/releases/download'
162-
endif
163-
let base_url = substitute(base_url, '/\+$', '', '')
164-
let url = base_url . '/language-server-v' . s:language_server_version . '/language_server_' . bin_suffix . '.gz'
147+
let url = 'https://github.com/Exafunction/codeium/releases/download/language-server-v' . s:language_server_version . '/language_server_' . bin_suffix . '.gz'
165148
else
166149
let url = 'https://storage.googleapis.com/exafunction-dist/codeium/' . sha . '/language_server_' . bin_suffix . '.gz'
167150
endif

doc/codeium.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ COMMANDS *:Codeium*
2626
:Codeium EnableBuffer Re-enable Codeium completions in the current
2727
buffer after running :Codeium DisableBuffer
2828

29-
*:Codeium_Toggle*
30-
:Codeium Toggle Enable Codeium completions if they are disabled.
31-
Disable Codeium completions if they are enabled. Does
32-
NOT enable completions for current buffer, if they are
33-
disabled with :Codeium DisableBuffer. However, still
34-
affects other buffers.
3529

3630
OPTIONS *codeium-options*
3731

@@ -86,14 +80,6 @@ g:codeium_tab_fallback The fallback key when there is no suggestion display
8680
>
8781
let g:codeium_tab_fallback = "\t"
8882
<
89-
*g:codeium_bin*
90-
g:codeium_bin Manually set the path to the `codeium` language server
91-
binary on your system.
92-
If unset, `codeium.vim` will fetch and download the
93-
binary from the internet.
94-
>
95-
let g:codeium_bin = "~/.local/bin/codeium_language_server"
96-
<
9783

9884
MAPS *codeium-maps*
9985

0 commit comments

Comments
 (0)