This commit is contained in:
2025-04-30 18:34:59 -07:00
parent 9a7981eaba
commit 95089a5a57
3 changed files with 50 additions and 46 deletions

View File

@@ -4,6 +4,7 @@ return {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"j-hui/fidget.nvim",
"ravitemer/mcphub.nvim",
},
opts = {
adapters = {
@@ -17,7 +18,9 @@ return {
model = {
-- default = "claude-3.7-sonnet-thought",
-- default = "o3-mini",
default = "gemini-2.0-flash-001",
-- default = "gemini-2.0-flash-001",
default = "gpt-4.1",
-- default = "gpt-4o",
-- default = "o3-mini-2025-01-31",
-- choices = {
-- ["o3-mini-2025-01-31"] = { opts = { can_reason = true } },
@@ -26,7 +29,7 @@ return {
-- "gpt-4o-2024-08-06",
-- "claude-3.7-sonnet-thought",
-- "claude-3.7-sonnet",
-- "claude-3.5-sonnet",
-- "claude-3.5-sonnet",
-- "gemini-2.0-flash-001",
-- },
},
@@ -94,8 +97,8 @@ return {
},
strategies = {
chat = {
-- adapter = "copilot",
adapter = "openrouter",
adapter = "copilot",
-- adapter = "openrouter",
roles = {
llm = function(adapter)
if adapter.model == nil then
@@ -132,19 +135,10 @@ return {
},
},
},
tools = {
["mcp"] = {
-- Prevent mcphub from loading before needed
callback = function()
return require("mcphub.extensions.codecompanion")
end,
description = "Call tools and resources from the MCP Servers",
},
},
},
inline = {
-- adapter = "copilot",
adapter = "openrouter",
adapter = "copilot",
-- adapter = "openrouter",
},
},
display = {
@@ -200,6 +194,16 @@ return {
log_level = "DEBUG",
-- log_level = "TRACE",
},
extensions = {
mcphub = {
callback = "mcphub.extensions.codecompanion",
opts = {
show_result_in_chat = true, -- Show the mcp tool result in the chat buffer
make_vars = true, -- make chat #variables from MCP server resources
make_slash_commands = true, -- make /slash_commands from MCP server prompts
},
},
},
},
init = function()
require("plugins.codecompanion.fidget-spinner"):init()

View File

@@ -1,10 +1,10 @@
return {
'nvimtools/none-ls.nvim',
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require('null-ls')
local helpers = require('null-ls.helpers')
local null_ls = require("null-ls")
local helpers = require("null-ls.helpers")
-- syncronous formatting
local augroup = vim.api.nvim_create_augroup('LspFormatting', {})
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- null_ls.setup({
-- on_attach = function(client)
@@ -20,11 +20,11 @@ return {
-- })
-- you can reuse a shared lspconfig on_attach callback here
require('null-ls').setup({
require("null-ls").setup({
on_attach = function(client, bufnr)
if client.supports_method('textDocument/formatting') then
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd('BufWritePre', {
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
@@ -35,7 +35,7 @@ return {
async = false,
bufnr = bufnr,
filter = function(client)
return client.name == 'null-ls'
return client.name == "null-ls"
end,
})
end,
@@ -60,8 +60,8 @@ return {
null_ls.builtins.formatting.markdownlint,
null_ls.builtins.formatting.prettier, -- handled by lsp server
null_ls.builtins.formatting.shfmt.with({
filetypes = { 'sh', 'bash' },
extra_args = { '-i', '0', '-ci', '-sr' },
filetypes = { "sh", "bash" },
extra_args = { "-i", "0", "-ci", "-sr" },
}),
-- null_ls.builtins.diagnostics.actionlint,
},