Skip to content

Commit 2a655ab

Browse files
authored
Add support for enterprise chat (Exafunction#345)
1 parent bbd6e6f commit 2a655ab

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

autoload/codeium.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,15 @@ function! s:LaunchChat(out, err, status) abort
398398
let l:processes = json_decode(join(a:out, ''))
399399
let l:chat_port = l:processes['chatClientPort']
400400
let l:ws_port = l:processes['chatWebServerPort']
401+
402+
let config = get(g:, 'codeium_server_config', {})
403+
let l:has_enterprise_extension = "false"
404+
if has_key(config, 'api_url') && !empty(config.api_url)
405+
let l:has_enterprise_extension = "true"
406+
endif
407+
401408
" Hard-coded to English locale and allowed telemetry.
402-
" Not touching has_enterprise_extension
403-
let l:url = 'http://127.0.0.1:' . l:chat_port . '/?' . 'api_key=' . l:metadata.api_key . '&ide_name=' . l:metadata.ide_name . '&ide_version=' . l:metadata.ide_version . '&extension_name=' . l:metadata.extension_name . '&extension_version=' . l:metadata.extension_version . '&web_server_url=ws://127.0.0.1:' . l:ws_port . '&app_name=Vim&locale=en&ide_telemetry_enabled=true&has_index_service=true'
409+
let l:url = 'http://127.0.0.1:' . l:chat_port . '/?' . 'api_key=' . l:metadata.api_key . '&ide_name=' . l:metadata.ide_name . '&ide_version=' . l:metadata.ide_version . '&extension_name=' . l:metadata.extension_name . '&extension_version=' . l:metadata.extension_version . '&web_server_url=ws://127.0.0.1:' . l:ws_port . '&has_enterprise_extension=' . l:has_enterprise_extension . '&app_name=Vim&locale=en&ide_telemetry_enabled=true&has_index_service=true'
404410
let l:browser = codeium#command#BrowserCommand()
405411
let opened_browser = v:false
406412
if !empty(browser)

0 commit comments

Comments
 (0)