mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +02:00
add: update
This commit is contained in:
parent
14207d8f21
commit
9b41753fd4
9 changed files with 348 additions and 189 deletions
|
@ -9,9 +9,6 @@ return {
|
||||||
}
|
}
|
||||||
local live_grep = {
|
local live_grep = {
|
||||||
only_sort_text = true,
|
only_sort_text = true,
|
||||||
additional_args = function()
|
|
||||||
return { "--multiline" }
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
if pcode.telescope_theme_find_file and pcode.telescope_theme_find_file ~= "center" then
|
if pcode.telescope_theme_find_file and pcode.telescope_theme_find_file ~= "center" then
|
||||||
find_files = {
|
find_files = {
|
||||||
|
@ -23,9 +20,6 @@ return {
|
||||||
live_grep = {
|
live_grep = {
|
||||||
theme = pcode.telescope_theme_live_grep,
|
theme = pcode.telescope_theme_live_grep,
|
||||||
only_sort_text = true,
|
only_sort_text = true,
|
||||||
additional_args = function()
|
|
||||||
return { "--multiline" }
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
|
|
186
lua/plugins/treesitter.lua
Normal file
186
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-treesitter/nvim-treesitter-context" },
|
||||||
|
{
|
||||||
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
lazy = true,
|
||||||
|
config = function()
|
||||||
|
require("ts_context_commentstring").setup({
|
||||||
|
enable_autocmd = false,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
lazy = true,
|
||||||
|
dependencies = "hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {
|
||||||
|
check_ts = true,
|
||||||
|
ts_config = {
|
||||||
|
lua = { "string", "source" },
|
||||||
|
javascript = { "string", "template_string" },
|
||||||
|
java = false,
|
||||||
|
},
|
||||||
|
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||||
|
fast_wrap = {
|
||||||
|
map = "<M-e>",
|
||||||
|
chars = { "{", "[", "(", '"', "'", "`" },
|
||||||
|
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||||
|
offset = 0, -- Offset from pattern match
|
||||||
|
end_key = "$",
|
||||||
|
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||||
|
check_comma = true,
|
||||||
|
highlight = "PmenuSel",
|
||||||
|
highlight_grey = "LineNr",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-autopairs").setup(opts)
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||||
|
if not cmp_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
|
build = ":TSUpdate",
|
||||||
|
-- event = { "LazyFile", "VeryLazy" },
|
||||||
|
lazy = true,
|
||||||
|
cmd = {
|
||||||
|
"TSInstall",
|
||||||
|
"TSUninstall",
|
||||||
|
"TSUpdate",
|
||||||
|
"TSUpdateSync",
|
||||||
|
"TSInstallInfo",
|
||||||
|
"TSInstallSync",
|
||||||
|
"TSInstallFromGrammar",
|
||||||
|
},
|
||||||
|
event = { "BufRead", "VeryLazy" },
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
ensure_installed = {},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
autopairs = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
---@type table<string, boolean>
|
||||||
|
local added = {}
|
||||||
|
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||||
|
if added[lang] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
added[lang] = true
|
||||||
|
return true
|
||||||
|
end, opts.ensure_installed)
|
||||||
|
end
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
vim.schedule(function()
|
||||||
|
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
lazy = true,
|
||||||
|
config = function()
|
||||||
|
-- When in diff mode, we want to use the default
|
||||||
|
-- vim text objects c & C instead of the treesitter ones.
|
||||||
|
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||||
|
local configs = require("nvim-treesitter.configs")
|
||||||
|
for name, fn in pairs(move) do
|
||||||
|
if name:find("goto") == 1 then
|
||||||
|
move[name] = function(q, ...)
|
||||||
|
if vim.wo.diff then
|
||||||
|
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||||
|
for key, query in pairs(config or {}) do
|
||||||
|
if q == query and key:find("[%]%[][cC]") then
|
||||||
|
vim.cmd("normal! " .. key)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return fn(q, ...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Automatically add closing tags for HTML and JSX
|
||||||
|
{
|
||||||
|
"windwp/nvim-ts-autotag",
|
||||||
|
lazy = true,
|
||||||
|
event = "BufRead",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"RRethy/vim-illuminate",
|
||||||
|
lazy = true,
|
||||||
|
event = "BufRead",
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
-- providers: provider used to get references in the buffer, ordered by priority
|
||||||
|
providers = {
|
||||||
|
"lsp",
|
||||||
|
"treesitter",
|
||||||
|
"regex",
|
||||||
|
},
|
||||||
|
-- delay: delay in milliseconds
|
||||||
|
delay = 120,
|
||||||
|
-- filetype_overrides: filetype specific overrides.
|
||||||
|
-- The keys are strings to represent the filetype while the values are tables that
|
||||||
|
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
|
||||||
|
filetype_overrides = {},
|
||||||
|
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
|
||||||
|
filetypes_denylist = {
|
||||||
|
"dirvish",
|
||||||
|
"fugitive",
|
||||||
|
"alpha",
|
||||||
|
"NvimTree",
|
||||||
|
"lazy",
|
||||||
|
"neogitstatus",
|
||||||
|
"Trouble",
|
||||||
|
"lir",
|
||||||
|
"Outline",
|
||||||
|
"spectre_panel",
|
||||||
|
"toggleterm",
|
||||||
|
"DressingSelect",
|
||||||
|
"TelescopePrompt",
|
||||||
|
},
|
||||||
|
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
|
||||||
|
filetypes_allowlist = {},
|
||||||
|
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
|
||||||
|
modes_denylist = {},
|
||||||
|
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
|
||||||
|
modes_allowlist = {},
|
||||||
|
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
|
||||||
|
-- Only applies to the 'regex' provider
|
||||||
|
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
||||||
|
providers_regex_syntax_denylist = {},
|
||||||
|
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
|
||||||
|
-- Only applies to the 'regex' provider
|
||||||
|
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
||||||
|
providers_regex_syntax_allowlist = {},
|
||||||
|
-- under_cursor: whether or not to illuminate under the cursor
|
||||||
|
under_cursor = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("illuminate").configure(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
36
lua/plugins/treesitter_blade.lua
Normal file
36
lua/plugins/treesitter_blade.lua
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
local ts_list = {
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
}
|
||||||
|
for _, ts in pairs(pcode.treesitter_ensure_installed or {}) do
|
||||||
|
table.insert(ts_list, ts)
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = ts_list,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
|
||||||
|
parser_config.blade = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/EmranMR/tree-sitter-blade",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
branch = "main",
|
||||||
|
},
|
||||||
|
filetype = "blade",
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = {
|
||||||
|
[".*%.blade%.php"] = "blade",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ local M = {}
|
||||||
|
|
||||||
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
if not status_cmp_ok then
|
if not status_cmp_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local lspvitualtext = pcode.lsp_virtualtext or false
|
local lspvitualtext = pcode.lsp_virtualtext or false
|
||||||
|
@ -13,135 +13,95 @@ M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
|
M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
|
||||||
|
|
||||||
M.setup = function()
|
M.setup = function()
|
||||||
local signs = {
|
local signs = {
|
||||||
{ name = "DiagnosticSignError", text = icons.diagnostics.Error },
|
{ name = "DiagnosticSignError", text = icons.diagnostics.Error },
|
||||||
{ name = "DiagnosticSignWarn", text = icons.diagnostics.Warning },
|
{ name = "DiagnosticSignWarn", text = icons.diagnostics.Warning },
|
||||||
{ name = "DiagnosticSignHint", text = icons.diagnostics.Hint },
|
{ name = "DiagnosticSignHint", text = icons.diagnostics.Hint },
|
||||||
{ name = "DiagnosticSignInfo", text = icons.diagnostics.Info },
|
{ name = "DiagnosticSignInfo", text = icons.diagnostics.Info },
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, sign in ipairs(signs) do
|
for _, sign in ipairs(signs) do
|
||||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||||
end
|
end
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
virtual_text = lspvitualtext, -- disable virtual text
|
virtual_text = lspvitualtext, -- disable virtual text
|
||||||
signs = {
|
signs = {
|
||||||
active = signs, -- show signs
|
active = signs, -- show signs
|
||||||
},
|
},
|
||||||
update_in_insert = true,
|
update_in_insert = true,
|
||||||
underline = true,
|
underline = true,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
float = {
|
float = {
|
||||||
focusable = true,
|
focusable = true,
|
||||||
style = "minimal",
|
style = "minimal",
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
source = "always",
|
source = "always",
|
||||||
header = "",
|
header = "",
|
||||||
prefix = "",
|
prefix = "",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.diagnostic.config(config)
|
vim.diagnostic.config(config)
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function attach_navic(client, bufnr)
|
local function attach_navic(client, bufnr)
|
||||||
vim.g.navic_silence = true
|
vim.g.navic_silence = true
|
||||||
local status_ok, navic = pcall(require, "nvim-navic")
|
local status_ok, navic = pcall(require, "nvim-navic")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
navic.attach(client, bufnr)
|
navic.attach(client, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FORMAT_FILTER(client)
|
local function lsp_keymaps(bufnr)
|
||||||
local filetype = vim.bo.filetype
|
local opts = { noremap = true, silent = true }
|
||||||
local n = require("null-ls")
|
local keymap = vim.api.nvim_buf_set_keymap
|
||||||
local s = require("null-ls.sources")
|
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||||
local method = n.methods.FORMATTING
|
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
local available_formatters = s.get_available(filetype, method)
|
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
if #available_formatters > 0 then
|
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||||
return client.name == "null-ls"
|
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||||
elseif client.supports_method("textDocument/formatting") then
|
keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
||||||
return true
|
keymap(bufnr, "n", "<leader>li", "<cmd>LspInfo<cr>", opts)
|
||||||
else
|
keymap(bufnr, "n", "<leader>lI", "<cmd>Mason<cr>", opts)
|
||||||
return false
|
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||||
end
|
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
||||||
end
|
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||||
-- stylua: ignore
|
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
local function lsp_keymaps(bufnr, on_save)
|
keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
local keymap = vim.api.nvim_buf_set_keymap
|
|
||||||
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>li", "<cmd>LspInfo<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lI", "<cmd>Mason<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
|
||||||
keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
|
||||||
if on_save then
|
|
||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
|
||||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format({ bufnr = bufnr, timeout_ms = pcode.format_timeout_ms or 5000, filter = FORMAT_FILTER })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
else
|
|
||||||
vim.schedule(function()
|
|
||||||
pcall(function()
|
|
||||||
vim.api.nvim_clear_autocmds({ group = "LspFormatting" })
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
M.on_attach = function(client, bufnr)
|
M.on_attach = function(client, bufnr)
|
||||||
attach_navic(client, bufnr)
|
attach_navic(client, bufnr)
|
||||||
if client.name == "tsserver" then
|
if client.name == "tsserver" then
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.name == "lua_ls" then
|
if client.name == "lua_ls" then
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.supports_method("textDocument/inlayHint") then
|
if client.supports_method("textDocument/inlayHint") then
|
||||||
-- vim.lsp.inlay_hint.enable(bufnr, true)
|
-- vim.lsp.inlay_hint.enable(bufnr, true)
|
||||||
vim.lsp.inlay_hint.enable(true)
|
vim.lsp.inlay_hint.enable(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_save = pcode.format_on_save or false
|
lsp_keymaps(bufnr)
|
||||||
-- disable if conform active
|
local status_ok, illuminate = pcall(require, "illuminate")
|
||||||
local status, _ = pcall(require, "conform")
|
if not status_ok then
|
||||||
if status then
|
return
|
||||||
on_save = false
|
end
|
||||||
end
|
illuminate.on_attach(client)
|
||||||
lsp_keymaps(bufnr, on_save)
|
|
||||||
local status_ok, illuminate = pcall(require, "illuminate")
|
|
||||||
if not status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
illuminate.on_attach(client)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,41 +1,38 @@
|
||||||
-- https://luals.github.io/wiki/settings/
|
-- https://luals.github.io/wiki/settings/
|
||||||
return {
|
return {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
format = {
|
format = {
|
||||||
enable = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim", "spec" },
|
globals = { "vim", "spec" },
|
||||||
},
|
},
|
||||||
runtime = {
|
runtime = {
|
||||||
version = "LuaJIT",
|
version = "LuaJIT",
|
||||||
special = {
|
special = {
|
||||||
spec = "require",
|
spec = "require",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- workspace = {
|
workspace = {
|
||||||
-- checkThirdParty = false,
|
checkThirdParty = false,
|
||||||
-- 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,
|
||||||
-- },
|
},
|
||||||
-- },
|
},
|
||||||
workspace = {
|
hint = {
|
||||||
checkThirdParty = false,
|
enable = false,
|
||||||
},
|
arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable"
|
||||||
hint = {
|
await = true,
|
||||||
enable = false,
|
paramName = "Disable", -- "All" | "Literal" | "Disable"
|
||||||
arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable"
|
paramType = true,
|
||||||
await = true,
|
semicolon = "All", -- "All" | "SameLine" | "Disable"
|
||||||
paramName = "Disable", -- "All" | "Literal" | "Disable"
|
setType = false,
|
||||||
paramType = true,
|
},
|
||||||
semicolon = "All", -- "All" | "SameLine" | "Disable"
|
telemetry = {
|
||||||
setType = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
telemetry = {
|
},
|
||||||
enable = false,
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
return {
|
return {
|
||||||
filetypes = { "blade" },
|
|
||||||
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
|
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
|
||||||
singe_file_support = true,
|
singe_file_support = true,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
local ok, null_ls = pcall(require, "null-ls")
|
local null_ls = require("null-ls")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.list_registered = function(filetype)
|
M.list_registered = function(filetype)
|
||||||
if ok then
|
local method = null_ls.methods.FORMATTING
|
||||||
local method = null_ls.methods.FORMATTING
|
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
return registered_providers[method] or {}
|
||||||
return registered_providers[method] or {}
|
|
||||||
else
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
M.list_registered_all = function()
|
M.list_registered_all = function()
|
||||||
|
|
|
@ -1,27 +1,19 @@
|
||||||
local ok, null_ls = pcall(require, "null-ls")
|
local null_ls = require("null-ls")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
if ok then
|
M.alternative_methods = {
|
||||||
M.alternative_methods = {
|
null_ls.methods.DIAGNOSTICS,
|
||||||
null_ls.methods.DIAGNOSTICS,
|
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
M.alternative_methods = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
M.linter_list_registered = function(filetype)
|
M.linter_list_registered = function(filetype)
|
||||||
if ok then
|
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
||||||
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
return registered_providers[m] or {}
|
||||||
return registered_providers[m] or {}
|
end, M.alternative_methods))
|
||||||
end, M.alternative_methods))
|
|
||||||
|
|
||||||
return providers_for_methods
|
return providers_for_methods
|
||||||
else
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -93,8 +93,7 @@ return {
|
||||||
if type(msg) == "boolean" or #msg == 0 then
|
if type(msg) == "boolean" or #msg == 0 then
|
||||||
return "LSP Inactive"
|
return "LSP Inactive"
|
||||||
end
|
end
|
||||||
-- return msg
|
return msg
|
||||||
table.insert(buf_client_names, msg)
|
|
||||||
end
|
end
|
||||||
-- add client
|
-- add client
|
||||||
for _, client in pairs(buf_clients) do
|
for _, client in pairs(buf_clients) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue