-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathconfig.lua
More file actions
104 lines (92 loc) · 2.18 KB
/
config.lua
File metadata and controls
104 lines (92 loc) · 2.18 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
local notify = require("codeium.notify")
local M = {}
function M.defaults()
return {
manager_path = nil,
bin_path = vim.fn.stdpath("cache") .. "/codeium/bin",
config_path = vim.fn.stdpath("cache") .. "/codeium/config.json",
language_server_download_url = "https://github.com",
api = {
host = "server.codeium.com",
port = "443",
path = "/",
portal_url = "codeium.com",
},
quiet = false,
enterprise_mode = nil,
detect_proxy = nil,
tools = {},
wrapper = nil,
enable_chat = true,
enable_local_search = true,
enable_index_service = true,
search_max_workspace_file_count = 5000,
file_watch_max_dir_count = 50000,
enable_cmp_source = true,
env = { ["someproxy"] = "some url" }, -- kinba
mute_notify = true, -- kinba
virtual_text = {
enabled = false,
filetypes = {},
default_filetype_enabled = true,
manual = false,
idle_delay = 75,
virtual_text_priority = 65535,
map_keys = true,
accept_fallback = nil,
key_bindings = {
accept = "<Tab>",
accept_word = false,
accept_line = false,
clear = false,
next = "<M-]>",
prev = "<M-[>",
},
},
workspace_root = {
use_lsp = true,
find_root = nil,
paths = {
".bzr",
".git",
".hg",
".svn",
"_FOSSIL_",
"package.json",
},
},
}
end
function M.installation_defaults()
local has_installed, installed_config = pcall(require, "codeium.installation_defaults")
if has_installed then
return installed_config
else
return {}
end
end
function M.apply_conditional_defaults(options)
if options.enterprise_mode then
if options.api == nil then
options.api = {}
end
if options.api.path == nil then
options.api.path = "/_route/api_server"
end
if options.api.host == nil then
notify.warn("You need to specify api.host in enterprise mode")
else
if options.api.portal_url == nil then
options.api.portal_url = options.api.host .. ":" .. (options.api.port or "443")
end
end
end
return options
end
M.options = {}
function M.setup(options)
options = options or {}
options = M.apply_conditional_defaults(options)
M.options = vim.tbl_deep_extend("force", {}, M.defaults(), M.installation_defaults(), options)
end
return M