This commit is contained in:
Christian Nieves
2025-01-24 19:10:02 +00:00
parent f815679d89
commit d0b81f87cb
9 changed files with 186 additions and 200 deletions

View File

@ -7,7 +7,7 @@ function M.setup(capabilities)
local configs = require("lspconfig.configs") local configs = require("lspconfig.configs")
configs.ciderlsp = { configs.ciderlsp = {
default_config = { default_config = {
offset_encoding = "utf-16", -- offset_encoding = "utf-16",
cmd = { cmd = {
"/google/bin/releases/cider/ciderlsp/ciderlsp", "/google/bin/releases/cider/ciderlsp/ciderlsp",
"--tooltag=nvim-lsp", "--tooltag=nvim-lsp",
@ -51,11 +51,10 @@ function M.setup(capabilities)
vim.b["is_cider_lsp_attached"] = "no" vim.b["is_cider_lsp_attached"] = "no"
end end
local cider_lsp_handlers = { local cider_lsp_handlers = {}
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { -- cider_lsp_handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
focusable = false, -- focusable = false,
}), -- })
}
cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx) cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx)
local first_fire = vim.b["is_cider_lsp_attached"] == "no" local first_fire = vim.b["is_cider_lsp_attached"] == "no"

View File

@ -8,11 +8,12 @@ return {
version = "*", version = "*",
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp -- lazy.nvim will automatically load the plugin when it's required by blink.cmp
lazy = true, lazy = true,
cond = flags.blink,
-- make sure to set opts so that lazy.nvim calls blink.compat's setup -- make sure to set opts so that lazy.nvim calls blink.compat's setup
opts = { opts = {
impersonate_nvim_cmp = use_google(), -- only cider needs this impersonate_nvim_cmp = true,
debug = true,
}, },
cond = not use_google(),
}, },
{ {
"saghen/blink.cmp", "saghen/blink.cmp",
@ -20,10 +21,12 @@ return {
cond = flags.blink, cond = flags.blink,
dependencies = { dependencies = {
"Exafunction/codeium.nvim", "Exafunction/codeium.nvim",
"mikavilpas/blink-ripgrep.nvim",
"chrisgrieser/cmp-nerdfont", "chrisgrieser/cmp-nerdfont",
"hrsh7th/cmp-emoji", "hrsh7th/cmp-nvim-lsp",
"mikavilpas/blink-ripgrep.nvim",
"moyiz/blink-emoji.nvim",
"rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source "rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source
"saghen/blink.compat",
}, },
version = "v0.*", -- use a release tag to download pre-built binaries version = "v0.*", -- use a release tag to download pre-built binaries
-- build = 'cargo build --release', -- build = 'cargo build --release',
@ -31,7 +34,9 @@ return {
---@module 'blink.cmp' ---@module 'blink.cmp'
---@type blink.cmp.Config ---@type blink.cmp.Config
opts = { opts = {
-- stylua: ignore
keymap = { keymap = {
preset = "none",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" }, ["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide", "fallback" }, ["<C-e>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" }, ["<CR>"] = { "accept", "fallback" },
@ -64,7 +69,9 @@ return {
end end
return providerToEnable return providerToEnable
end, end,
-- default = { "lsp" },
providers = { providers = {
lsp = { name = "LSP", module = "blink.cmp.sources.lsp", score_offset = 90 },
-- dont show LuaLS require statements when lazydev has items -- dont show LuaLS require statements when lazydev has items
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } }, lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } },
ripgrep = { ripgrep = {
@ -80,24 +87,38 @@ return {
additional_rg_options = {}, additional_rg_options = {},
}, },
}, },
nvim_ciderlsp = { -- https://github.com/moyiz/blink-emoji.nvim
name = "nvim_ciderlsp", emoji = {
module = "blink.compat.source", module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- the higher the number, the higher the priority
opts = { insert = true }, -- Insert emoji (default) or complete its name
}, },
buganizer = { buffer = {
name = "nvim_buganizer", name = "Buffer",
enabled = true,
max_items = 3,
module = "blink.cmp.sources.buffer",
min_keyword_length = 4,
score_offset = 15, -- the higher the number, the higher the priority
},
-- compat sources
nerdfont = {
name = "nerdfont",
module = "blink.compat.source", module = "blink.compat.source",
}, },
codeium = { codeium = {
name = "codeium", name = "codeium",
module = "blink.compat.source", module = "blink.compat.source",
score_offset = 100,
}, },
emoji = { nvim_ciderlsp = {
name = "emoji", name = "nvim_ciderlsp",
module = "blink.compat.source", module = "blink.compat.source",
score_offset = 100,
}, },
nerdfont = { buganizer = {
name = "nerdfont", name = "nvim_buganizer",
module = "blink.compat.source", module = "blink.compat.source",
}, },
}, },
@ -105,6 +126,20 @@ return {
-- experimental signature help support -- experimental signature help support
signature = { enabled = true }, signature = { enabled = true },
completion = { completion = {
list = {
-- stylua: ignore
selection = {
preselect = function(ctx) return ctx.mode ~= 'cmdline' end,
auto_insert = function(ctx) return ctx.mode ~= 'cmdline' end,
},
},
documentation = {
auto_show = true,
},
-- Displays a preview of the selected item on the current line
ghost_text = {
enabled = true,
},
menu = { menu = {
draw = { draw = {
components = { components = {
@ -123,16 +158,6 @@ return {
}, },
}, },
}, },
list = {
selection = {
preselect = function(ctx)
return ctx.mode ~= "cmdline"
end,
auto_insert = function(ctx)
return ctx.mode ~= "cmdline"
end,
},
},
trigger = { trigger = {
show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" }, show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" },
}, },

View File

@ -1,4 +1,4 @@
local use_google = require("utils").use_googlecmp local use_google = require("utils").use_google
local flags = require("utils").flags local flags = require("utils").flags
return { return {

View File

@ -60,7 +60,7 @@ return {
-- end, -- end,
-- }, -- },
{ {
"https://git.sr.ht/~whynothugo/lsp_lines.nvim", "ErichDonGubler/lsp_lines.nvim",
event = { "LspAttach" }, event = { "LspAttach" },
name = "lsp_lines.nvim", name = "lsp_lines.nvim",
config = function() config = function()

View File

@ -244,17 +244,11 @@ return {
name = "cmp-nvim-ciderlsp", name = "cmp-nvim-ciderlsp",
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp", url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
event = "VimEnter", event = "VimEnter",
dependencies = {
"hrsh7th/nvim-cmp",
},
}, },
{ {
name = "ciderlsp-nvim", name = "ciderlsp-nvim",
url = "sso://googler@user/kdark/ciderlsp-nvim", url = "sso://googler@user/kdark/ciderlsp-nvim",
event = "VimEnter", event = "VimEnter",
dependencies = {
"hrsh7th/nvim-cmp",
},
}, },
-- { -- {
-- name = "nvim_figtree", -- name = "nvim_figtree",

View File

@ -2,17 +2,17 @@ local use_google = require("utils").use_google
local flags = require("utils").flags local flags = require("utils").flags
return { return {
{ -- {
"ray-x/lsp_signature.nvim", -- "ray-x/lsp_signature.nvim",
event = "VeryLazy", -- event = "VeryLazy",
opts = { -- opts = {
floating_window = true, -- floating_window = true,
hint_prefix = "󰡱 ", -- hint_prefix = "󰡱 ",
}, -- },
config = function(_, opts) -- config = function(_, opts)
require("lsp_signature").setup(opts) -- require("lsp_signature").setup(opts)
end, -- end,
}, -- },
{ {
"kosayoda/nvim-lightbulb", "kosayoda/nvim-lightbulb",
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49", commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
@ -89,6 +89,8 @@ return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
"saghen/blink.cmp",
"saghen/blink.compat",
"nvim-lua/lsp-status.nvim", "nvim-lua/lsp-status.nvim",
"VonHeikemen/lsp-zero.nvim", "VonHeikemen/lsp-zero.nvim",
}, },

View File

@ -1,35 +0,0 @@
return {
{
"danymat/neogen",
config = function()
require("neogen").setup({ snippet_engine = "luasnip" })
end,
},
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "<CurrentMajor>.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
{ "saadparwaiz1/cmp_luasnip" },
config = function()
local ls = require("luasnip")
vim.keymap.set({ "i" }, "<Tab>", function()
ls.expand()
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<Tab>", function()
ls.jump(1)
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
ls.jump(-1)
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, { silent = true })
end,
}

View File

@ -1,128 +1,129 @@
return { return {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
dependencies = { cond = false,
"williamboman/mason.nvim", dependencies = {
"Hoffs/omnisharp-extended-lsp.nvim", "williamboman/mason.nvim",
}, "Hoffs/omnisharp-extended-lsp.nvim",
config = function() },
local TableConcat = require("utils").TableConcat config = function()
local use_google = require("utils").use_google local TableConcat = require("utils").TableConcat
local use_google = require("utils").use_google
local lsps = { local lsps = {
"lua_ls", "lua_ls",
"html", "html",
"marksman", "marksman",
"sqlls", "sqlls",
"bashls", "bashls",
"dotls", "dotls",
"golangci_lint_ls", "golangci_lint_ls",
"gopls", "gopls",
} }
if not use_google() then if not use_google() then
TableConcat(lsps, { TableConcat(lsps, {
"pyright", "pyright",
"omnisharp_mono", "omnisharp_mono",
"docker_compose_language_service", "docker_compose_language_service",
"dockerls", "dockerls",
"graphql", "graphql",
"kotlin_language_server", "kotlin_language_server",
"arduino_language_server", "arduino_language_server",
"clangd", "clangd",
}) })
end end
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
automatic_installation = false, automatic_installation = false,
ensure_installed = lsps, ensure_installed = lsps,
handlers = { handlers = {
-- The first entry (without a key) will be the default handler -- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have -- and will be called for each installed server that doesn't have
-- a dedicated handler. -- a dedicated handler.
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
-- vim.notify("Mason LSP:" .. server_name) -- vim.notify("Mason LSP:" .. server_name)
require("lspconfig")[server_name].setup({}) require("lspconfig")[server_name].setup({})
end, end,
-- Prevent mason from setting up rust_analyzer since that's handled by rustaceanvim -- Prevent mason from setting up rust_analyzer since that's handled by rustaceanvim
["rust_analyzer"] = function() end, ["rust_analyzer"] = function() end,
["omnisharp_mono"] = function() ["omnisharp_mono"] = function()
require("lspconfig").omnisharp_mono.setup({ require("lspconfig").omnisharp_mono.setup({
handlers = { handlers = {
["textDocument/definition"] = require("omnisharp_extended").handler, ["textDocument/definition"] = require("omnisharp_extended").handler,
}, },
-- cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" }, -- cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" },
-- Enables support for reading code style, naming convention and analyzer -- Enables support for reading code style, naming convention and analyzer
-- settings from .editorconfig. -- settings from .editorconfig.
enable_editorconfig_support = true, enable_editorconfig_support = true,
-- If true, MSBuild project system will only load projects for files that -- If true, MSBuild project system will only load projects for files that
-- were opened in the editor. This setting is useful for big C# codebases -- were opened in the editor. This setting is useful for big C# codebases
-- and allows for faster initialization of code navigation features only -- and allows for faster initialization of code navigation features only
-- for projects that are relevant to code that is being edited. With this -- for projects that are relevant to code that is being edited. With this
-- setting enabled OmniSharp may load fewer projects and may thus display -- setting enabled OmniSharp may load fewer projects and may thus display
-- incomplete reference lists for symbols. -- incomplete reference lists for symbols.
enable_ms_build_load_projects_on_demand = false, -- default false enable_ms_build_load_projects_on_demand = false, -- default false
-- Enables support for roslyn analyzers, code fixes and rulesets. -- Enables support for roslyn analyzers, code fixes and rulesets.
enable_roslyn_analyzers = true, -- default false enable_roslyn_analyzers = true, -- default false
-- Specifies whether 'using' directives should be grouped and sorted during -- Specifies whether 'using' directives should be grouped and sorted during
-- document formatting. -- document formatting.
organize_imports_on_format = true, -- default false organize_imports_on_format = true, -- default false
-- Enables support for showing unimported types and unimported extension -- Enables support for showing unimported types and unimported extension
-- methods in completion lists. When committed, the appropriate using -- methods in completion lists. When committed, the appropriate using
-- directive will be added at the top of the current file. This option can -- directive will be added at the top of the current file. This option can
-- have a negative impact on initial completion responsiveness, -- have a negative impact on initial completion responsiveness,
-- particularly for the first few completion sessions after opening a -- particularly for the first few completion sessions after opening a
-- solution. -- solution.
enable_import_completion = true, -- default false enable_import_completion = true, -- default false
-- Specifies whether to include preview versions of the .NET SDK when -- Specifies whether to include preview versions of the .NET SDK when
-- determining which version to use for project loading. -- determining which version to use for project loading.
sdk_include_prereleases = true, sdk_include_prereleases = true,
-- Only run analyzers against open files when 'enableRoslynAnalyzers' is -- Only run analyzers against open files when 'enableRoslynAnalyzers' is
-- true -- true
analyze_open_documents_only = true, -- default false analyze_open_documents_only = true, -- default false
}) })
end, end,
["lua_ls"] = function() ["lua_ls"] = function()
require("lspconfig").lua_ls.setup({ require("lspconfig").lua_ls.setup({
settings = { settings = {
Lua = { Lua = {
runtime = { runtime = {
-- Tell the language server which version of Lua you're using -- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim) -- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT", version = "LuaJIT",
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = { globals = {
"vim", "vim",
"require", "require",
}, },
}, },
workspace = { workspace = {
checkThirdParty = false, -- stop a annoying dialog on startup checkThirdParty = false, -- stop a annoying dialog on startup
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true), -- library = vim.api.nvim_get_runtime_file("", true),
library = { library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
}, },
}, },
-- Do not send telemetry data containing a randomized but unique identifier -- Do not send telemetry data containing a randomized but unique identifier
telemetry = { telemetry = {
enable = false, enable = false,
}, },
}, },
}, },
}) })
end, end,
}, },
}) })
end, end,
} }

View File

@ -1,6 +1,6 @@
local M = { local M = {
use_google_cache = nil, use_google_cache = nil,
flags = { blink = true }, flags = { blink = false },
} }
function M.exec(command, args) function M.exec(command, args)