-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.lua
More file actions
40 lines (36 loc) · 1014 Bytes
/
config.lua
File metadata and controls
40 lines (36 loc) · 1014 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
40
---@class devcontainers.Config
local default = {
---@type devcontainers.Logger.Config?
log = {
level = 'warn',
},
---@type string?
lsp_version = '3.17',
---@type string|string[]?
docker_cmd = 'docker',
---@type string|string[]?
devcontainers_cli_cmd = 'devcontainer',
--- Filter automiatically-added LSP protocol extensions
---@type devcontainers.lsp.ExtensionsFilter?
lsp_extensions_filter = nil,
}
---@type devcontainers.Config
local config = vim.deepcopy(default, true)
---@class devcontainers.config: devcontainers.Config
local M = {}
function M.setup(opts)
local new = vim.tbl_deep_extend('force', default, opts or {})
for key, _ in pairs(config) do
config[key] = nil
end
for key, val in pairs(new) do
config[key] = val
end
end
---@type devcontainers.config
return setmetatable(M, {
__index = config,
__newindex = function()
error('Trying to modify config table. Use config.setup().')
end,
})