Skip to content

Commit

Permalink
Add ability to override language server's download url. (#106)
Browse files Browse the repository at this point in the history
* Update config.lua

Add `override_download_url` to `config`.

* Update update.lua

Add `override_download_url`.

* Change override_download_url to language_server_download_url

* Change override_download_url to language_server_download_url
  • Loading branch information
lll9p authored Oct 11, 2023
1 parent d9b0260 commit 822e762
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions lua/codeium/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function M.defaults()
manager_path = nil,
bin_path = vim.fn.stdpath("cache") .. "/codeium/bin",
config_path = vim.fn.stdpath("cache") .. "/codeium/config.json",
language_server_download_url = "https://github.com",
api = {
host = "server.codeium.com",
port = "443",
Expand Down
10 changes: 8 additions & 2 deletions lua/codeium/update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local notify = require("codeium.notify")
local M = {}

local cached = nil
local language_server_download_url = "https://github.com"
function M.get_bin_info()
if cached then
return cached
Expand All @@ -16,7 +17,11 @@ function M.get_bin_info()
}
return cached
end


if config.options.language_server_download_url then
language_server_download_url = config.options.language_server_download_url
end

local os_info = io.get_system_info()
local dir = config.options.bin_path .. "/" .. versions.extension
local bin_sufix
Expand All @@ -32,7 +37,8 @@ function M.get_bin_info()
dir = dir,
bin_sufix = bin_sufix,
bin = dir .. "/" .. "language_server_" .. bin_sufix,
download_url = "https://github.com/Exafunction/codeium/releases/download/language-server-v"
download_url = language_server_download_url
.. "/Exafunction/codeium/releases/download/language-server-v"
.. versions.extension
.. "/language_server_"
.. bin_sufix
Expand Down

0 comments on commit 822e762

Please sign in to comment.