aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/lsp/servers.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-09-18 23:13:11 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-09-18 23:13:11 +0200
commitaf18201866ea29d179fd61bacd36b849a7d86a7d (patch)
treef91a593c1eac7e5cee50ed470fde903e0ae7ad17 /lua/alpha/lsp/servers.lua
parentf64a1630423087bb020c2c0ea341136abd725c38 (diff)
downloadnvim-conf-af18201866ea29d179fd61bacd36b849a7d86a7d.tar.gz
nvim-conf-af18201866ea29d179fd61bacd36b849a7d86a7d.zip
refactor lsp configurations
Diffstat (limited to 'lua/alpha/lsp/servers.lua')
-rw-r--r--lua/alpha/lsp/servers.lua173
1 files changed, 0 insertions, 173 deletions
diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua
deleted file mode 100644
index e9acc4b..0000000
--- a/lua/alpha/lsp/servers.lua
+++ /dev/null
@@ -1,173 +0,0 @@
-local lsp_attach = require "alpha.lsp.attach"
-
-local lsp_flags = {
- debounce_text_changes = 150,
-}
-
-local default = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- }
-end
-
-return {
- ["emmet_ls"] = function()
- local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
-
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- capabilities = capabilities,
- filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
- }
- end,
- ["gopls"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- }
- end,
- ["html"] = function()
- local config = {
- on_attach = lsp_attach,
- flags = lsp_flags,
- }
- if vim.fn.executable "html-languageserver" == 1 then
- config.cmd = { "html-languageserver", "--stdio" }
- end
-
- return config
- end,
- ["jsonls"] = function()
- local config = {
- on_attach = lsp_attach,
- flags = lsp_flags,
- }
- if vim.fn.executable "json-languageserver" == 1 then
- config.cmd = { "json-languageserver", "--stdio" }
- end
-
- return config
- end,
- ["lua_ls"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- Lua = {
- runtime = {
- version = "LuaJIT",
- },
- diagnostics = {
- globals = { "vim" },
- },
- workspace = {
- library = vim.api.nvim_get_runtime_file("", true),
- checkThirdParty = false,
- },
- telemetry = {
- enable = false,
- },
- hint = {
- enable = true,
- },
- },
- },
- }
- end,
- ["omnisharp"] = function()
- return {
- cmd = { "OmniSharp" },
- on_attach = lsp_attach,
- flags = lsp_flags,
- }
- end,
- ["nil_ls"] = default,
- ["phpactor"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- filetypes = { "php" },
- init_options = {
- ["language_server_worse_reflection.inlay_hints.enable"] = true,
- ["language_server_worse_reflection.inlay_hints.params"] = true,
- -- ["language_server_worse_reflection.inlay_hints.types"] = true,
- ["language_server_configuration.auto_config"] = false,
- ["code_transform.import_globals"] = true,
- ["language_server_phpstan.enabled"] = true,
- ["language_server_phpstan.level"] = 7,
- ["language_server_phpstan.bin"] = "phpstan",
- },
- handlers = {
- ["textDocument/inlayHint"] = function(err, result, ...)
- for _, res in ipairs(result) do
- res.label = res.label .. ": "
- end
- vim.lsp.handlers["textDocument/inlayHint"](err, result, ...)
- end,
- },
- }
- end,
- ["pyright"] = default,
- ["rust_analyzer"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- ["rust-analyzer"] = {
- checkOnSave = {
- allFeatures = true,
- overrideCommand = {
- "cargo",
- "clippy",
- "--workspace",
- "--message-format=json",
- "--all-targets",
- "--all-features",
- },
- },
- },
- },
- }
- end,
- ["svelte"] = default,
- ["tailwindcss"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- filetypes = { "blade", "html", "svelte" },
- }
- end,
- ["tsserver"] = function()
- return {
- on_attach = lsp_attach,
- flags = lsp_flags,
- settings = {
- typescript = {
- inlayHints = {
- includeInlayParameterNameHints = "all",
- includeInlayParameterNameHintsWhenArgumentMatchesName = false,
- includeInlayFunctionParameterTypeHints = true,
- includeInlayVariableTypeHints = true,
- includeInlayPropertyDeclarationTypeHints = true,
- includeInlayFunctionLikeReturnTypeHints = true,
- includeInlayEnumMemberValueHints = true,
- },
- },
- javascript = {
- inlayHints = {
- includeInlayParameterNameHints = "all",
- includeInlayParameterNameHintsWhenArgumentMatchesName = false,
- includeInlayFunctionParameterTypeHints = true,
- includeInlayVariableTypeHints = true,
- includeInlayPropertyDeclarationTypeHints = true,
- includeInlayFunctionLikeReturnTypeHints = true,
- includeInlayEnumMemberValueHints = true,
- },
- },
- },
- }
- end,
- ["volar"] = default,
-}