1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

nvim: update lsp config to nvim 0.12

This commit is contained in:
Henrik Hautakoski 2026-04-14 04:50:17 +02:00
parent 0423818458
commit d21bef893e
21 changed files with 91 additions and 87 deletions

View file

@ -1,48 +1,49 @@
{ {
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
"alpha-nvim": { "branch": "main", "commit": "a9d8fb72213c8b461e791409e7feabb74eb6ce73" }, "alpha-nvim": { "branch": "main", "commit": "fdb675257c7317fd068fe3224465781ad335751d" },
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, "catppuccin": { "branch": "main", "commit": "426dbebe06b5c69fd846ceb17b42e12f890aedf1" },
"colorful-menu.nvim": { "branch": "master", "commit": "b51a659459df8d078201aefc995db8175ed55e84" }, "colorful-menu.nvim": { "branch": "master", "commit": "b51a659459df8d078201aefc995db8175ed55e84" },
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"fd": { "branch": "master", "commit": "40d8eb30bcade65942308262a1f41a1b7847a1fe" }, "fd": { "branch": "master", "commit": "a665a3bba9abc85e80c142a7dcdb8c356b12d9c9" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" }, "fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" },
"gitsigns.nvim": { "branch": "main", "commit": "31217271a7314c343606acb4072a94a039a19fb5" }, "gitsigns.nvim": { "branch": "main", "commit": "8d82c240f190fc33723d48c308ccc1ed8baad69d" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lualine-lsp-status": { "branch": "main", "commit": "1218d51d4d0b8881a598a77e5d9f334ac31c6cc7" }, "lualine-lsp-status": { "branch": "main", "commit": "1218d51d4d0b8881a598a77e5d9f334ac31c6cc7" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f2fa60409630ec2d24acf84494fb55e1d28d593c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "f2fa60409630ec2d24acf84494fb55e1d28d593c" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" },
"mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" }, "mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" },
"neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, "neotest": { "branch": "master", "commit": "fd0b7986dd0ae04e38ec7dc0c78a432e3820839c" },
"neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" }, "neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" },
"neotest-pest": { "branch": "main", "commit": "1429445746f28a4ce887289ea6e442430629e306" }, "neotest-pest": { "branch": "main", "commit": "3388a5f00001303020ce885e18007ccd1835212c" },
"neotest-phpunit": { "branch": "main", "commit": "ac9177d15e95deaa9cbd29977752f55428a7f394" }, "neotest-phpunit": { "branch": "main", "commit": "ac9177d15e95deaa9cbd29977752f55428a7f394" },
"nvim-dap": { "branch": "master", "commit": "db321947bb289a2d4d76a32e76e4d2bd6103d7df" }, "nvim-colorizer.lua": { "branch": "master", "commit": "5cfe7fffbd01e17b3c1e14af85d5febdef88bd8c" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" },
"nvim-highlight-colors": { "branch": "main", "commit": "e2cb22089cc2358b2b995c09578224f142de6039" }, "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" },
"nvim-lint": { "branch": "master", "commit": "bcd1a44edbea8cd473af7e7582d3f7ffc60d8e81" }, "nvim-lint": { "branch": "master", "commit": "eab58b48eb11d7745c11c505e0f3057165902461" },
"nvim-lspconfig": { "branch": "master", "commit": "f4e9d367d4e067d7a5fabc9fd3f1349b291eb718" }, "nvim-lspconfig": { "branch": "master", "commit": "8a9378a822719346a0288fa004dab302ca3c0a8f" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-tree.lua": { "branch": "master", "commit": "c0b18e4879f7b29a17a240ad49f733af7a7fb348" }, "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-tree.lua": { "branch": "master", "commit": "509962f21ab7289d8dcd28568af539be39a8c01e" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" }, "nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
"nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" },
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "nvim-web-devicons": { "branch": "master", "commit": "c72328a5494b4502947a022fe69c0c47e53b6aa6" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"phptools.nvim": { "branch": "main", "commit": "a69b141b1310991d22294602c711562b1257b339" }, "phptools.nvim": { "branch": "main", "commit": "34ea0b46b19849f041b514a4770669e6d0e95224" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" }, "render-markdown.nvim": { "branch": "main", "commit": "0fd43fb4b1f073931c4b481f5f3b7cea3749e190" },
"statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" }, "statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" },
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, "telescope.nvim": { "branch": "master", "commit": "f7c673b8e46e8f233ff581d3624a517d33a7e264" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"undotree": { "branch": "master", "commit": "d8f99084d98c32f651860eb0baaf89759f91debc" }, "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
"vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
} }

View file

