Skip to content

Commit

Permalink
fix(codeium-nvim): resolve loading issues for nvim-cmp and lspkind.nv…
Browse files Browse the repository at this point in the history
…im (#1082)

* fix(codeium-nvim): resolve loading issues for nvim-cmp and lspkind.nvim

* fix(codeium-nvim): fix various bugs in spec

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
khas-amir and mehalter authored Jul 8, 2024
1 parent eb8e700 commit 5bfcfc4
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions lua/astrocommunity/completion/codeium-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
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 = {
["<Leader>;"] = {
name = require("astroui").get_icon("Codeium", 1, true) .. "Codeium",
},
["<Leader>;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 = {
["<Leader>;"] = {
name = require("astroui").get_icon("Codeium", 1, true) .. "Codeium",
},
["<Leader>;o"] = {
desc = "Open Chat",
function() vim.cmd "Codeium Chat" end,
},
},
})
end,
},
},
})
end,
},
},
specs = {
{
"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, {
Expand All @@ -54,9 +53,8 @@ return {
optional = true,
-- Adds icon for codeium using lspkind
opts = function(_, opts)
opts.symbol_map = {
Codeium = require("astroui").get_icon("Codeium", 1, true),
}
if not opts.symbol_map then opts.symbol_map = {} end
opts.symbol_map.Codeium = require("astroui").get_icon("Codeium", 1, true)
end,
},
},
Expand Down

0 comments on commit 5bfcfc4

Please sign in to comment.