Last active: a year ago
organize imports for tsc server
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
}
vim.lsp.buf.execute_command(params)
end
lspconfig.tsserver.setup {
on_attach = on_attach,
capabilities = capabilities,
init_options = {
preferences = {
disableSuggestions = true,
},
},
commands = {
OrganizeImports = {
organize_imports,
description = "Organize Imports",
},
},
}