@ -1,5 +1,7 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
commit = "4916d6592ede8c07973490d9322f187e07dfefac",
pin = true,
dependencies = { dependencies = {
'windwp/nvim-ts-autotag', 'windwp/nvim-ts-autotag',
'nvim-treesitter/nvim-treesitter-textobjects' 'nvim-treesitter/nvim-treesitter-textobjects'
@ -7,10 +9,10 @@ return {
build = function() build = function()
require("nvim-treesitter.install").update({ with_sync = true }) require("nvim-treesitter.install").update({ with_sync = true })
end, end,
opts_extend = { "ensure_installed" }, opts_extend = { "install" },
opts = { opts = {
-- Default parsers. -- Default parsers.
ensure_installed = { install = {
-- VIM stuff -- VIM stuff
"vim", "vim",
"vimdoc", "vimdoc",
@ -18,7 +20,6 @@ return {
-- Common config languages -- Common config languages
"json", "json",
"jsonc",
"yaml", "yaml",
"toml", "toml",
"xml", "xml",
@ -35,37 +36,47 @@ return {
"printf", "printf",
"nginx", "nginx",
}, },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
}, },
config = function(_, opts) config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs() local ts = require("nvim-treesitter")
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate', callback = function ()
parser_config.dotenv = { require("nvim-treesitter.parsers").dotenv = {
install_info = { install_info = {
url = "https://github.com/pnx/tree-sitter-dotenv", url = "https://github.com/pnx/tree-sitter-dotenv",
branch = "main", branch = "main",
files = { "src/parser.c", "src/scanner.c" }, files = { "src/parser.c", "src/scanner.c" },
}, }
filetype = "dotenv",
}
vim.filetype.add({
pattern = {
['%.env'] = 'dotenv',
['%.env%..+'] = 'dotenv',
} }
end})
-- vim.filetype.add({
-- pattern = {
-- ['%.env'] = 'dotenv',
-- ['%.env%..+'] = 'dotenv',
-- }
-- })
vim.treesitter.language.register('dotenv', { 'env' })
for _, value in pairs(opts.install) do
vim.treesitter.language.register(value, value)
end
vim.api.nvim_create_autocmd('FileType', {
callback = function(ev)
local lang = vim.treesitter.language.get_lang(ev.match)
if vim.list_contains(ts.get_installed(), lang) then
vim.treesitter.start(ev.buf)
end
-- local all_langs = vim.treesitter.language._complete()
-- local lang = vim.treesitter.language.get_lang(ev.match)
-- vim.print(ev.match, all_langs, vim.tbl_contains(all_langs, lang))
-- if vim.tbl_contains(all_langs, lang) then
-- vim.treesitter.start(ev.buf)
-- end
end,
}) })
require("nvim-treesitter.configs").setup(opts) ts.install(opts.install)
end, ts.setup(opts)
end
} }

View file

@ -63,15 +63,15 @@ local config = function(_, opts)
client.server_capabilities, client.server_capabilities,
server_opts.server_capabilities or {}) server_opts.server_capabilities or {})
if server_opts.inlay_hints.enabled and client.supports_method("textDocument/inlayHint") then if server_opts.inlay_hints.enabled and client:supports_method("textDocument/inlayHint") then
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end end
if server_opts.codelens.enabled and client.supports_method("textDocument/codeLens") then if server_opts.codelens.enabled and client:supports_method("textDocument/codeLens") then
utils.codelens(augroup, bufnr) vim.lsp.codelens.enable(true, { bufnr = bufnr })
end end
if server_opts.document_highlight.enabled and client.supports_method("textDocument/documentHighlight") then if server_opts.document_highlight.enabled and client:supports_method("textDocument/documentHighlight") then
utils.document_highlight(bufnr) utils.document_highlight(bufnr)
end end

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "bash" } install = { "bash" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "c", "cpp" } install = { "c", "cpp" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "cmake" } install = { "cmake" }
} }
}, },
} }

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "css", "scss" } install = { "css", "scss" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "dockerfile" } install = { "dockerfile" }
} }
}, },
} }

View file

@ -52,7 +52,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "go", "gomod", "gowork", "gosum" } install = { "go", "gomod", "gowork", "gosum" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "html" } install = { "html" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "javascript", "javadoc" } install = { "javascript", "javadoc" }
} }
} }
} }

View file

@ -21,7 +21,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "lua" } install = { "lua" }
} }
}, },
{ {

View file

@ -6,7 +6,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "markdown" } install = { "markdown" }
} }
}, },
{ {

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "ninja" } install = { "ninja" }
} }
}, },
} }

View file

@ -2,7 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "php", "blade", "php_only", "phpdoc", "sql", "csv" } install = { "php", "blade", "php_only", "phpdoc", "sql", "csv" }
} }
}, },
{ {

View file

@ -6,7 +6,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "qmljs" } install = { "qmljs" }
} }
}, },
{ {

View file

@ -25,7 +25,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "rust", "toml" } install = { "rust", "toml" }
} }
}, },
{ {

View file

@ -6,7 +6,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "sql" } install = { "sql" }
} }
}, },
{ {

View file

@ -23,7 +23,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "typescript" } install = { "typescript" }
} }
}, },
{ {

View file

@ -17,7 +17,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { "vue" } install = { "vue" }
} }
}, },
{ {

View file

@ -62,12 +62,4 @@ function M.signature_help_on_hover(bufnr)
}) })
end end
function M.codelens(augroup, bufnr)
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
group = augroup,
buffer = bufnr,
callback = vim.lsp.codelens.refresh,
})
end
return M return M