added lsp server settings for typescript and eslint
This commit is contained in:
parent
c627ddaa7f
commit
53e82142f3
@ -67,6 +67,52 @@ local servers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
ts_ls = {
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = "all",
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
javascript = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = "all",
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
completions = {
|
||||||
|
completeFunctionCalls = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
capabilities = {
|
||||||
|
documentFormattingProvider = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
eslint = {
|
||||||
|
settings = {
|
||||||
|
format = false,
|
||||||
|
codeAction = {
|
||||||
|
disableRuleComment = {
|
||||||
|
enable = true,
|
||||||
|
location = "separateLine",
|
||||||
|
},
|
||||||
|
showDocumentation = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
packageManager = "npm",
|
||||||
|
onIgnoredFiles = "off",
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
buffer = bufnr,
|
||||||
|
command = "EslintFixAll",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
@ -81,9 +127,6 @@ require("mason-lspconfig").setup({
|
|||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||||
if server_name == "jdtls" then
|
|
||||||
require("java").setup()
|
|
||||||
end
|
|
||||||
require("lspconfig")[server_name].setup(server)
|
require("lspconfig")[server_name].setup(server)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user