Skip to content

Commit dcc2bcb

Browse files
authored
feat(chat): action palette has static items (#3079)
Co-authored-by: Oli Morris <[email protected]>
1 parent bce2b8a commit dcc2bcb

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

lua/codecompanion/interactions/chat/action_palette.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ local function format_keys(modes)
2323
return table.concat(segments, " ")
2424
end
2525

26+
---Build the static items shown in every chat command palette
27+
---@return table
28+
local function static_items()
29+
return {
30+
{
31+
callback = function()
32+
require("codecompanion").actions()
33+
end,
34+
description = "Open the action palette",
35+
name = "CodeCompanion actions",
36+
type = "static",
37+
},
38+
}
39+
end
40+
2641
---Build items from the chat's keymaps
2742
---@param chat CodeCompanion.Chat
2843
---@return table
@@ -122,6 +137,7 @@ end
122137
function CommandPalette.launch(chat)
123138
local items = {}
124139

140+
vim.list_extend(items, static_items())
125141
vim.list_extend(items, keymap_items(chat))
126142
vim.list_extend(items, slash_command_items(chat))
127143

0 commit comments

Comments
 (0)