Skip to content

Commit ff0ba7f

Browse files
committed
fix(context): fix diagnostics overwrites
1 parent 0449381 commit ff0ba7f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lua/opencode/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ M.defaults = {
149149
enabled = false,
150150
},
151151
diagnostics = {
152-
enabled = false,
152+
enabled = true,
153153
info = false,
154154
warning = true,
155155
error = true,

lua/opencode/context.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ function M.get_diagnostics(buf)
7171
return nil
7272
end
7373

74-
local diagnostic_conf = config.context and state.current_context_config.diagnostics or config.context.diagnostics
74+
local current_conf = vim.tbl_get(state, 'current_context_config', 'diagnostics') or {}
75+
local global_conf = vim.tbl_get(config, 'context', 'diagnostics') or {}
76+
local diagnostic_conf = vim.tbl_deep_extend('force', global_conf, current_conf) or {}
7577

7678
local severity_levels = {}
7779
if diagnostic_conf.error then

0 commit comments

Comments
 (0)