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
28 lines (23 loc) · 704 Bytes
/
init.lua
File metadata and controls
28 lines (23 loc) · 704 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
local M = { setup_done = false }
local highlight = require("copilot.highlight")
local logger = require("copilot.logger")
local client = require("copilot.client")
local config = require("copilot.config")
M.setup = function(opts)
if vim.fn.has("nvim-0.11") == 0 then
logger.error("Neovim 0.11+ is required")
return
end
if M.setup_done then
return
end
highlight.setup()
config.merge_with_user_configs(opts)
logger.setup(config.logger)
logger.debug("active plugin config:", config)
require("copilot.command").enable()
-- logged here to ensure the logger is setup
logger.debug("active LSP config (may change runtime):", client.config)
M.setup_done = true
end
return M