mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-07-14 19:34:27 +02:00
add: cocnform ignore patern and nvimlint ignore patern
This commit is contained in:
parent
77ec605527
commit
5fe2180144
6 changed files with 25 additions and 7 deletions
|
@ -45,7 +45,7 @@ pcode.format_timeout_ms = 5000
|
|||
-- https://github.com/mfussenegger/nvim-lint
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
-- use conform and nvim-lint if set true
|
||||
pcode.disable_null_ls = false
|
||||
pcode.disable_null_ls = true
|
||||
|
||||
pcode.treesitter_ensure_installed = {}
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ return {
|
|||
["xmlformatter"] = "xmlformat",
|
||||
}
|
||||
|
||||
local ignore = {
|
||||
["php"] = "tlint",
|
||||
}
|
||||
|
||||
for _, pkg in pairs(mason_reg.get_installed_packages()) do
|
||||
for _, type in pairs(pkg.spec.categories) do
|
||||
-- only act upon a formatter
|
||||
|
@ -62,8 +66,10 @@ return {
|
|||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
|
||||
table.insert(formatters_by_ft[ftl], pkg.spec.name)
|
||||
if ignore[ftl] ~= pkg.spec.name then
|
||||
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
|
||||
table.insert(formatters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -64,6 +64,10 @@ return {
|
|||
["yamllint"] = "yamllint",
|
||||
}
|
||||
|
||||
local ignore = {
|
||||
["php"] = "tlint",
|
||||
}
|
||||
|
||||
for _, pkg in pairs(mason_reg.get_installed_packages()) do
|
||||
for _, type in pairs(pkg.spec.categories) do
|
||||
-- only act upon a formatter
|
||||
|
@ -79,8 +83,10 @@ return {
|
|||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
opts.linters_by_ft[ftl] = opts.linters_by_ft[ftl] or {}
|
||||
table.insert(opts.linters_by_ft[ftl], pkg.spec.name)
|
||||
if ignore[ftl] ~= pkg.spec.name then
|
||||
opts.linters_by_ft[ftl] = opts.linters_by_ft[ftl] or {}
|
||||
table.insert(opts.linters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -131,6 +131,11 @@ M.on_attach = function(client, bufnr)
|
|||
end
|
||||
|
||||
local on_save = pcode.format_on_save or false
|
||||
-- disable if conform active
|
||||
local status, _ = pcall(require, "conform")
|
||||
if status then
|
||||
on_save = false
|
||||
end
|
||||
lsp_keymaps(bufnr, on_save)
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
filetypes = { "blade" },
|
||||
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
|
||||
singe_file_support = true,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue