forked from zbirenbaum/copilot.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
39 lines (35 loc) · 1018 Bytes
/
init.lua
File metadata and controls
39 lines (35 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local M = { client_info = nil }
local client = require("copilot.client")
local defaults = {
cmp = {
method = "getPanelCompletions",
max_results = 5,
},
extensions = {
getPanelCompletions = function ()
require("copilot_cmp").setup(require("copilot.extensions.panel").complete)
end,
getCompletionsCycling = function ()
require("copilot_cmp").setup()
end,
},
ft_disable = {},
plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
server_opts_overrides = {},
settings = {
advanced = {
listCount = 10, -- #completions for panel
inlineSuggestCount = 3, -- #completions for getCompletions
}
}
}
local config_handler = function(opts)
local user_config = opts and vim.tbl_deep_extend("force", defaults, opts) or defaults
return user_config
end
M.setup = function(opts)
local user_config = config_handler(opts)
require("copilot.extensions.panel").create()
vim.schedule(function () client.start(user_config) end)
end
return M