Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to override language server's download url. #106

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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