nvim/lua/plugins/lspconfig.lua

121 lines
3.3 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-серверов
2023-03-27 00:53:14 +07:00
-- Инициализация "bmewburn/vscode-intelephense" (LSP-сервер для PHP)
lspconfig.intelephense.setup({
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
-- Инициализация "hrsh7th/vscode-html-language-server" (LSP-сервер для HTML)
lspconfig.html.setup({
init_options = {
configurationSection = { 'html' },
embeddedLanguages = {
css = false,
javascript = false
},
provideFormatter = true,
},
2023-02-14 16:40:45 +07:00
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
-- Инициализация "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)
lspconfig.cssls.setup({
settings = {
css = {
validate = true
},
less = {
validate = true
},
scss = {
validate = true
}
},
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
2023-02-14 16:40:45 +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)
lspconfig.denols.setup({
init_options = {
enable = true,
unstable = false
},
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
2023-02-14 16:40:45 +07:00
})
-- Инициализация "hrsh7th/vscode-langservers-extracted" (LSP-сервер для JSON)
lspconfig.jsonls.setup({
on_attach = lspconfig_on_attach,
coq.lsp_ensure_capabilities(),
capabilities = capabilities
})
-- Инициализация "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
})