mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into sk/update-mini-refs
This commit is contained in:
commit
42dfe083fe
26 changed files with 67 additions and 177 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
".": "14.15.0"
|
".": "14.15.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,5 +1,15 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [14.15.1](https://github.com/LazyVim/LazyVim/compare/v14.15.0...v14.15.1) (2025-09-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blink:** use .get method to access presets ([#6183](https://github.com/LazyVim/LazyVim/issues/6183)) ([1a729e2](https://github.com/LazyVim/LazyVim/commit/1a729e2d4c4162501fe13224d669a654849deb36))
|
||||||
|
* **extras.ai.copilot:** update status retrieval for lualine ([#5900](https://github.com/LazyVim/LazyVim/issues/5900)) ([55e9944](https://github.com/LazyVim/LazyVim/commit/55e9944e2b1e152b5acdc9cc015978a905fc2966))
|
||||||
|
* **lang.python:** enable venv-selector even when telescope is not available ([#5829](https://github.com/LazyVim/LazyVim/issues/5829)) ([10e5bf5](https://github.com/LazyVim/LazyVim/commit/10e5bf5c5b5fb4da0afbb2d4d2b75595502c9690))
|
||||||
|
* **lsp:** fixed deprecated warnings ([bed725a](https://github.com/LazyVim/LazyVim/commit/bed725a054ed3e8c8c56dce7e2100335e567cf01))
|
||||||
|
|
||||||
## [14.15.0](https://github.com/LazyVim/LazyVim/compare/v14.14.0...v14.15.0) (2025-05-12)
|
## [14.15.0](https://github.com/LazyVim/LazyVim/compare/v14.14.0...v14.15.0) (2025-05-12)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s
|
||||||
|
|
||||||
## ⚡️ Requirements
|
## ⚡️ Requirements
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.11.0** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
- a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**
|
||||||
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
- a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim Last change: 2025 May 12
|
*LazyVim.txt* For Neovim Last change: 2025 September 15
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
@ -53,7 +53,7 @@ FEATURES *LazyVim-features*
|
||||||
|
|
||||||
REQUIREMENTS *LazyVim-requirements*
|
REQUIREMENTS *LazyVim-requirements*
|
||||||
|
|
||||||
- Neovim >= **0.9.0** (needs to be built with **LuaJIT**)
|
- Neovim >= **0.11.0** (needs to be built with **LuaJIT**)
|
||||||
- Git >= **2.19.0** (for partial clones support)
|
- Git >= **2.19.0** (for partial clones support)
|
||||||
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
|
||||||
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
- a **C** compiler for `nvim-treesitter`. See here <https://github.com/nvim-treesitter/nvim-treesitter#requirements>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||||
---@class LazyVimConfig: LazyVimOptions
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.version = "14.15.0" -- x-release-please-version
|
M.version = "14.15.1" -- x-release-please-version
|
||||||
LazyVim.config = M
|
LazyVim.config = M
|
||||||
|
|
||||||
---@class LazyVimOptions
|
---@class LazyVimOptions
|
||||||
|
|
@ -353,7 +353,7 @@ function M.get_defaults()
|
||||||
{ name = "telescope", extra = "editor.telescope" },
|
{ name = "telescope", extra = "editor.telescope" },
|
||||||
},
|
},
|
||||||
cmp = {
|
cmp = {
|
||||||
{ name = "blink.cmp", extra = "coding.blink", enabled = vim.fn.has("nvim-0.10") == 1 },
|
{ name = "blink.cmp", extra = "coding.blink" },
|
||||||
{ name = "nvim-cmp", extra = "coding.nvim-cmp" },
|
{ name = "nvim-cmp", extra = "coding.nvim-cmp" },
|
||||||
},
|
},
|
||||||
explorer = {
|
explorer = {
|
||||||
|
|
|
||||||
|
|
@ -209,13 +209,3 @@ map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||||
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||||
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
||||||
|
|
||||||
-- native snippets. only needed on < 0.11, as 0.11 creates these by default
|
|
||||||
if vim.fn.has("nvim-0.11") == 0 then
|
|
||||||
map("s", "<Tab>", function()
|
|
||||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
|
||||||
end, { expr = true, desc = "Jump Next" })
|
|
||||||
map({ "i", "s" }, "<S-Tab>", function()
|
|
||||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
|
||||||
end, { expr = true, desc = "Jump Previous" })
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,10 @@ opt.fillchars = {
|
||||||
diff = "╱",
|
diff = "╱",
|
||||||
eob = " ",
|
eob = " ",
|
||||||
}
|
}
|
||||||
|
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||||
opt.foldlevel = 99
|
opt.foldlevel = 99
|
||||||
|
opt.foldmethod = "expr"
|
||||||
|
opt.foldtext = ""
|
||||||
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||||
opt.grepformat = "%f:%l:%c:%m"
|
opt.grepformat = "%f:%l:%c:%m"
|
||||||
|
|
@ -95,6 +98,7 @@ opt.sidescrolloff = 8 -- Columns of context
|
||||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
opt.smartcase = true -- Don't ignore case with capitals
|
opt.smartcase = true -- Don't ignore case with capitals
|
||||||
opt.smartindent = true -- Insert indents automatically
|
opt.smartindent = true -- Insert indents automatically
|
||||||
|
opt.smoothscroll = true
|
||||||
opt.spelllang = { "en" }
|
opt.spelllang = { "en" }
|
||||||
opt.splitbelow = true -- Put new windows below current
|
opt.splitbelow = true -- Put new windows below current
|
||||||
opt.splitkeep = "screen"
|
opt.splitkeep = "screen"
|
||||||
|
|
@ -111,15 +115,5 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||||
opt.winminwidth = 5 -- Minimum window width
|
opt.winminwidth = 5 -- Minimum window width
|
||||||
opt.wrap = false -- Disable line wrap
|
opt.wrap = false -- Disable line wrap
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.10") == 1 then
|
|
||||||
opt.smoothscroll = true
|
|
||||||
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
|
||||||
opt.foldmethod = "expr"
|
|
||||||
opt.foldtext = ""
|
|
||||||
else
|
|
||||||
opt.foldmethod = "indent"
|
|
||||||
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Fix markdown indentation settings
|
-- Fix markdown indentation settings
|
||||||
vim.g.markdown_recommended_style = 0
|
vim.g.markdown_recommended_style = 0
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,10 @@ local error = vim.health.error or vim.health.report_error
|
||||||
function M.check()
|
function M.check()
|
||||||
start("LazyVim")
|
start("LazyVim")
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.11.0") == 1 then
|
||||||
ok("Using Neovim >= 0.9.0")
|
ok("Using Neovim >= 0.11.0")
|
||||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
|
||||||
warn("Use Neovim >= 0.10.0 for the best experience")
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
error("Neovim >= 0.9.0 is required")
|
error("Neovim >= 0.11.0 is required")
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do
|
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ return {
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if (vim.g.colors_name or ""):find("catppuccin") then
|
if (vim.g.colors_name or ""):find("catppuccin") then
|
||||||
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
|
opts.highlights = require("catppuccin.groups.integrations.bufferline").get_theme()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
-- Compatibility with Neovim 0.9
|
|
||||||
return {
|
|
||||||
-- Use LuaSnip instead of native snippets
|
|
||||||
{ "garymjr/nvim-snippets", enabled = false },
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.luasnip" },
|
|
||||||
|
|
||||||
-- Use nvim-cmp instead of blink.cmp
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.nvim-cmp" },
|
|
||||||
|
|
||||||
-- Use mini.comment instead of ts-comments
|
|
||||||
{ "folke/ts-comments.nvim", enabled = false },
|
|
||||||
{ import = "lazyvim.plugins.extras.coding.mini-comment" },
|
|
||||||
|
|
||||||
-- Use neodev-types with lazydev
|
|
||||||
{ "folke/neodev.nvim", config = function() end },
|
|
||||||
{
|
|
||||||
"folke/lazydev.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
opts.library = opts.library or {}
|
|
||||||
table.insert(opts.library, { "neodev.nvim/types/stable" })
|
|
||||||
end,
|
|
||||||
config = function(_, opts)
|
|
||||||
-- force lazydev to load on Neovim 0.9
|
|
||||||
require("lazydev.config").have_0_10 = true
|
|
||||||
require("lazydev").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- dummy import to save core imports
|
|
||||||
{
|
|
||||||
import = "foobar",
|
|
||||||
enabled = function()
|
|
||||||
LazyVim.plugin.save_core()
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -51,7 +51,7 @@ return {
|
||||||
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
||||||
local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
||||||
if #clients > 0 then
|
if #clients > 0 then
|
||||||
local status = require("copilot.api").status.data.status
|
local status = require("copilot.status").data.status
|
||||||
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ return {
|
||||||
if not opts.keymap["<Tab>"] then
|
if not opts.keymap["<Tab>"] then
|
||||||
if opts.keymap.preset == "super-tab" then -- super-tab
|
if opts.keymap.preset == "super-tab" then -- super-tab
|
||||||
opts.keymap["<Tab>"] = {
|
opts.keymap["<Tab>"] = {
|
||||||
require("blink.cmp.keymap.presets")["super-tab"]["<Tab>"][1],
|
require("blink.cmp.keymap.presets").get("super-tab")["<Tab>"][1],
|
||||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||||
"fallback",
|
"fallback",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i = 1, 5 do
|
for i = 1, 9 do
|
||||||
table.insert(keys, {
|
table.insert(keys, {
|
||||||
"<leader>" .. i,
|
"<leader>" .. i,
|
||||||
function()
|
function()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ return {
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.navic_silence = true
|
vim.g.navic_silence = true
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
if client.supports_method("textDocument/documentSymbol") then
|
if client:supports_method("textDocument/documentSymbol") then
|
||||||
require("nvim-navic").attach(client, buffer)
|
require("nvim-navic").attach(client, buffer)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -114,11 +114,7 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"linux-cultist/venv-selector.nvim",
|
"linux-cultist/venv-selector.nvim",
|
||||||
branch = "regexp", -- Use this branch for the new version
|
|
||||||
cmd = "VenvSelect",
|
cmd = "VenvSelect",
|
||||||
enabled = function()
|
|
||||||
return LazyVim.has("telescope.nvim")
|
|
||||||
end,
|
|
||||||
opts = {
|
opts = {
|
||||||
settings = {
|
settings = {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -126,7 +122,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Call config for python files and load the cached venv automatically
|
-- Call config for Python files and load the cached venv automatically
|
||||||
ft = "python",
|
ft = "python",
|
||||||
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,6 @@ if lazyvim_docs then
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
||||||
if vim.fn.has("nvim-0.10") == 0 then
|
|
||||||
-- ruby_lsp does not work well with Neovim < 0.10
|
|
||||||
lsp = vim.g.lazyvim_ruby_lsp or "solargraph"
|
|
||||||
end
|
|
||||||
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
|
|
||||||
ft = { "rust" },
|
ft = { "rust" },
|
||||||
opts = {
|
opts = {
|
||||||
server = {
|
server = {
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,6 @@ return {
|
||||||
desc = "Organize Imports",
|
desc = "Organize Imports",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
capabilities = {
|
|
||||||
workspace = {
|
|
||||||
didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -137,14 +137,14 @@ return {
|
||||||
local action, uri, range = unpack(command.arguments)
|
local action, uri, range = unpack(command.arguments)
|
||||||
|
|
||||||
local function move(newf)
|
local function move(newf)
|
||||||
client.request("workspace/executeCommand", {
|
client:request("workspace/executeCommand", {
|
||||||
command = command.command,
|
command = command.command,
|
||||||
arguments = { action, uri, range, newf },
|
arguments = { action, uri, range, newf },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local fname = vim.uri_to_fname(uri)
|
local fname = vim.uri_to_fname(uri)
|
||||||
client.request("workspace/executeCommand", {
|
client:request("workspace/executeCommand", {
|
||||||
command = "typescript.tsserverRequest",
|
command = "typescript.tsserverRequest",
|
||||||
arguments = {
|
arguments = {
|
||||||
"getMoveToRefactoringFileSuggestions",
|
"getMoveToRefactoringFileSuggestions",
|
||||||
|
|
|
||||||
|
|
@ -55,16 +55,6 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
|
||||||
yamlls = function()
|
|
||||||
-- Neovim < 0.10 does not have dynamic registration for formatting
|
|
||||||
if vim.fn.has("nvim-0.10") == 0 then
|
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
|
||||||
client.server_capabilities.documentFormattingProvider = true
|
|
||||||
end, "yamlls")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
if vim.fn.has("nvim-0.9.0") == 0 then
|
if vim.fn.has("nvim-0.11.0") == 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "LazyVim requires Neovim >= 0.9.0\n", "ErrorMsg" },
|
{ "LazyVim requires Neovim >= 0.11.0\n", "ErrorMsg" },
|
||||||
|
{ "For more info, see: https://github.com/LazyVim/LazyVim/issues/6421\n", "Comment" },
|
||||||
{ "Press any key to exit", "MoreMsg" },
|
{ "Press any key to exit", "MoreMsg" },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
|
|
|
||||||
|
|
@ -125,53 +125,39 @@ return {
|
||||||
LazyVim.lsp.setup()
|
LazyVim.lsp.setup()
|
||||||
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach)
|
||||||
|
|
||||||
-- diagnostics signs
|
-- inlay hints
|
||||||
if vim.fn.has("nvim-0.10.0") == 0 then
|
if opts.inlay_hints.enabled then
|
||||||
if type(opts.diagnostics.signs) ~= "boolean" then
|
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
||||||
for severity, icon in pairs(opts.diagnostics.signs.text) do
|
if
|
||||||
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
|
vim.api.nvim_buf_is_valid(buffer)
|
||||||
name = "DiagnosticSign" .. name
|
and vim.bo[buffer].buftype == ""
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
||||||
|
then
|
||||||
|
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.10") == 1 then
|
-- code lens
|
||||||
-- inlay hints
|
if opts.codelens.enabled and vim.lsp.codelens then
|
||||||
if opts.inlay_hints.enabled then
|
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
||||||
LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer)
|
vim.lsp.codelens.refresh()
|
||||||
if
|
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
||||||
vim.api.nvim_buf_is_valid(buffer)
|
buffer = buffer,
|
||||||
and vim.bo[buffer].buftype == ""
|
callback = vim.lsp.codelens.refresh,
|
||||||
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
})
|
||||||
then
|
end)
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- code lens
|
|
||||||
if opts.codelens.enabled and vim.lsp.codelens then
|
|
||||||
LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer)
|
|
||||||
vim.lsp.codelens.refresh()
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, {
|
|
||||||
buffer = buffer,
|
|
||||||
callback = vim.lsp.codelens.refresh,
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
||||||
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●"
|
opts.diagnostics.virtual_text.prefix = function(diagnostic)
|
||||||
or function(diagnostic)
|
local icons = LazyVim.config.icons.diagnostics
|
||||||
local icons = LazyVim.config.icons.diagnostics
|
for d, icon in pairs(icons) do
|
||||||
for d, icon in pairs(icons) do
|
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
||||||
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
return icon
|
||||||
return icon
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ function M.has(buffer, method)
|
||||||
method = method:find("/") and method or "textDocument/" .. method
|
method = method:find("/") and method or "textDocument/" .. method
|
||||||
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
|
local clients = LazyVim.lsp.get_clients({ bufnr = buffer })
|
||||||
for _, client in ipairs(clients) do
|
for _, client in ipairs(clients) do
|
||||||
if client.supports_method(method) then
|
if client:supports_method(method) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ local prios = {
|
||||||
["lazyvim.plugins.extras.test.core"] = 1,
|
["lazyvim.plugins.extras.test.core"] = 1,
|
||||||
["lazyvim.plugins.extras.dap.core"] = 1,
|
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||||
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
|
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
|
||||||
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
["lazyvim.plugins.extras.editor.neo-tree"] = 2,
|
||||||
|
["lazyvim.plugins.extras.ui.edgy"] = 3,
|
||||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||||
["lazyvim.plugins.extras.coding.blink"] = 5,
|
["lazyvim.plugins.extras.coding.blink"] = 5,
|
||||||
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
||||||
|
|
@ -42,15 +43,7 @@ end
|
||||||
---@type string[]
|
---@type string[]
|
||||||
extras = LazyVim.dedup(extras)
|
extras = LazyVim.dedup(extras)
|
||||||
|
|
||||||
local version = vim.version()
|
|
||||||
local v = version.major .. "_" .. version.minor
|
|
||||||
|
|
||||||
local compat = { "0_9" }
|
|
||||||
|
|
||||||
LazyVim.plugin.save_core()
|
LazyVim.plugin.save_core()
|
||||||
if vim.tbl_contains(compat, v) then
|
|
||||||
table.insert(extras, 1, "lazyvim.plugins.compat.nvim-" .. v)
|
|
||||||
end
|
|
||||||
if vim.g.vscode then
|
if vim.g.vscode then
|
||||||
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,12 @@
|
||||||
---@class lazyvim.util.lsp
|
---@class lazyvim.util.lsp
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@alias lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: lsp.Client):boolean}
|
---@alias lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: vim.lsp.Client):boolean}
|
||||||
|
|
||||||
---@param opts? lsp.Client.filter
|
---@param opts? lsp.Client.filter
|
||||||
function M.get_clients(opts)
|
function M.get_clients(opts)
|
||||||
local ret = {} ---@type vim.lsp.Client[]
|
local ret = {} ---@type vim.lsp.Client[]
|
||||||
if vim.lsp.get_clients then
|
ret = vim.lsp.get_clients(opts)
|
||||||
ret = vim.lsp.get_clients(opts)
|
|
||||||
else
|
|
||||||
---@diagnostic disable-next-line: deprecated
|
|
||||||
ret = vim.lsp.get_active_clients(opts)
|
|
||||||
if opts and opts.method then
|
|
||||||
---@param client vim.lsp.Client
|
|
||||||
ret = vim.tbl_filter(function(client)
|
|
||||||
return client.supports_method(opts.method, { bufnr = opts.bufnr })
|
|
||||||
end, ret)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret
|
return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -75,7 +64,7 @@ function M._check_methods(client, buffer)
|
||||||
for method, clients in pairs(M._supports_method) do
|
for method, clients in pairs(M._supports_method) do
|
||||||
clients[client] = clients[client] or {}
|
clients[client] = clients[client] or {}
|
||||||
if not clients[client][buffer] then
|
if not clients[client][buffer] then
|
||||||
if client.supports_method and client.supports_method(method, { bufnr = buffer }) then
|
if client.supports_method and client:supports_method(method, { bufnr = buffer }) then
|
||||||
clients[client][buffer] = true
|
clients[client][buffer] = true
|
||||||
vim.api.nvim_exec_autocmds("User", {
|
vim.api.nvim_exec_autocmds("User", {
|
||||||
pattern = "LspSupportsMethod",
|
pattern = "LspSupportsMethod",
|
||||||
|
|
@ -169,8 +158,8 @@ function M.formatter(opts)
|
||||||
local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))
|
local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf }))
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
local ret = vim.tbl_filter(function(client)
|
local ret = vim.tbl_filter(function(client)
|
||||||
return client.supports_method("textDocument/formatting")
|
return client:supports_method("textDocument/formatting")
|
||||||
or client.supports_method("textDocument/rangeFormatting")
|
or client:supports_method("textDocument/rangeFormatting")
|
||||||
end, clients)
|
end, clients)
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
return vim.tbl_map(function(client)
|
return vim.tbl_map(function(client)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
---@class lazyvim.util.ui
|
---@class lazyvim.util.ui
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
-- foldtext for Neovim < 0.10.0
|
|
||||||
function M.foldtext()
|
|
||||||
return vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
-- optimized treesitter foldexpr for Neovim >= 0.10.0
|
-- optimized treesitter foldexpr for Neovim >= 0.10.0
|
||||||
function M.foldexpr()
|
function M.foldexpr()
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue