Skip to content

Commit 2d32b62

Browse files
authored
feat: update to latest copilot.vim/dist #1 (#372)
* feat: update to latest copilot.vim/dist language server now expects to be run directly through language-server.js * fix: missing copilot.lua version
1 parent 30321e3 commit 2d32b62

17 files changed

+540
-501000
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

copilot/dist/language-server.js

+531-470
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

copilot/dist/language-server.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

copilot/dist/resources/cl100k/tokenizer_cushman002.json

-100,260
This file was deleted.

copilot/dist/resources/cl100k/vocab_cushman002.bpe

-100,001
This file was deleted.

copilot/dist/resources/cl100k_base.tiktoken

-100,256
This file was deleted.

copilot/dist/resources/o200k_base.tiktoken

-199,998
This file was deleted.

copilot/dist/tree-sitter-c_sharp.wasm

5.64 MB
Binary file not shown.

copilot/dist/tree-sitter-go.wasm

29.6 KB
Binary file not shown.

copilot/dist/tree-sitter-java.wasm

405 KB
Binary file not shown.

copilot/index.js

-5
This file was deleted.

lua/copilot/client.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ local function prepare_client_config(overrides)
164164
return
165165
end
166166

167-
local agent_path = vim.api.nvim_get_runtime_file("copilot/index.js", false)[1]
167+
local agent_path = vim.api.nvim_get_runtime_file("copilot/dist/language-server.js", false)[1]
168168
if vim.fn.filereadable(agent_path) == 0 then
169169
local err = string.format("Could not find agent.js (bad install?) : %s", agent_path)
170170
vim.notify("[Copilot] " .. err, vim.log.levels.ERROR)

lua/copilot/util.lua

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function M.get_editor_info()
2020
editorPluginInfo = {
2121
name = "copilot.lua",
2222
-- reflects version of github/copilot.vim
23-
version = "1.13.0",
23+
version = "1.43.0",
2424
},
2525
}
2626
return info
@@ -30,7 +30,7 @@ local copilot_lua_version = nil
3030
function M.get_copilot_lua_version()
3131
if not copilot_lua_version then
3232
local plugin_version_ok, plugin_version = pcall(function()
33-
local plugin_dir = vim.fn.fnamemodify(M.get_copilot_path(), ":h:h")
33+
local plugin_dir = M.get_plugin_path()
3434
return vim.fn.systemlist(string.format("cd %s && git rev-parse HEAD", plugin_dir))[1]
3535
end)
3636
copilot_lua_version = plugin_version_ok and plugin_version or "dev"
@@ -279,11 +279,10 @@ function M.get_network_proxy()
279279
}
280280
end
281281

282-
---@deprecated
283-
M.get_copilot_path = function()
284-
local copilot_path = vim.api.nvim_get_runtime_file("copilot/index.js", false)[1]
282+
M.get_plugin_path = function()
283+
local copilot_path = vim.api.nvim_get_runtime_file("lua/copilot/init.lua", false)[1]
285284
if vim.fn.filereadable(copilot_path) ~= 0 then
286-
return copilot_path
285+
return vim.fn.fnamemodify(copilot_path, ":h:h:h")
287286
else
288287
print("[Copilot] could not read" .. copilot_path)
289288
end

0 commit comments

Comments
 (0)