Skip to content

Commit fa65fa9

Browse files
saranshsainiSaransh Saini
andauthored
specify chat and web ports (Exafunction#447)
* specify chat client and web server ports' * help docs --------- Co-authored-by: Saransh Saini <[email protected]>
1 parent fc5a68d commit fa65fa9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

autoload/codeium/server.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ endfunction
252252

253253
function! s:ActuallyStart() abort
254254
let config = get(g:, 'codeium_server_config', {})
255+
let chat_ports = get(g:, 'codeium_port_config', {})
255256
let manager_dir = tempname() . '/codeium/manager'
256257
call mkdir(manager_dir, 'p')
257258

@@ -266,6 +267,14 @@ function! s:ActuallyStart() abort
266267
let args += ['--enterprise_mode']
267268
let args += ['--portal_url', get(config, 'portal_url', 'https://codeium.example.com')]
268269
endif
270+
" If either of these is set, only one vim window (with any number of buffers) will work with Codeium.
271+
" Opening other vim windows won't be able to use Codeium features.
272+
if has_key(chat_ports, 'web_server') && !empty(chat_ports.web_server)
273+
let args += ['--chat_web_server_port', chat_ports.web_server]
274+
endif
275+
if has_key(chat_ports, 'chat_client') && !empty(chat_ports.chat_client)
276+
let args += ['--chat_client_port', chat_ports.chat_client]
277+
endif
269278

270279
call codeium#log#Info('Launching server with manager_dir ' . manager_dir)
271280
if has('nvim')

doc/codeium.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ g:codeium_arch Manually set the host architecture, accepted values
108108
>
109109
let g:codeium_arch = "x86_64"
110110
<
111+
*g:codeium_port_config*
112+
g:codeium_port_config
113+
Set the ports the chat client and web server use.
114+
Pass in web_server and chat_client fields to the mapping to set.
115+
Please note that if either of the ports are specified, only one
116+
window will work with codeium.
117+
That window can have as many buffers within it, but any other
118+
opened windows will not be able to use Codeium's features.
119+
>
120+
let g:codeium_port_config = {
121+
'web_server': <Your web server port>,
122+
'chat_client': <Your chat client port>
123+
}
124+
<
125+
111126
*g:codeium_virtual_text_priority*
112127
g:codeium_virtual_text_priority
113128
The priority used for Codeium's virtual text completions

0 commit comments

Comments
 (0)