From 4bd8238101c1bbc6b3f107a93ff0c5886e90e5d0 Mon Sep 17 00:00:00 2001 From: Leonardo Mora Date: Sat, 14 Sep 2024 19:03:57 -0600 Subject: [PATCH 1/4] fix(server): pass enterprise args correctly to language server --- lua/neocodeium/server.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/neocodeium/server.lua b/lua/neocodeium/server.lua index 6e71aac..df57a50 100644 --- a/lua/neocodeium/server.lua +++ b/lua/neocodeium/server.lua @@ -69,11 +69,20 @@ function Server:start() local args = { "--api_server_url", - api_url and api_url .. " --enterprise_mode" or "https://server.codeium.com", + api_url or "https://server.codeium.com", "--manager_dir", manager_dir, } + if options.server.api_url and options.server.api_url ~= "" then + table.insert(args, "--enterprise_mode") + end + + if options.server.portal_url and options.server.portal_url ~= "" then + table.insert(args, "--portal_url") + table.insert(args, options.server.portal_url) + end + if self.chat_enabled then table.insert(args, "--enable_local_search") table.insert(args, "--enable_index_service") From b52445dbf9a38df2e222006901174c9b059be669 Mon Sep 17 00:00:00 2001 From: Leonardo Mora Date: Sat, 14 Sep 2024 19:26:06 -0600 Subject: [PATCH 2/4] fix(binary): typo --- lua/neocodeium/binary.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neocodeium/binary.lua b/lua/neocodeium/binary.lua index 850c63c..a576425 100644 --- a/lua/neocodeium/binary.lua +++ b/lua/neocodeium/binary.lua @@ -93,7 +93,7 @@ function Bin:download(callback) ) end ----Expands langauge server binary from compressed file. +---Expands language server binary from compressed file. ---Returns `true` on success and `false` on failure. ---@return boolean function Bin:expand() From 9f7563fde8d153c7850150ac0897f6d874001e1b Mon Sep 17 00:00:00 2001 From: Leonardo Mora Date: Sat, 14 Sep 2024 21:39:14 -0600 Subject: [PATCH 3/4] fix(binary): fixes #35 Fallback to the GitHub url if the url formed with the given portal is not valid. --- lua/neocodeium/binary.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/neocodeium/binary.lua b/lua/neocodeium/binary.lua index a576425..1cc40c7 100644 --- a/lua/neocodeium/binary.lua +++ b/lua/neocodeium/binary.lua @@ -66,9 +66,6 @@ end ---@param callback fun() function Bin:download(callback) local base_url = "https://github.com/Exafunction/codeium/releases/download" - if options.server.portal_url then - base_url = options.server.portal_url:gsub("/$", "") - end ---@type url local url = string.format( "%s/language-server-v%s/language_server_%s.gz", From d651f46975d9d59174e95609ddf94a34ca6ddad4 Mon Sep 17 00:00:00 2001 From: Leonardo Mora Date: Sun, 15 Sep 2024 23:46:26 -0600 Subject: [PATCH 4/4] docs: added instructions for codeium enterprise users --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 00f00f3..d4180b9 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,21 @@ a different plugin manager, please refer to its documentation for installation i Now you can use `Alt-f` in insert mode to accept codeium suggestions. +Enterprise users: you should receive portal and API URLs for Codeium from your company. +Once you get them, add them to your config. This way `:NeoCodeium auth` will authenticate you on the right portal. For example, + +````lua +{ + "monkoose/neocodeium", + event = "VeryLazy", + opts = { + server = { + api_url = 'https://codeium.company.net/_route/api_server', + portal_url = 'https://codeium.company.net', + }, + } +} + **Note:** To obtain an API token, you’ll need to run `:NeoCodeium auth`. On Windows WSL `wslview` `(sudo apt install wslu)` should be installed to properly open the browser.