chore(nvim): lsp config tweaks, add neoconf, ts_ls

This commit is contained in:
2024-10-24 01:49:06 +03:00
parent fdd713908c
commit dfbac0c736

View File

@@ -19,6 +19,11 @@ capabilities.textDocument.foldingRange = {
} }
return { return {
{
'folke/neoconf.nvim',
cmd = 'Neoconf',
opts = {},
},
-- Portable package manager for Neovim that runs everywhere Neovim runs. -- Portable package manager for Neovim that runs everywhere Neovim runs.
-- Easily install and manage LSP servers, DAP servers, linters, and formatters. -- Easily install and manage LSP servers, DAP servers, linters, and formatters.
-- https://github.com/williamboman/mason.nvim -- https://github.com/williamboman/mason.nvim
@@ -31,15 +36,12 @@ return {
-- Mason servers to install -- Mason servers to install
-- See: https://mason-registry.dev/registry/list -- See: https://mason-registry.dev/registry/list
ensure_installed = { ensure_installed = {
'bash-language-server',
'clang-format', 'clang-format',
'codespell', 'codespell',
'commitlint', 'commitlint',
'diagnostic-languageserver',
'editorconfig-checker', 'editorconfig-checker',
'fixjson', 'fixjson',
'jsonlint', 'jsonlint',
'lua-language-server',
'luacheck', 'luacheck',
'phpcbf', 'phpcbf',
'phpcs', 'phpcs',
@@ -48,8 +50,6 @@ return {
'shellcheck', 'shellcheck',
'shfmt', 'shfmt',
'stylua', 'stylua',
'vim-language-server',
'vue-language-server',
'yamllint', 'yamllint',
}, },
}, },
@@ -64,13 +64,16 @@ return {
ensure_installed = { ensure_installed = {
'bashls', 'bashls',
-- 'csharp_ls', -- 'csharp_ls',
'diagnosticls',
'gopls', 'gopls',
'html', 'html',
'intelephense', 'intelephense',
'jsonls',
'lua_ls',
'tailwindcss', 'tailwindcss',
'ts_ls', 'ts_ls',
'lua_ls', 'vimls',
'jsonls', 'volar',
}, },
automatic_installation = true, automatic_installation = true,
handlers = { handlers = {
@@ -184,14 +187,34 @@ return {
}, },
} }
end, end,
['ts_ls'] = function()
local mason_registry = require 'mason-registry'
local ts_plugin_location = mason_registry
.get_package('vue-language-server')
:get_install_path() .. '/node_modules/@vue/typescript-plugin'
require('lspconfig')['volar'].setup {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = ts_plugin_location,
languages = { 'javascript', 'typescript', 'vue' },
},
},
},
filetypes = {
'typescript',
'javascript',
'javascriptreact',
'typescriptreact',
'vue',
},
}
end,
}, },
}, },
}, },
-- Automatically install formatters registered with conform.nvim via mason.nvim
-- https://github.com/zapling/mason-conform.nvim
-- { 'zapling/mason-conform.nvim', opts = {} },
-- ── Misc ─────────────────────────────────────────────────── -- ── Misc ───────────────────────────────────────────────────
-- vscode-like pictograms for neovim lsp completion items -- vscode-like pictograms for neovim lsp completion items
-- https://github.com/onsails/lspkind-nvim -- https://github.com/onsails/lspkind-nvim
@@ -203,7 +226,7 @@ return {
-- ── LSP ──────────────────────────────────────────────────── -- ── LSP ────────────────────────────────────────────────────
-- Quick start configs for Nvim LSP -- Quick start configs for Nvim LSP
-- https://github.com/neovim/nvim-lspconfig -- https://github.com/neovim/nvim-lspconfig
{ 'neovim/nvim-lspconfig' }, { 'neovim/nvim-lspconfig', dependencies = { 'folke/neoconf.nvim' } },
-- Garbage collector that stops inactive LSP clients to free RAM -- Garbage collector that stops inactive LSP clients to free RAM
-- https://github.com/Zeioth/garbage-day.nvim -- https://github.com/Zeioth/garbage-day.nvim