debug since deprecated conform setting
This commit is contained in:
@@ -1,57 +1,57 @@
|
|||||||
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
||||||
return require("mason-lspconfig"),
|
return require("mason-lspconfig"),
|
||||||
require("mason-tool-installer"),
|
require("mason-tool-installer"),
|
||||||
require("lspconfig"),
|
require("lspconfig"),
|
||||||
require("conform"),
|
require("conform"),
|
||||||
require("lint")
|
require("lint")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = { "ansiblels" },
|
ensure_installed = { "ansiblels" },
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.ansiblels.setup({
|
lspconfig.ansiblels.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
mason_tool_installer.setup({
|
mason_tool_installer.setup({
|
||||||
ensure_installed = { "ansible-lint" },
|
ensure_installed = { "ansible-lint" },
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
yml = { "ansible-lint" },
|
yaml = { "ansible-lint" },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
})
|
})
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
yml = { "ansible-lint" },
|
yml = { "ansible-lint" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ll", function()
|
vim.keymap.set("n", "<leader>ll", function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end, { desc = "Lint" })
|
end, { desc = "Lint" })
|
||||||
|
|||||||
@@ -1,57 +1,57 @@
|
|||||||
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
||||||
return require("mason-lspconfig"),
|
return require("mason-lspconfig"),
|
||||||
require("mason-tool-installer"),
|
require("mason-tool-installer"),
|
||||||
require("lspconfig"),
|
require("lspconfig"),
|
||||||
require("conform"),
|
require("conform"),
|
||||||
require("lint")
|
require("lint")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = { "bashls" },
|
ensure_installed = { "bashls" },
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.bashls.setup({
|
lspconfig.bashls.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
mason_tool_installer.setup({
|
mason_tool_installer.setup({
|
||||||
ensure_installed = { "shellcheck" },
|
ensure_installed = { "shellcheck" },
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
sh = { "shellcheck" },
|
sh = { "shellcheck" },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
})
|
})
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
sh = { "shellcheck" },
|
sh = { "shellcheck" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ll", function()
|
vim.keymap.set("n", "<leader>ll", function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end, { desc = "Lint" })
|
end, { desc = "Lint" })
|
||||||
|
|||||||
@@ -1,73 +1,73 @@
|
|||||||
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
||||||
return require("mason-lspconfig"),
|
return require("mason-lspconfig"),
|
||||||
require("mason-tool-installer"),
|
require("mason-tool-installer"),
|
||||||
require("lspconfig"),
|
require("lspconfig"),
|
||||||
require("conform"),
|
require("conform"),
|
||||||
require("lint")
|
require("lint")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = { "lua_ls" },
|
ensure_installed = { "lua_ls" },
|
||||||
})
|
})
|
||||||
|
|
||||||
mason_tool_installer.setup({
|
mason_tool_installer.setup({
|
||||||
ensure_installed = { "stylua", "luacheck" },
|
ensure_installed = { "stylua", "luacheck" },
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
-- capabilities = cmp_nvim_lsp.default_capabilities()
|
-- capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
settings = { -- custom settings for lua
|
settings = { -- custom settings for lua
|
||||||
Lua = {
|
Lua = {
|
||||||
-- make the language server recognize "vim" global
|
-- make the language server recognize "vim" global
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- make language server aware of runtime files
|
-- make language server aware of runtime files
|
||||||
library = {
|
library = {
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
})
|
})
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
lua = { "luacheck" },
|
lua = { "luacheck" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ll", function()
|
vim.keymap.set("n", "<leader>ll", function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end, { desc = "Lint" })
|
end, { desc = "Lint" })
|
||||||
|
|||||||
@@ -1,63 +1,63 @@
|
|||||||
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
||||||
return require("mason-lspconfig"),
|
return require("mason-lspconfig"),
|
||||||
require("mason-tool-installer"),
|
require("mason-tool-installer"),
|
||||||
require("lspconfig"),
|
require("lspconfig"),
|
||||||
require("conform"),
|
require("conform"),
|
||||||
require("lint")
|
require("lint")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"intelephense",
|
"intelephense",
|
||||||
"phpactor",
|
"phpactor",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.intelephense.setup({
|
lspconfig.intelephense.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
mason_tool_installer.setup({
|
mason_tool_installer.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"php-cs-fixer",
|
"php-cs-fixer",
|
||||||
"phpcs",
|
"phpcs",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
php = { "php-cs-fixer" },
|
php = { "php-cs-fixer" },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback"
|
||||||
})
|
})
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
php = { "phpcs" },
|
php = { "phpcs" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ll", function()
|
vim.keymap.set("n", "<leader>ll", function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end, { desc = "Lint" })
|
end, { desc = "Lint" })
|
||||||
|
|||||||
@@ -1,83 +1,84 @@
|
|||||||
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
local ok, mason_lspconfig, mason_tool_installer, lspconfig, conform, lint = pcall(function()
|
||||||
return require("mason-lspconfig"),
|
return require("mason-lspconfig"),
|
||||||
require("mason-tool-installer"),
|
require("mason-tool-installer"),
|
||||||
require("lspconfig"),
|
require("lspconfig"),
|
||||||
require("conform"),
|
require("conform"),
|
||||||
require("lint")
|
require("lint")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"ts_ls",
|
"ts_ls",
|
||||||
"html",
|
"html",
|
||||||
"emmet_ls",
|
"emmet_ls",
|
||||||
"cssls",
|
"cssls",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.ts_ls.setup({
|
lspconfig.ts_ls.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.html.setup({
|
lspconfig.html.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.emmet_ls.setup({
|
lspconfig.emmet_ls.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.cssls.setup({
|
lspconfig.cssls.setup({
|
||||||
capabilities = require("config/lsp/lsp-capabilities"),
|
capabilities = require("config/lsp/lsp-capabilities"),
|
||||||
on_attach = require("config/lsp/lsp-attach"),
|
on_attach = require("config/lsp/lsp-attach"),
|
||||||
})
|
})
|
||||||
|
|
||||||
mason_tool_installer.setup({
|
mason_tool_installer.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"prettierd",
|
"prettierd",
|
||||||
"prettier",
|
"prettier",
|
||||||
"eslint_d",
|
"eslint_d",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
javascript = { { "prettierd", "prettier" } },
|
javascript = { "prettierd", "prettier" },
|
||||||
json = { { "prettierd", "prettier" } },
|
json = { "prettierd", "prettier" },
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
},
|
stop_after_first = true
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_format = "fallback",
|
||||||
})
|
})
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
javascript = { "eslint_d" },
|
javascript = { "eslint_d" },
|
||||||
json = { "eslint_d" },
|
json = { "eslint_d" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ll", function()
|
vim.keymap.set("n", "<leader>ll", function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end, { desc = "Lint" })
|
end, { desc = "Lint" })
|
||||||
|
|||||||
Reference in New Issue
Block a user