nvim: Better typescript support
This commit is contained in:
parent
e39b03a277
commit
4911861557
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
vim.diagnostic.config({ virtual_text = true })
|
||||
|
||||
local lsp = require('lsp-zero').preset({})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
|
@ -27,6 +29,13 @@ cmp.setup({
|
|||
}
|
||||
})
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
lsp.ensure_installed({
|
||||
'ts_ls',
|
||||
})
|
||||
|
||||
>>>>>>> ca495fe (nvim: Better typescript support)
|
||||
local null_ls = require('null-ls')
|
||||
local null_opts = lsp.build_options('null-ls', {})
|
||||
|
||||
|
|
8
_config/nvim/plugin/typescript.lua
Normal file
8
_config/nvim/plugin/typescript.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig.ts_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
-- Disable tsserver formatting if using prettier/eslint
|
||||
client.server_capabilities.documentFormattingProvider = true
|
||||
end,
|
||||
})
|
Loading…
Add table
Reference in a new issue