Skip to content

Commit b95c20b

Browse files
committed
refactor!: remove deprecated functions and configs, require nvim 0.10+
1 parent 73dbc0e commit b95c20b

5 files changed

Lines changed: 5 additions & 69 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ As lua is far more efficient and makes things easier to integrate with modern pl
1111

1212
</details>
1313

14+
## Requirements
15+
16+
- Curl
17+
- NeoVim 0.10.0 or higher
18+
1419
## Install
1520

1621
Install the plugin with your preferred plugin manager.

lua/copilot/client.lua

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,6 @@ local function store_client_id(id)
3131
M.id = id
3232
end
3333

34-
local lsp_start = vim.lsp.start
35-
if not lsp_start then
36-
local function reuse_client(client, conf)
37-
return client.config.root_dir == conf.root_dir and client.name == conf.name
38-
end
39-
40-
-- shim for neovim < 0.8.2
41-
lsp_start = function(lsp_config)
42-
local bufnr = vim.api.nvim_get_current_buf()
43-
local client = M.get()
44-
if client and reuse_client(client, lsp_config) then
45-
vim.lsp.buf_attach_client(bufnr, client.id)
46-
return client.id
47-
end
48-
local client_id = vim.lsp.start_client(lsp_config) --[[@as number]]
49-
vim.lsp.buf_attach_client(bufnr, client_id)
50-
return client_id
51-
end
52-
end
53-
5434
function M.buf_is_attached(bufnr)
5535
return M.id and vim.lsp.buf_is_attached(bufnr or 0, M.id)
5636
end

lua/copilot/config.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ local default_config = {
4545
trace_lsp_progress = false,
4646
log_lsp_messages = false,
4747
},
48-
---@deprecated
49-
ft_disable = nil,
5048
---@type table<string, boolean>
5149
filetypes = {},
5250
---@type string|nil

lua/copilot/handlers.lua

Lines changed: 0 additions & 24 deletions
This file was deleted.

lua/copilot/util.lua

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ function M.get_copilot_lua_version()
3737
return copilot_lua_version
3838
end
3939

40-
-- use `require("copilot.client").get()`
41-
---@deprecated
42-
M.get_copilot_client = function()
43-
return require("copilot.client").get()
44-
end
45-
4640
local internal_filetypes = {
4741
yaml = false,
4842
markdown = false,
@@ -106,12 +100,6 @@ function M.should_attach()
106100
return true
107101
end
108102

109-
-- use `require("copilot.client").buf_is_attached()`
110-
---@deprecated
111-
function M.is_attached()
112-
return require("copilot.client").buf_is_attached(0)
113-
end
114-
115103
local language_normalization_map = {
116104
bash = "shellscript",
117105
bst = "bibtex",
@@ -179,12 +167,6 @@ function M.get_doc_params(overrides)
179167
return params
180168
end
181169

182-
-- use `require("copilot.util").get_doc_params()`
183-
---@deprecated
184-
M.get_completion_params = function(opts)
185-
return M.get_doc_params(opts)
186-
end
187-
188170
---@return copilot_workspace_configurations
189171
function M.get_workspace_configurations()
190172
local conf = config.get() --[[@as copilot_config]]
@@ -227,11 +209,6 @@ M.get_plugin_path = function()
227209
end
228210
end
229211

230-
---@deprecated
231-
M.auth = function()
232-
require("copilot.auth").signin()
233-
end
234-
235212
---@param str string
236213
---@return integer
237214
function M.strutf16len(str)

0 commit comments

Comments
 (0)