Skip to content

Commit ac42b18

Browse files
committed
refactor: cleanup some messages and type declarations
1 parent b95c20b commit ac42b18

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lua/copilot/client.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function M.buf_detach()
7777
end
7878
end
7979

80+
---@return nil|vim.lsp.Client
8081
function M.get()
8182
return vim.lsp.get_client_by_id(M.id)
8283
end
@@ -170,7 +171,7 @@ end
170171

171172
local function prepare_client_config(overrides)
172173
if lsp_binary_util.initialization_failed then
173-
M.startup_error = "initializatino of copilot-language-server failed"
174+
M.startup_error = "initialization of copilot-language-server failed"
174175
return
175176
end
176177

@@ -297,7 +298,7 @@ end
297298

298299
function M.setup()
299300
M.config = prepare_client_config(config.get("server_opts_overrides"))
300-
M.should_attach = config.get("should_attach") --[[@as copilot_should_attach|nil]]
301+
M.should_attach = config.get("should_attach") --[[@as copilot_should_attach]]
301302

302303
if not M.config then
303304
is_disabled = true

lua/copilot/lsp_binary.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ local function download_file(url, local_server_zip_filepath, local_server_zip_pa
5959
logger.notify("current version of copilot-language-server is not downloaded, downloading")
6060

6161
if vim.fn.executable("curl") ~= 1 then
62-
vim.api.nvim_err_writeln("Error: curl is not available")
62+
logger.error("curl is not available, please install it to download copilot-language-server")
6363
M.initialization_failed = true
6464
return false
6565
end
@@ -165,7 +165,7 @@ function M.ensure_client_is_downloaded()
165165

166166
local copilot_version = util.get_editor_info().editorPluginInfo.version
167167
local plugin_path = vim.fs.normalize(util.get_plugin_path())
168-
local copilot_server_info = M.get_copilot_server_info(copilot_version, plugin_path)
168+
local copilot_server_info = M.get_copilot_server_info()
169169
local download_filename =
170170
string.format("copilot-language-server-%s-%s.zip", copilot_server_info.path, copilot_version)
171171
local url = string.format(
@@ -199,7 +199,7 @@ function M.ensure_client_is_downloaded()
199199
end
200200

201201
delete_all_except(copilot_server_info.absolute_path, copilot_server_info.filename)
202-
logger.notify("copilot-language-server downloaded")
202+
logger.notify(string.format("copilot-language-server v%s downloaded", copilot_version))
203203
return true
204204
end
205205

0 commit comments

Comments
 (0)