all repos

init.lua @ fa7b55b

my nvim config
5 files changed, 6 insertions(+), 32 deletions(-)
refactor(lsp): root markers
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2025-06-03 19:45:11 +0300
Parent: 646254b
M lsp/golangci_lint_ls.lua

@@ -1,5 +1,3 @@

-local u = require("core.utils").lsp - ---@return vim.lsp.Config return { cmd = { "golangci-lint-langserver" },

@@ -12,7 +10,7 @@ "--output.json.path=stdout",

"--show-stats=false", }, }, - root_markers = u.root_marker { + root_markers = { ".golangci.yml", ".golangci.yaml", ".golangci.toml",
M lsp/gopls.lua

@@ -1,10 +1,8 @@

-local u = require("core.utils").lsp - ---@return vim.lsp.Config return { cmd = { "gopls" }, filetypes = { "go", "gomod", "gowork", "gotmpl" }, - root_markers = u.root_marker { + root_markers = { "go.mod", "go.work", },
M lsp/ts_ls.lua

@@ -1,5 +1,3 @@

-local u = require("core.utils").lsp - ---@return vim.lsp.Config return { cmd = { "typescript-language-server", "--stdio" },

@@ -12,7 +10,8 @@ "typescript",

"typescriptreact", "typescript.tsx", }, - root_markers = u.root_marker { + root_markers = { + "node_modules", "tsconfig.json", "jsconfig.json", "package.json",
M lua/core/lsp.lua

@@ -1,8 +1,8 @@

local u = require "core.utils" vim.lsp.config("*", { - root_markers = u.lsp.default_markers, flags = { debounce_text_changes = 150 }, + capabilities = require("blink.cmp").get_lsp_capabilities(), }) vim.lsp.enable {
M lua/core/utils.lua

@@ -1,5 +1,3 @@

-local lsp_root_markers = { ".git" } - return { ---@param mode string|table ---@param from string

@@ -22,28 +20,9 @@ return vim.api.nvim_create_augroup("olexsmir_" .. name, { clear = true })

end, lsp = { - default_markers = lsp_root_markers, - - ---@param extend? string[] - root_marker = function(extend) - if extend == nil then - return lsp_root_markers - end - - local r = vim.deepcopy(lsp_root_markers) - for _, v in ipairs(extend) do - table.insert(r, v) - end - return r - end, - ---@param extend? table capabilities = function(extend) - return vim.tbl_extend( - "force", - vim.lsp.protocol.make_client_capabilities(), - extend or {} - ) + return require("blink.cmp").get_lsp_capabilities(extend or {}) end, }, }