2023-02-14 16:40:45 +07:00
|
|
|
-- Инициализация "neovim/nvim-lspconfig"
|
|
|
|
local lspconfig = require('lspconfig')
|
|
|
|
|
2023-03-21 03:26:16 +07:00
|
|
|
-- Активация вещания готовых набросков
|
2023-02-14 05:12:39 +07:00
|
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
|
|
|
2023-02-14 04:58:56 +07:00
|
|
|
-- Инициализация "ms-jpq/coq_nvim"
|
2023-02-11 19:56:38 +07:00
|
|
|
local coq = require('coq')
|
|
|
|
|
2023-02-14 04:58:56 +07:00
|
|
|
-- Инициализация LSP-серверов
|
|
|
|
|
2023-03-27 00:53:14 +07:00
|
|
|
-- Инициализация "bmewburn/vscode-intelephense" (LSP-сервер для PHP)
|
2023-02-23 05:08:31 +07:00
|
|
|
lspconfig.intelephense.setup({
|
|
|
|
on_attach = lspconfig_on_attach,
|
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
2023-02-22 22:29:44 +07:00
|
|
|
})
|
2023-02-14 05:12:39 +07:00
|
|
|
|
2023-03-21 03:26:16 +07:00
|
|
|
-- Инициализация "hrsh7th/vscode-html-language-server" (LSP-сервер для HTML)
|
2023-02-22 22:29:44 +07:00
|
|
|
lspconfig.html.setup({
|
2023-03-21 03:26:16 +07:00
|
|
|
init_options = {
|
|
|
|
configurationSection = { 'html' },
|
|
|
|
embeddedLanguages = {
|
|
|
|
css = false,
|
|
|
|
javascript = false
|
|
|
|
},
|
|
|
|
provideFormatter = true,
|
|
|
|
},
|
2023-02-14 16:40:45 +07:00
|
|
|
on_attach = lspconfig_on_attach,
|
2023-02-23 05:08:31 +07:00
|
|
|
coq.lsp_ensure_capabilities(),
|
2023-02-14 05:12:39 +07:00
|
|
|
capabilities = capabilities
|
2023-02-22 22:29:44 +07:00
|
|
|
})
|
|
|
|
|
2023-03-21 03:26:16 +07:00
|
|
|
-- Инициализация "aca/emmet-ls" (LSP-сервер для HTML)
|
|
|
|
lspconfig.emmet_ls.setup({
|
|
|
|
init_options = {
|
|
|
|
html = {
|
|
|
|
options = {
|
|
|
|
["bem.enabled"] = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on_attach = lspconfig_on_attach,
|
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
|
|
|
})
|
|
|
|
|
2023-03-27 00:53:14 +07:00
|
|
|
-- Инициализация "hrsh7th/vscode-langservers-extracted" (LSP-сервер для CSS)
|
2023-02-22 22:29:44 +07:00
|
|
|
lspconfig.cssls.setup({
|
2023-03-21 03:26:16 +07:00
|
|
|
settings = {
|
|
|
|
css = {
|
|
|
|
validate = true
|
|
|
|
},
|
|
|
|
less = {
|
|
|
|
validate = true
|
|
|
|
},
|
|
|
|
scss = {
|
|
|
|
validate = true
|
|
|
|
}
|
|
|
|
},
|
2023-02-22 22:29:44 +07:00
|
|
|
on_attach = lspconfig_on_attach,
|
2023-02-23 05:08:31 +07:00
|
|
|
coq.lsp_ensure_capabilities(),
|
2023-02-22 22:29:44 +07:00
|
|
|
capabilities = capabilities
|
|
|
|
})
|
2023-02-14 16:40:45 +07:00
|
|
|
|
2023-03-21 03:26:16 +07:00
|
|
|
-- Инициализация "antonk52/cssmodules-language-server" (LSP-сервер для JS, вспомогательный для CSS)
|
|
|
|
lspconfig.cssmodules_ls.setup({
|
|
|
|
init_options = {
|
|
|
|
camelCase = false,
|
|
|
|
},
|
|
|
|
on_attach = lspconfig_on_attach,
|
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Инициализация "denoland/deno" (LSP-сервер для JavaScript и PostScript)
|
2023-02-26 20:05:20 +07:00
|
|
|
lspconfig.denols.setup({
|
2023-03-21 03:26:16 +07:00
|
|
|
init_options = {
|
|
|
|
enable = true,
|
|
|
|
unstable = false
|
|
|
|
},
|
2023-02-26 20:05:20 +07:00
|
|
|
on_attach = lspconfig_on_attach,
|
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
2023-02-14 16:40:45 +07:00
|
|
|
})
|
2023-02-22 22:29:44 +07:00
|
|
|
|
2023-03-21 03:26:16 +07:00
|
|
|
-- Инициализация "hrsh7th/vscode-langservers-extracted" (LSP-сервер для JSON)
|
2023-02-22 22:29:44 +07:00
|
|
|
lspconfig.jsonls.setup({
|
|
|
|
on_attach = lspconfig_on_attach,
|
2023-02-23 05:08:31 +07:00
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
2023-02-22 22:29:44 +07:00
|
|
|
})
|
2023-03-21 03:26:16 +07:00
|
|
|
|
|
|
|
-- Инициализация "luals/lua-language-server" (LSP-сервер для Lua)
|
|
|
|
lspconfig.lua_ls.setup({
|
|
|
|
settings = {
|
|
|
|
Lua = {
|
|
|
|
runtime = {
|
|
|
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
|
|
|
version = 'LuaJIT',
|
|
|
|
},
|
|
|
|
diagnostics = {
|
|
|
|
-- Get the language server to recognize the `vim` global
|
|
|
|
globals = { 'vim' },
|
|
|
|
},
|
|
|
|
workspace = {
|
|
|
|
-- Make the server aware of Neovim runtime files
|
|
|
|
library = vim.api.nvim_get_runtime_file("", true),
|
|
|
|
},
|
|
|
|
-- Do not send telemetry data containing a randomized but unique identifier
|
|
|
|
telemetry = {
|
|
|
|
enable = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on_attach = lspconfig_on_attach,
|
|
|
|
coq.lsp_ensure_capabilities(),
|
|
|
|
capabilities = capabilities
|
|
|
|
})
|