mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'LazyVim:main' into main
This commit is contained in:
commit
f00d8035e1
12 changed files with 102 additions and 82 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
".": "15.2.0"
|
||||
".": "15.3.0"
|
||||
}
|
||||
|
|
|
|||
19
CHANGELOG.md
19
CHANGELOG.md
|
|
@ -1,5 +1,24 @@
|
|||
# Changelog
|
||||
|
||||
## [15.3.0](https://github.com/LazyVim/LazyVim/compare/v15.2.0...v15.3.0) (2025-09-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **copilot:** use `blink-copilot` as blink.cmp copilot source ([#5551](https://github.com/LazyVim/LazyVim/issues/5551)) ([13069f2](https://github.com/LazyVim/LazyVim/commit/13069f20183655d8a02f3acbd21d0ac4c9ce811c))
|
||||
* **treesitter:** show an error if the user tries to set a custom treesitter compiler ([89ff1fd](https://github.com/LazyVim/LazyVim/commit/89ff1fd600bb6ff4cf2c9edbc2217a40ecb8d160))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **jdtls:** allow mason jdtls installation ([#6498](https://github.com/LazyVim/LazyVim/issues/6498)) ([80990ec](https://github.com/LazyVim/LazyVim/commit/80990ec62fd36fc4b6b921a9041f55858e33e030))
|
||||
* **jdtls:** bundle configuration bug fix ([#6499](https://github.com/LazyVim/LazyVim/issues/6499)) ([c423765](https://github.com/LazyVim/LazyVim/commit/c4237659621e406089f4d13d32192954d52c4924))
|
||||
* **keymaps:** enable snacks git keybindings ([#6323](https://github.com/LazyVim/LazyVim/issues/6323)) ([720e06a](https://github.com/LazyVim/LazyVim/commit/720e06a908cbf6e3afb4eccc049d58df9ace770a))
|
||||
* **lsp:** fix mason install/exclude. Closes [#6504](https://github.com/LazyVim/LazyVim/issues/6504) ([37b1ec4](https://github.com/LazyVim/LazyVim/commit/37b1ec41ae57e8396d5c923a4bfdf7050215b4d6))
|
||||
* **lsp:** fixup for when not using mason ([a90b565](https://github.com/LazyVim/LazyVim/commit/a90b56518f4f2291985952d79472d4f935c0bad0))
|
||||
* **luasnip:** add missing optional tag to garymjr/nvim-snippets ([#5733](https://github.com/LazyVim/LazyVim/issues/5733)) ([37a1c1a](https://github.com/LazyVim/LazyVim/commit/37a1c1af5dbbcf069bb94a71b4dda3626fbda77a))
|
||||
* **vtsls:** fix and move denols/vtsls disambigutaion to typescript extra. Fixes [#6476](https://github.com/LazyVim/LazyVim/issues/6476) ([775621a](https://github.com/LazyVim/LazyVim/commit/775621ac0af42486ef1cd4254d1a6625a190040b))
|
||||
|
||||
## [15.2.0](https://github.com/LazyVim/LazyVim/compare/v15.1.1...v15.2.0) (2025-09-20)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
*LazyVim.txt* For Neovim Last change: 2025 September 20
|
||||
*LazyVim.txt* For Neovim Last change: 2025 September 23
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
|||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "15.2.0" -- x-release-please-version
|
||||
M.version = "15.3.0" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
|
|
|
|||
|
|
@ -163,12 +163,12 @@ end
|
|||
if vim.fn.executable("lazygit") == 1 then
|
||||
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" })
|
||||
map("n", "<leader>gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" })
|
||||
map("n", "<leader>gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" })
|
||||
end
|
||||
|
||||
map("n", "<leader>gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" })
|
||||
map("n", "<leader>gb", function() Snacks.picker.git_log_line() end, { desc = "Git Blame Line" })
|
||||
map("n", "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" })
|
||||
map("n", "<leader>gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" })
|
||||
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
|
||||
map({"n", "x" }, "<leader>gY", function()
|
||||
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
|
||||
|
|
|
|||
|
|
@ -98,15 +98,14 @@ return {
|
|||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "giuxtaposition/blink-cmp-copilot" },
|
||||
dependencies = { "fang2hou/blink-copilot" },
|
||||
opts = {
|
||||
sources = {
|
||||
default = { "copilot" },
|
||||
providers = {
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-cmp-copilot",
|
||||
kind = "Copilot",
|
||||
module = "blink-copilot",
|
||||
score_offset = 100,
|
||||
async = true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
-- disable builtin snippet support
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
{ "garymjr/nvim-snippets", optional = true, enabled = false },
|
||||
|
||||
-- add luasnip
|
||||
{
|
||||
|
|
|
|||
|
|
@ -150,19 +150,10 @@ return {
|
|||
if LazyVim.has("mason.nvim") then
|
||||
local mason_registry = require("mason-registry")
|
||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||
local jar_patterns = {
|
||||
vim.fn.expand("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin-*.jar"),
|
||||
}
|
||||
bundles = vim.fn.glob("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin-*jar", false, true)
|
||||
-- java-test also depends on java-debug-adapter.
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
vim.list_extend(jar_patterns, {
|
||||
vim.fn.expand("$MASON/share/java-test/*.jar"),
|
||||
})
|
||||
end
|
||||
for _, jar_pattern in ipairs(jar_patterns) do
|
||||
for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do
|
||||
table.insert(bundles, bundle)
|
||||
end
|
||||
vim.list_extend(bundles, vim.fn.glob("$MASON/share/java-test/*.jar", false, true))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -148,6 +148,28 @@ return {
|
|||
return true
|
||||
end,
|
||||
vtsls = function(_, opts)
|
||||
if vim.lsp.config.denols and vim.lsp.config.vtsls then
|
||||
---@param server string
|
||||
local resolve = function(server)
|
||||
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
||||
vim.lsp.config(server, {
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
|
||||
if is_deno == (server == "denols") then
|
||||
if root_dir then
|
||||
return root_dir(bufnr, on_dir)
|
||||
elseif type(markers) == "table" then
|
||||
local root = vim.fs.root(bufnr, markers)
|
||||
return root and on_dir(root)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
resolve("denols")
|
||||
resolve("vtsls")
|
||||
end
|
||||
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
-- Auto-organize imports and remove unused on save
|
||||
if client.name == "vtsls" then
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ return {
|
|||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type table<string, vim.lsp.Config|{mason?:boolean, enabled?:boolean}|boolean>
|
||||
---@alias lazyvim.lsp.Config vim.lsp.Config|{mason?:boolean, enabled?:boolean}
|
||||
---@type table<string, lazyvim.lsp.Config|boolean>
|
||||
servers = {
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
|
|
@ -186,76 +187,38 @@ return {
|
|||
local mason_all = have_mason
|
||||
and vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package)
|
||||
or {} --[[ @as string[] ]]
|
||||
local mason_exclude = {} ---@type string[]
|
||||
|
||||
local exclude_automatic_enable = {} ---@type string[]
|
||||
|
||||
---@return boolean? exclude automatic setup
|
||||
local function configure(server)
|
||||
local server_opts = opts.servers[server] or {}
|
||||
local sopts = opts.servers[server]
|
||||
sopts = sopts == true and {} or (not sopts) and { enabled = false } or sopts --[[@as lazyvim.lsp.Config]]
|
||||
|
||||
if sopts.enabled == false then
|
||||
mason_exclude[#mason_exclude + 1] = server
|
||||
return
|
||||
end
|
||||
|
||||
local use_mason = sopts.mason ~= false and vim.tbl_contains(mason_all, server)
|
||||
local setup = opts.setup[server] or opts.setup["*"]
|
||||
if setup and setup(server, server_opts) then
|
||||
return true -- lsp will be setup by the setup function
|
||||
end
|
||||
|
||||
vim.lsp.config(server, server_opts)
|
||||
|
||||
-- manually enable if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
||||
if server_opts.mason == false or not vim.tbl_contains(mason_all, server) then
|
||||
vim.lsp.enable(server)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local ensure_installed = {} ---@type string[]
|
||||
for server, server_opts in pairs(opts.servers) do
|
||||
server_opts = server_opts == true and {} or server_opts or false
|
||||
if server_opts and server_opts.enabled ~= false then
|
||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
||||
if configure(server) then
|
||||
exclude_automatic_enable[#exclude_automatic_enable + 1] = server
|
||||
else
|
||||
ensure_installed[#ensure_installed + 1] = server
|
||||
end
|
||||
if setup and setup(server, sopts) then
|
||||
mason_exclude[#mason_exclude + 1] = server
|
||||
else
|
||||
exclude_automatic_enable[#exclude_automatic_enable + 1] = server
|
||||
vim.lsp.config(server, sopts) -- configure the server
|
||||
if not use_mason then
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
end
|
||||
return use_mason
|
||||
end
|
||||
|
||||
local install = vim.tbl_filter(configure, vim.tbl_keys(opts.servers))
|
||||
if have_mason then
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = vim.tbl_deep_extend(
|
||||
"force",
|
||||
ensure_installed,
|
||||
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
||||
),
|
||||
automatic_enable = {
|
||||
exclude = exclude_automatic_enable,
|
||||
},
|
||||
ensure_installed = vim.list_extend(install, LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}),
|
||||
automatic_enable = { exclude = mason_exclude },
|
||||
})
|
||||
end
|
||||
|
||||
if vim.lsp.is_enabled and vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then
|
||||
---@param server string
|
||||
local resolve = function(server)
|
||||
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
||||
vim.lsp.config(server, {
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
|
||||
if is_deno == (server == "denols") then
|
||||
if root_dir then
|
||||
return root_dir(bufnr, on_dir)
|
||||
elseif type(markers) == "table" then
|
||||
local root = vim.fs.root(bufnr, markers)
|
||||
return root and on_dir(root)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
resolve("denols")
|
||||
resolve("vtsls")
|
||||
end
|
||||
end),
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,21 @@ return {
|
|||
config = function(_, opts)
|
||||
local TS = require("nvim-treesitter")
|
||||
|
||||
setmetatable(require("nvim-treesitter.install"), {
|
||||
__newindex = function(_, k)
|
||||
if k == "compilers" then
|
||||
vim.schedule(function()
|
||||
LazyVim.error({
|
||||
"Setting custom compilers for `nvim-treesitter` is no longer supported.",
|
||||
"",
|
||||
"For more info, see:",
|
||||
"- [compilers](https://docs.rs/cc/latest/cc/#compile-time-requirements)",
|
||||
})
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- some quick sanity checks
|
||||
if not TS.get_installed then
|
||||
return LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||
|
|
|
|||
|
|
@ -101,9 +101,20 @@ function M.pretty_path(opts)
|
|||
local root = LazyVim.root.get({ normalize = true })
|
||||
local cwd = LazyVim.root.cwd()
|
||||
|
||||
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
|
||||
-- original path is preserved to provide user with expected result of pretty_path, not a normalized one,
|
||||
-- which might be confusing
|
||||
local norm_path = path
|
||||
|
||||
if LazyVim.is_win() then
|
||||
-- in case any of the provided paths involved mixed case, an additional normalization step for windows
|
||||
norm_path = norm_path:lower()
|
||||
root = root:lower()
|
||||
cwd = cwd:lower()
|
||||
end
|
||||
|
||||
if opts.relative == "cwd" and norm_path:find(cwd, 1, true) == 1 then
|
||||
path = path:sub(#cwd + 2)
|
||||
elseif path:find(root, 1, true) == 1 then
|
||||
elseif norm_path:find(root, 1, true) == 1 then
|
||||
path = path:sub(#root + 2)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue