From 85f195f8124c7ca8894326b6667f81dae75c15bc Mon Sep 17 00:00:00 2001 From: Rahul Sridhar Date: Thu, 8 Feb 2024 21:33:32 +0000 Subject: [PATCH] Revert "feat: Add enterprise mode support (#141)" This reverts commit 42f9f19d2423ed88f26f97c963dade2f4be462c7. --- README.md | 6 ------ lua/codeium/api.lua | 44 +++++------------------------------------- lua/codeium/config.lua | 4 ---- lua/codeium/log.lua | 2 +- 4 files changed, 6 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 166f328..1d0e196 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,6 @@ your browser and pasting it into API token request. - `api`: information about the API server to use: - `host`: the hostname - `port`: the port - - `path`: the path prefix to the API server - - `portal_url`: the portal URL to use (for enterprise mode) -- `enterprise_mode`: enable enterprise mode -- `detect_proxy`: enable or disable proxy detection - `tools`: paths to binaries used by the plugin: - `uname`: not needed on Windows, defaults given. @@ -105,8 +101,6 @@ cmp.setup({ }) ``` -If you are seeing the `codeium` source as unused in `:CmpStatus`, make sure that `nvim-cmp` setup happens before the `codeium.nvim` setup. - To set a symbol for codeium using lspkind, use the `Codeium` keyword. Example: ```lua diff --git a/lua/codeium/api.lua b/lua/codeium/api.lua index 13bc340..b12d5dd 100644 --- a/lua/codeium/api.lua +++ b/lua/codeium/api.lua @@ -67,11 +67,7 @@ end function Server.authenticate() local attempts = 0 local uuid = io.generate_uuid() - local url = "https://" - .. config.api.host - .. ":" - .. config.api.port - .. "/profile?response_type=token&redirect_uri=vim-show-auth-token&state=" + local url = "https://www.codeium.com/profile?response_type=token&redirect_uri=vim-show-auth-token&state=" .. uuid .. "&scope=openid%20profile%20email&redirect_parameters_type=query" @@ -81,17 +77,7 @@ function Server.authenticate() return end - local endpoint = "https://api.codeium.com/register_user/" - - if config.options.enterprise_mode then - endpoint = "https://" .. config.options.api.host .. ":" .. config.options.api.port - if config.options.api.path then - endpoint = endpoint .. "/" .. config.options.api.path:gsub("^/", "") - end - endpoint = endpoint .. "/exa.seat_management_pb.SeatManagementService/RegisterUser" - end - - io.post(endpoint, { + io.post("https://api.codeium.com/register_user/", { headers = { accept = "application/json", }, @@ -210,13 +196,8 @@ function Server:new() log.debug(j.pid .. ": " .. v) end - local api_server_url = "https://" - .. config.options.api.host - .. ":" - .. config.options.api.port - .. (config.options.api.path and "/" .. config.options.api.path:gsub("^/", "") or "") - - local job_args = { + local api_server_url = "https://" .. config.options.api.host .. ":" .. config.options.api.port + job = io.job({ update.get_bin_info().bin, "--api_server_url", api_server_url, @@ -227,22 +208,7 @@ function Server:new() on_exit = on_exit, on_stdout = on_output, on_stderr = on_output, - } - - if config.options.api.portal_url then - table.insert(job_args, "--portal_url") - table.insert(job_args, config.options.api.portal_url) - end - - if config.options.enterprise_mode then - table.insert(job_args, "--enterprise_mode") - end - - if config.options.detect_proxy ~= nil then - table.insert(job_args, "--detect_proxy=" .. tostring(config.options.detect_proxy)) - end - - local job = io.job(job_args) + }) job:start() local function start_heartbeat() diff --git a/lua/codeium/config.lua b/lua/codeium/config.lua index 22dcb29..43ac368 100644 --- a/lua/codeium/config.lua +++ b/lua/codeium/config.lua @@ -9,11 +9,7 @@ function M.defaults() api = { host = "server.codeium.com", port = "443", - path = "/", - portal_url = nil, }, - enterprise_mode = nil, - detect_proxy = nil, tools = {}, wrapper = nil, } diff --git a/lua/codeium/log.lua b/lua/codeium/log.lua index 740daf8..7f836aa 100644 --- a/lua/codeium/log.lua +++ b/lua/codeium/log.lua @@ -1,6 +1,6 @@ local p_debug = vim.env.DEBUG_CODEIUM return require("plenary.log").new({ - plugin = "codeium/codeium.log", + plugin = "codeium", level = p_debug or "info", })