Merge branch 'main' into feat/rego_language_support

This commit is contained in:
Zoltán Reegn 2024-10-17 13:38:53 +02:00 committed by GitHub
commit e643e2672a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 86 additions and 15 deletions

View file

@ -1,3 +1,3 @@
{
".": "12.39.0"
".": "12.42.0"
}

View file

@ -1,5 +1,45 @@
# Changelog
## [12.42.0](https://github.com/LazyVim/LazyVim/compare/v12.41.0...v12.42.0) (2024-10-04)
### Features
* **root:** provide `vim.g.root_lsp_ignore` to ignore LSP servers ([#4332](https://github.com/LazyVim/LazyVim/issues/4332)) ([90a9231](https://github.com/LazyVim/LazyVim/commit/90a92312aed79d4ee9d231f9eb3f8cd4debc46d1))
### Bug Fixes
* **gitsigns:** change name of filetype blame ([#4243](https://github.com/LazyVim/LazyVim/issues/4243)) ([3e257fd](https://github.com/LazyVim/LazyVim/commit/3e257fdb8874d7112446dc3ca1caf9c3263d8194))
* **neotest:** properly initialize adapter with call table. Fixes [#4538](https://github.com/LazyVim/LazyVim/issues/4538) ([327e829](https://github.com/LazyVim/LazyVim/commit/327e829c156864975785914038fe4515dadcba87))
## [12.41.0](https://github.com/LazyVim/LazyVim/compare/v12.40.0...v12.41.0) (2024-10-02)
### Features
* **rust:** update rustaceanvim ([#4477](https://github.com/LazyVim/LazyVim/issues/4477)) ([04515b1](https://github.com/LazyVim/LazyVim/commit/04515b139973173e90604f700d70f4e6d714da1f))
* **toggle:** add more `M.wk` fields for better user customization ([#4521](https://github.com/LazyVim/LazyVim/issues/4521)) ([57c0c0b](https://github.com/LazyVim/LazyVim/commit/57c0c0bc9f86467d90c0c10aac680bdba8e56469))
### Bug Fixes
* **extras:** migrate away from deprecated `get_target_window()` in mini-files ([#4479](https://github.com/LazyVim/LazyVim/issues/4479)) ([b110550](https://github.com/LazyVim/LazyVim/commit/b110550393957a3434db1f4f0dc5804a9d31820f))
## [12.40.0](https://github.com/LazyVim/LazyVim/compare/v12.39.0...v12.40.0) (2024-10-02)
### Features
* **lang:** add ts_ls to lsp config ([#4406](https://github.com/LazyVim/LazyVim/issues/4406)) ([34f0e56](https://github.com/LazyVim/LazyVim/commit/34f0e568d4e853cc2b4f0d628749cb66cd1b9aaf))
### Bug Fixes
* **extras:** rename `lspconfig.server_configurations` to `lspconfig.configs` ([#4518](https://github.com/LazyVim/LazyVim/issues/4518)) ([7432574](https://github.com/LazyVim/LazyVim/commit/74325743e7ff9d9efe9172ba96ec063c65ee219c))
* **lsp:** backward compat with lspconfig refactor. Fixes [#4525](https://github.com/LazyVim/LazyVim/issues/4525). See [#4518](https://github.com/LazyVim/LazyVim/issues/4518) ([6e40252](https://github.com/LazyVim/LazyVim/commit/6e4025229d4628a7278cf7c09f942af6dfea05dd))
* **render-markdown:** remove redundant `opts.file_types` ([#4506](https://github.com/LazyVim/LazyVim/issues/4506)) ([9b17672](https://github.com/LazyVim/LazyVim/commit/9b1767205cffd958ee9c74ceca299bd6c128b5f8))
## [12.39.0](https://github.com/LazyVim/LazyVim/compare/v12.38.2...v12.39.0) (2024-09-18)

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2024 September 18
*LazyVim.txt* For Neovim Last change: 2024 October 04
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View file

@ -68,7 +68,7 @@ vim.api.nvim_create_autocmd("FileType", {
"neotest-summary",
"neotest-output-panel",
"dbout",
"gitsigns.blame",
"gitsigns-blame",
},
callback = function(event)
vim.bo[event.buf].buflisted = false

View file

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "12.39.0" -- x-release-please-version
M.version = "12.42.0" -- x-release-please-version
LazyVim.config = M
---@class LazyVimOptions

View file

@ -40,6 +40,10 @@ vim.g.lazyvim_statuscolumn = {
-- * powershell
-- LazyVim.terminal.setup("pwsh")
-- Set LSP servers to be ignored when used with `util.root.detectors.lsp`
-- for detecting the LSP root
vim.g.root_lsp_ignore = { "copilot" }
-- Hide deprecation warnings
vim.g.deprecation_warnings = false

View file

@ -48,7 +48,7 @@ return {
local map_split = function(buf_id, lhs, direction, close_on_file)
local rhs = function()
local new_target_window
local cur_target_window = require("mini.files").get_target_window()
local cur_target_window = require("mini.files").get_explorer_state().target_window
if cur_target_window ~= nil then
vim.api.nvim_win_call(cur_target_window, function()
vim.cmd("belowright " .. direction .. " split")

View file

@ -1,4 +1,4 @@
-- This is the same as in lspconfig.server_configurations.jdtls, but avoids
-- This is the same as in lspconfig.configs.jdtls, but avoids
-- needing to require that when this module loads.
local java_filetypes = { "java" }
@ -76,7 +76,7 @@ return {
return {
-- How to find the root dir for a given filename. The default comes from
-- lspconfig which provides a function specifically for java projects.
root_dir = require("lspconfig.server_configurations.jdtls").default_config.root_dir,
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
-- How to find the project name for a given root dir.
project_name = function(root_dir)

View file

@ -17,7 +17,7 @@ return {
--
-- false to disable, otherwise should be a table of options to pass to `leanls`
--
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details.
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#leanls for details.
-- In particular ensure you have followed instructions setting up a callback
-- for `LspAttach` which sets your key bindings!
lsp = {

View file

@ -95,7 +95,6 @@ return {
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "norg", "rmd", "org" },
code = {
sign = false,
width = "block",

View file

@ -42,7 +42,7 @@ return {
{
"mrcjkb/rustaceanvim",
version = "^4", -- Recommended
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
ft = { "rust" },
opts = {
server = {

View file

@ -28,7 +28,7 @@ return {
},
setup = {
tailwindcss = function(_, opts)
local tw = require("lspconfig.server_configurations.tailwindcss")
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
opts.filetypes = opts.filetypes or {}
-- Add default filetypes

View file

@ -30,7 +30,7 @@ return {
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
end,
keys = {
{ "<localLeader>l", "", desc = "+vimtext" },
{ "<localLeader>l", "", desc = "+vimtex" },
},
},

View file

@ -19,9 +19,14 @@ return {
opts = {
-- make sure mason installs the server
servers = {
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
tsserver = {
enabled = false,
},
ts_ls = {
enabled = false,
},
vtsls = {
-- explicitly add default filetypes, so that we can extend
-- them in related extras
@ -114,10 +119,16 @@ return {
},
},
setup = {
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
tsserver = function()
-- disable tsserver
return true
end,
ts_ls = function()
-- disable tsserver
return true
end,
vtsls = function(_, opts)
LazyVim.lsp.on_attach(function(client, buffer)
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)

View file

@ -90,7 +90,7 @@ return {
adapter.adapter(config)
adapter = adapter.adapter
elseif meta and meta.__call then
adapter(config)
adapter = adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end

View file

@ -181,6 +181,15 @@ function M.get_config(server)
return rawget(configs, server)
end
---@return {default_config:lspconfig.Config}
function M.get_raw_config(server)
local ok, ret = pcall(require, "lspconfig.configs." .. server)
if ok then
return ret
end
return require("lspconfig.server_configurations." .. server)
end
function M.is_enabled(server)
local c = M.get_config(server)
return c and c.enabled ~= false

View file

@ -29,7 +29,11 @@ function M.detectors.lsp(buf)
return {}
end
local roots = {} ---@type string[]
for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do
local clients = LazyVim.lsp.get_clients({ bufnr = buf })
clients = vim.tbl_filter(function(client)
return not vim.tbl_contains(vim.g.root_lsp_ignore or {}, client.name)
end, clients)
for _, client in pairs(clients) do
local workspace = client.config.workspace_folders
for _, ws in pairs(workspace or {}) do
roots[#roots + 1] = vim.uri_to_fname(ws.uri)

View file

@ -3,6 +3,9 @@ local M = {}
---@class lazyvim.Toggle
---@field name string
---@field icon? string
---@field color_enabled? string
---@field color_disabled? string
---@field get fun():boolean
---@field set fun(state:boolean)
@ -50,7 +53,8 @@ function M.wk(lhs, toggle)
{
lhs,
icon = function()
return safe_get() and { icon = "", color = "green" } or { icon = "", color = "yellow" }
return safe_get() and { icon = toggle.icon or "", color = toggle.color_enabled or "green" }
or { icon = toggle.icon or "", color = toggle.color_disabled or "yellow" }
end,
desc = function()
return (safe_get() and "Disable " or "Enable ") .. toggle.name