tsserver vue
This commit is contained in:
@@ -28,7 +28,7 @@ vim.g.mapleader = ' '
|
||||
vim.o.termguicolors = true
|
||||
|
||||
vim.o.list = true
|
||||
vim.opt.listchars:append 'space:◦'
|
||||
vim.opt.listchars:append 'space:·'
|
||||
vim.opt.listchars:append 'tab:┊ '
|
||||
-- vim.opt.listchars:append 'eol:↴'
|
||||
|
||||
|
@@ -15,7 +15,6 @@ local servers = {
|
||||
'lua_ls',
|
||||
'bashls',
|
||||
'clangd',
|
||||
-- 'clang-format',
|
||||
'cmake',
|
||||
'html',
|
||||
'tsserver',
|
||||
@@ -32,10 +31,10 @@ local on_attach = function(_, bufnr)
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action)
|
||||
|
||||
-- LSP functionality
|
||||
vim.keymap.set('n', 'gI', vim.lsp.buf.implementation)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition)
|
||||
vim.keymap.set('n', 'gy', vim.lsp.buf.type_definition)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help)
|
||||
end
|
||||
@@ -62,6 +61,7 @@ mason_lspconfig.setup_handlers {
|
||||
settings = {}
|
||||
}
|
||||
|
||||
-- LUA.
|
||||
if server_name == 'lua_ls' then
|
||||
config.settings = {
|
||||
Lua = {
|
||||
@@ -77,8 +77,27 @@ mason_lspconfig.setup_handlers {
|
||||
lspconfig[server_name].setup(config)
|
||||
end
|
||||
|
||||
-- TSSERVER.
|
||||
if server_name == 'tsserver' then
|
||||
config.init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = '@vue/typescript-plugin',
|
||||
location = '/home/antoxa/.nvm/versions/node/v20.12.0/lib/node_modules/@vue/typescript-plugin',
|
||||
languages = { 'javascript', 'typescript', 'vue' },
|
||||
},
|
||||
},
|
||||
}
|
||||
config.filetypes = {
|
||||
'javascript',
|
||||
'typescript',
|
||||
'vue',
|
||||
}
|
||||
end
|
||||
|
||||
-- GRAPHQL.
|
||||
if server_name == 'graphql' then
|
||||
config.filetypes = { 'graphql', 'typescript', 'javascript' }
|
||||
config.filetypes = { 'graphql' }
|
||||
end
|
||||
|
||||
lspconfig[server_name].setup(config)
|
||||
|
@@ -11,6 +11,7 @@ null_ls.setup {
|
||||
sources = {
|
||||
formatting.clang_format.with({
|
||||
extra_args = {
|
||||
-- '--style=Google'
|
||||
'--assume-filename=' .. clang_format_config
|
||||
}
|
||||
}),
|
||||
|
Reference in New Issue
Block a user