nvim/lua/plugins/lspconfig.lua

62 lines
2.0 KiB
Lua
Raw Normal View History

2023-02-14 16:40:45 +07:00
-- Инициализация "neovim/nvim-lspconfig"
local lspconfig = require('lspconfig')
-- Активация вещания готовых набросков
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- Инициализация "ms-jpq/coq_nvim"
2023-02-11 19:56:38 +07:00
local coq = require('coq')
-- Инициализация LSP-серверов
-- Инициализация "psalm" (LSP-сервер для PHP)
--[[ lspconfig.psalm.setup({
2023-02-11 19:56:38 +07:00
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
}) ]]
-- Инициализация "intelephense" (LSP-сервер для PHP)
lspconfig.intelephense.setup({
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
-- Инициализация "vscode-html-language-server" (готовый набросок для HTML)
lspconfig.html.setup({
2023-02-14 16:40:45 +07:00
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
-- Инициализация "vscode-html-language-server" (готовый набросок для CSS)
lspconfig.cssls.setup({
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
2023-02-14 16:40:45 +07:00
-- Инициализация "vscode-langservers-extracted" (готовый набросок для JavaScript и PostScript)
lspconfig.eslint.setup({
on_attach = function(client, bufnr)
-- Инициализация команды "EslintFixAll"
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
command = "EslintFixAll",
})
-- Вызов глобальной функции
lspconfig_on_attach(client, bufnr)
end,
coq.lsp_ensure_capabilities()
2023-02-14 16:40:45 +07:00
})
-- Инициализация "vscode-langservers-extracted" (готовый набросок для JSON)
lspconfig.jsonls.setup({
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})