This commit is contained in:
2025-02-17 14:48:13 +01:00
parent 6a60d395c2
commit 265cc9f642
3 changed files with 44 additions and 11 deletions

View File

@@ -130,24 +130,26 @@ return {
on_attach = on_attach,
})
lspconfig.ts_ls.setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- lspconfig.ts_ls.setup({
-- capabilities = capabilities,
-- on_attach = on_attach,
-- })
-- local mason_registry = require('mason-registry')
-- local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() .. '/node_modules/@vue/language-server'
--
-- lspconfig.volar.setup({
-- capabilities = capabilities,
-- on_attach = on_attach,
-- cmd = { "vue-language-server", "--stdio" },
-- -- cmd = { "vue-language-server", "--stdio" },
-- filetypes = { "vue" },
-- settings = {
-- typescript = {
-- tsdk = '/usr/lib/node_modules/typescript/lib'
-- }
-- }
-- -- settings = {
-- -- typescript = {
-- -- tsdk = '/usr/lib/node_modules/typescript/lib'
-- -- }
-- -- }
-- })
-- done in ftplugin
lspconfig.jdtls.setup({
capabilities = capabilities,
on_attach = on_attach,

View File

@@ -0,0 +1,30 @@
return {
'pmizio/typescript-tools.nvim',
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
opts = {},
ft = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' },
config = function()
require('typescript-tools').setup {
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
'vue',
},
settings = {
tsserver_plugins = {
'@vue/typescript-plugin',
},
jsx_close_tag = {
enable = true,
filetypes = { 'javascriptreact', 'typescriptreact' },
},
},
}
end,
}