add: lsp blade dan linter blade

This commit is contained in:
asep.komarudin 2024-06-25 11:41:17 +07:00
parent fbc8a53840
commit 4bd718cab7
5 changed files with 37 additions and 1 deletions

View file

@ -14,6 +14,7 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" },
"codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" }, "codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" },
"conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" },
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" }, "dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
"friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" },
@ -58,7 +59,7 @@
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
"rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" }, "rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" },
"smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" }, "smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" },
"telescope.nvim": { "branch": "master", "commit": "f2bfde705ac752c52544d5cfa8b0aee0a766c1ed" }, "telescope.nvim": { "branch": "master", "commit": "58ec6eca1c3704d130d749843e16fbf6c8cdc57e" },
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" },
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },

View file

@ -111,11 +111,39 @@ if pcode.active_php_config then
opts = function(_, opts) opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {} opts.linters_by_ft = opts.linters_by_ft or {}
opts.linters_by_ft.php = { "phpcs" } opts.linters_by_ft.php = { "phpcs" }
opts.linters_by_ft.blade = { "tlint" }
end, end,
config = function(_, opts) config = function(_, opts)
require("lint").linters_by_ft = opts.linters_by_ft require("lint").linters_by_ft = opts.linters_by_ft
end, end,
}, },
{
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = function(_, opts)
local psave = pcode.format_on_save or 0
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.formatters_by_ft.blade = { "blade-formatter" }
if psave == 1 then
opts.format_on_save = {
timeout_ms = pcode.format_timeout_ms or 500,
lsp_fallback = true,
}
end
return opts
end,
config = function(_, opts)
local conform = require("conform")
conform.setup(opts)
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = pcode.format_timeout_ms or 500,
})
end, { desc = "Format file or range (in visual mode)" })
end,
},
{ {
"adalessa/laravel.nvim", "adalessa/laravel.nvim",
dependencies = { dependencies = {

View file

@ -61,7 +61,9 @@ if pcode.active_php_config then
table.insert(pcode.treesitter_ensure_installed, ts) table.insert(pcode.treesitter_ensure_installed, ts)
end end
table.insert(pcode.mason_ensure_installed, "intelephense") table.insert(pcode.mason_ensure_installed, "intelephense")
table.insert(pcode.mason_ensure_installed, "stimulus_ls")
table.insert(pcode.null_ls_ensure_installed, "phpcbf") table.insert(pcode.null_ls_ensure_installed, "phpcbf")
table.insert(pcode.null_ls_ensure_installed, "blade_formatter")
table.insert(pcode.null_ls_ensure_installed, "phpcs") table.insert(pcode.null_ls_ensure_installed, "phpcs")
end end
-- run if golang config true -- run if golang config true

View file

@ -2,6 +2,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
{ "nvim-treesitter/nvim-treesitter-context" },
{ {
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
lazy = true, lazy = true,

View file

@ -0,0 +1,4 @@
return {
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
singe_file_support = true,
}