aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-04-04 18:33:40 +0200
committerGitHub <noreply@github.com>2021-04-04 18:33:40 +0200
commit98cf5f41c9a925a92363d94a48776514510a83ff (patch)
tree9a9e7dbd03ea2ef6c0b003335fc3d0bbac9b791d /lua/nvim-lsp-installer/installers
parentinit (diff)
downloadmason-98cf5f41c9a925a92363d94a48776514510a83ff.tar
mason-98cf5f41c9a925a92363d94a48776514510a83ff.tar.gz
mason-98cf5f41c9a925a92363d94a48776514510a83ff.tar.bz2
mason-98cf5f41c9a925a92363d94a48776514510a83ff.tar.lz
mason-98cf5f41c9a925a92363d94a48776514510a83ff.tar.xz
mason-98cf5f41c9a925a92363d94a48776514510a83ff.tar.zst
mason-98cf5f41c9a925a92363d94a48776514510a83ff.zip
update README and change get_installed_servers() return value (#1)
Diffstat (limited to 'lua/nvim-lsp-installer/installers')
-rw-r--r--lua/nvim-lsp-installer/installers/typescript-ls.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/lua/nvim-lsp-installer/installers/typescript-ls.lua b/lua/nvim-lsp-installer/installers/typescript-ls.lua
index c8b2c03e..eef82503 100644
--- a/lua/nvim-lsp-installer/installers/typescript-ls.lua
+++ b/lua/nvim-lsp-installer/installers/typescript-ls.lua
@@ -16,8 +16,8 @@ return installer.create_lsp_config_installer {
local old_uri = vim.uri_from_fname(old)
local new_uri = vim.uri_from_fname(new)
- -- maybe filter by client name, only send to tsserver?
- for _, client in ipairs(vim.lsp.get_active_clients()) do
+ -- TODO: send only to tsserver
+ for _, client in pairs(vim.lsp.get_active_clients()) do
client.request(
'workspace/executeCommand',
{
@@ -31,6 +31,20 @@ return installer.create_lsp_config_installer {
}
)
end
- end
+ end,
+ organize_imports = function(bufname)
+ bufname = bufname or vim.api.nvim_buf_get_name(0)
+
+ -- TODO: send only to tsserver
+ for _, client in pairs(vim.lsp.get_active_clients()) do
+ client.request(
+ 'workspace/executeCommand',
+ {
+ command = '_typescript.organizeImports',
+ arguments = {bufname},
+ }
+ )
+ end
+ end,
}
}