[Update] bulk update
This commit is contained in:
@@ -3,6 +3,25 @@ require("nvchad.configs.lspconfig").defaults()
|
||||
local servers = { "html", "cssls", "ts_ls", "eslint" }
|
||||
vim.lsp.enable(servers)
|
||||
|
||||
-- Waybar/GTK stylesheets are GTK CSS, a different dialect: `@name` references
|
||||
-- @define-color colors (waybar's theme.css) and functions like alpha() are
|
||||
-- valid there but not in web CSS, so cssls floods "property value expected" /
|
||||
-- "{ expected" false errors. No LSP speaks the GTK dialect, so keep cssls
|
||||
-- attached (standard-property completion still useful) and mute diagnostics
|
||||
-- on those buffers only.
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not client or client.name ~= "cssls" then
|
||||
return
|
||||
end
|
||||
local path = vim.api.nvim_buf_get_name(args.buf)
|
||||
if path:match "/waybar/" or path:match "/gtk%-%d" then
|
||||
vim.diagnostic.enable(false, { bufnr = args.buf })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- local lspconfig = require "lspconfig"
|
||||
-- local nvlsp = require "nvchad.configs.lspconfig"
|
||||
--
|
||||
|
||||
@@ -34,6 +34,26 @@ return {
|
||||
"regex",
|
||||
},
|
||||
},
|
||||
-- On the main branch nothing acts on `ensure_installed` at startup: setup() takes only
|
||||
-- install_dir, and NvChad's :TSInstallAll (which does read this list off the lazy spec)
|
||||
-- only runs from `build`, i.e. when the plugin is installed or updated. So a language
|
||||
-- added here stayed uninstalled until the next rebuild — 9 of these 15 were missing,
|
||||
-- silently falling back to regex highlighting. Install whatever is absent, once, here.
|
||||
config = function(_, opts)
|
||||
local ts = require "nvim-treesitter"
|
||||
ts.setup()
|
||||
|
||||
local have = {}
|
||||
for _, lang in ipairs(ts.get_installed()) do
|
||||
have[lang] = true
|
||||
end
|
||||
local missing = vim.tbl_filter(function(lang)
|
||||
return not have[lang]
|
||||
end, opts.ensure_installed or {})
|
||||
if #missing > 0 then
|
||||
ts.install(missing) -- async; highlighting picks each up as it lands
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user