From 478425a7e8e1c4aa33a4d0d583826b016b30ef43 Mon Sep 17 00:00:00 2001 From: Amirkhan Date: Wed, 3 Jul 2024 12:18:33 +0300 Subject: [PATCH 1/2] fix(codeium-nvim): resolve loading issues for nvim-cmp and lspkind.nvim --- .../completion/codeium-nvim/init.lua | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lua/astrocommunity/completion/codeium-nvim/init.lua b/lua/astrocommunity/completion/codeium-nvim/init.lua index 05c080133..a1f1d84fb 100644 --- a/lua/astrocommunity/completion/codeium-nvim/init.lua +++ b/lua/astrocommunity/completion/codeium-nvim/init.lua @@ -36,28 +36,28 @@ return { end, }, }, - { - "hrsh7th/nvim-cmp", - optional = true, - dependencies = { "Exafunction/codeium.nvim" }, - opts = function(_, opts) - -- Inject codeium into cmp sources, with high priority - table.insert(opts.sources, 1, { - name = "codeium", - group_index = 1, - priority = 10000, - }) - end, - }, - { - "onsails/lspkind.nvim", - optional = true, - -- Adds icon for codeium using lspkind - opts = function(_, opts) - opts.symbol_map = { - Codeium = require("astroui").get_icon("Codeium", 1, true), - } - end, - }, + }, + { + "hrsh7th/nvim-cmp", + optional = true, + dependencies = { "Exafunction/codeium.nvim" }, + opts = function(_, opts) + -- Inject codeium into cmp sources, with high priority + table.insert(opts.sources, 1, { + name = "codeium", + group_index = 1, + priority = 10000, + }) + end, + }, + { + "onsails/lspkind.nvim", + optional = true, + -- Adds icon for codeium using lspkind + opts = function(_, opts) + opts.symbol_map = { + Codeium = require("astroui").get_icon("Codeium", 1, true), + } + end, }, } From 00963a9ae5087db07927c910548b0ad6b0799582 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Mon, 8 Jul 2024 08:02:28 -0400 Subject: [PATCH 2/2] fix(codeium-nvim): fix various bugs in spec --- .../completion/codeium-nvim/init.lua | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/lua/astrocommunity/completion/codeium-nvim/init.lua b/lua/astrocommunity/completion/codeium-nvim/init.lua index a1f1d84fb..5ddce1bbc 100644 --- a/lua/astrocommunity/completion/codeium-nvim/init.lua +++ b/lua/astrocommunity/completion/codeium-nvim/init.lua @@ -1,63 +1,61 @@ return { - { - "Exafunction/codeium.nvim", - event = "User AstroFile", - cmd = "Codeium", - opts = { - enable_chat = true, - }, - dependencies = { - { - "AstroNvim/astroui", - ---@type AstroUIOpts - opts = { - icons = { - Codeium = "", - }, + "Exafunction/codeium.nvim", + event = "User AstroFile", + cmd = "Codeium", + opts = { + enable_chat = true, + }, + dependencies = { + { + "AstroNvim/astroui", + ---@type AstroUIOpts + opts = { + icons = { + Codeium = "", }, }, - { - "AstroNvim/astrocore", - ---@param opts AstroCoreOpts - opts = function(_, opts) - return require("astrocore").extend_tbl(opts, { - mappings = { - n = { - [";"] = { - name = require("astroui").get_icon("Codeium", 1, true) .. "Codeium", - }, - [";o"] = { - desc = "Open Chat", - function() vim.cmd "Codeium Chat" end, - }, + }, + { + "AstroNvim/astrocore", + ---@param opts AstroCoreOpts + opts = function(_, opts) + return require("astrocore").extend_tbl(opts, { + mappings = { + n = { + [";"] = { + name = require("astroui").get_icon("Codeium", 1, true) .. "Codeium", + }, + [";o"] = { + desc = "Open Chat", + function() vim.cmd "Codeium Chat" end, }, }, - }) - end, - }, + }, + }) + end, }, }, - { - "hrsh7th/nvim-cmp", - optional = true, - dependencies = { "Exafunction/codeium.nvim" }, - opts = function(_, opts) - -- Inject codeium into cmp sources, with high priority - table.insert(opts.sources, 1, { - name = "codeium", - group_index = 1, - priority = 10000, - }) - end, - }, - { - "onsails/lspkind.nvim", - optional = true, - -- Adds icon for codeium using lspkind - opts = function(_, opts) - opts.symbol_map = { - Codeium = require("astroui").get_icon("Codeium", 1, true), - } - end, + specs = { + { + "hrsh7th/nvim-cmp", + optional = true, + opts = function(_, opts) + -- Inject codeium into cmp sources, with high priority + table.insert(opts.sources, 1, { + name = "codeium", + group_index = 1, + priority = 10000, + }) + end, + }, + { + "onsails/lspkind.nvim", + optional = true, + -- Adds icon for codeium using lspkind + opts = function(_, opts) + if not opts.symbol_map then opts.symbol_map = {} end + opts.symbol_map.Codeium = require("astroui").get_icon("Codeium", 1, true) + end, + }, }, }