Skip to content

Commit 269c2ca

Browse files
authored
refactor!: defaults become presets (#2497)
1 parent e88933f commit 269c2ca

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

lua/codecompanion/config.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local defaults = {
3131
allow_insecure = false, -- Allow insecure connections?
3232
cache_models_for = 1800, -- Cache adapter models for this long (seconds)
3333
proxy = nil, -- [protocol://]host[:port] e.g. socks5://127.0.0.1:9999
34-
show_defaults = true, -- Show default adapters
34+
show_presets = true, -- Show preset adapters
3535
show_model_choices = true, -- Show model choices when changing adapter
3636
},
3737
},
@@ -45,7 +45,7 @@ local defaults = {
4545
kimi_cli = "kimi_cli",
4646
opencode = "opencode",
4747
opts = {
48-
show_defaults = true, -- Show default adapters
48+
show_presets = true,
4949
},
5050
},
5151
},
@@ -752,7 +752,7 @@ The user is working on a %s machine. Please respond with system specific command
752752
{ path = "CLAUDE.local.md", parser = "claude" },
753753
{ path = "~/.claude/CLAUDE.md", parser = "claude" },
754754
},
755-
is_default = true,
755+
is_preset = true,
756756
},
757757
CodeCompanion = {
758758
description = "CodeCompanion rules",
@@ -806,7 +806,7 @@ The user is working on a %s machine. Please respond with system specific command
806806
},
807807
},
808808
},
809-
is_default = true,
809+
is_preset = true,
810810
},
811811
parsers = {
812812
claude = "claude", -- Parser for CLAUDE.md files
@@ -828,7 +828,7 @@ The user is working on a %s machine. Please respond with system specific command
828828
default_rules = "default", -- The rule groups to load
829829
default_params = "diff", -- all|diff
830830
},
831-
show_defaults = true, -- Show the default rules files in the action palette?
831+
show_presets = true, -- Show the preset rules files in the action palette?
832832
},
833833
},
834834
-- DISPLAY OPTIONS ----------------------------------------------------------

lua/codecompanion/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ end
323323
---@return nil
324324
local function handle_adapter_config(adapter_type, opts)
325325
if opts and opts.adapters and opts.adapters[adapter_type] then
326-
if config.adapters[adapter_type].opts.show_defaults then
326+
if config.adapters[adapter_type].opts.show_presets then
327327
require("codecompanion.utils.adapters").extend(config.adapters[adapter_type], opts.adapters[adapter_type])
328328
else
329329
config.adapters[adapter_type] = vim.deepcopy(opts.adapters[adapter_type])

lua/codecompanion/interactions/chat/rules/helpers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function M.list()
5151
local exclusions = { "opts", "parsers" }
5252

5353
for name, cfg in pairs(config.rules or {}) do
54-
if cfg.is_default and config.rules.opts.show_defaults == false then
54+
if cfg.is_preset and config.rules.opts.show_presets == false then
5555
goto continue
5656
end
5757
if cfg.enabled == false then

tests/interactions/chat/rules/test_rules.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ T["Rules:make()"]["integration: rules is added to a real chat messages stack"] =
191191
default = {
192192
description = "integration default",
193193
files = { %q },
194-
is_default = true,
194+
is_preset = true,
195195
},
196196
parsers = {},
197197
opts = {
@@ -200,7 +200,7 @@ T["Rules:make()"]["integration: rules is added to a real chat messages stack"] =
200200
default_rules = "default",
201201
condition = function() return true end,
202202
},
203-
show_defaults = true,
203+
show_presets = true,
204204
},
205205
})
206206

0 commit comments

Comments
 (0)