mirror of
https://github.com/tuxdotrs/tnvim.git
synced 2025-07-08 22:16:35 +05:30
update nvim config
This commit is contained in:
@ -1,32 +1,36 @@
|
||||
local configs = require "plugins.configs.lspconfig"
|
||||
local configs = require("plugins.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
-- local util = require "lspconfig/util"
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
title = "",
|
||||
}
|
||||
vim.lsp.buf.execute_command(params)
|
||||
end
|
||||
|
||||
-- lspconfig.gopls.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { "gopls" },
|
||||
-- filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
-- root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- completeUnimported = true,
|
||||
-- usePlaceholders = true,
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
for _, lsp in ipairs(servers) do
|
||||
if lsp == "tsserver" then
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
commands = {
|
||||
OrganizeImports = {
|
||||
organize_imports,
|
||||
description = "Organize Imports",
|
||||
},
|
||||
},
|
||||
})
|
||||
else
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user