Skip to content

Commit

Permalink
specify chat and web ports (#447)
Browse files Browse the repository at this point in the history
* specify chat client and web server ports'

* help docs

---------

Co-authored-by: Saransh Saini <[email protected]>
  • Loading branch information
saranshsaini and Saransh Saini authored Sep 12, 2024
1 parent fc5a68d commit fa65fa9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions autoload/codeium/server.vim
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ endfunction

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

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

call codeium#log#Info('Launching server with manager_dir ' . manager_dir)
if has('nvim')
Expand Down
15 changes: 15 additions & 0 deletions doc/codeium.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ g:codeium_arch Manually set the host architecture, accepted values
>
let g:codeium_arch = "x86_64"
<
*g:codeium_port_config*
g:codeium_port_config
Set the ports the chat client and web server use.
Pass in web_server and chat_client fields to the mapping to set.
Please note that if either of the ports are specified, only one
window will work with codeium.
That window can have as many buffers within it, but any other
opened windows will not be able to use Codeium's features.
>
let g:codeium_port_config = {
'web_server': <Your web server port>,
'chat_client': <Your chat client port>
}
<

*g:codeium_virtual_text_priority*
g:codeium_virtual_text_priority
The priority used for Codeium's virtual text completions
Expand Down

0 comments on commit fa65fa9

Please sign in to comment.