nvimrc: add basic tsserver setup
This commit is contained in:
parent
9f65809479
commit
9fb1a834d6
40
nvimrc
40
nvimrc
|
@ -632,6 +632,46 @@ nvim_lsp.solargraph.setup{
|
|||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
-- Typescript
|
||||
-- https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c
|
||||
|
||||
nvim_lsp.tsserver.setup{
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
local filetypes = {
|
||||
typescript = "eslint",
|
||||
typescriptreact = "eslint",
|
||||
}
|
||||
local linters = {
|
||||
eslint = {
|
||||
sourceName = "eslint",
|
||||
command = "eslint",
|
||||
rootPatterns = {".eslintrc.js", "package.json"},
|
||||
debounce = 100,
|
||||
args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"},
|
||||
parseJson = {
|
||||
errorsRoot = "[0].messages",
|
||||
line = "line",
|
||||
column = "column",
|
||||
endLine = "endLine",
|
||||
endColumn = "endColumn",
|
||||
message = "${message} [${ruleId}]",
|
||||
security = "severity"
|
||||
},
|
||||
securities = {[1] = "error", [2] = "warning"}
|
||||
}
|
||||
}
|
||||
|
||||
nvim_lsp.diagnosticls.setup{
|
||||
on_attach = on_attach,
|
||||
filetypes = vim.tbl_keys(filetypes),
|
||||
init_options = {
|
||||
linters = linters,
|
||||
filetypes = filetypes,
|
||||
}
|
||||
}
|
||||
|
||||
-- Lua
|
||||
|
||||
local system_name
|
||||
|
|
Loading…
Reference in New Issue