diff options
| author | William Boman <william@redwill.se> | 2021-10-26 09:47:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-26 09:47:20 +0200 |
| commit | c7ef12d8f99490c984ec171c7341577513b435a8 (patch) | |
| tree | aea6fa17846dbc45c832fa28da1025ef03861d31 /lua/nvim-lsp-installer/server.lua | |
| parent | mac's not fun (diff) | |
| download | mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar.gz mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar.bz2 mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar.lz mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar.xz mason-c7ef12d8f99490c984ec171c7341577513b435a8.tar.zst mason-c7ef12d8f99490c984ec171c7341577513b435a8.zip | |
add synchronous variants of commands for better headless interop (#189)
Diffstat (limited to 'lua/nvim-lsp-installer/server.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/server.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index f1e0fdef..b1081d7a 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -65,10 +65,12 @@ function M.Server:setup(opts) end end +---@return table @A deep copy of this server's default options. Note that these default options are nvim-lsp-installer specific, and does not include any default options provided by lspconfig. function M.Server:get_default_options() return vim.deepcopy(self._default_options) end +---@return string[] @The list of supported filetypes. function M.Server:get_supported_filetypes() local metadata = require "nvim-lsp-installer._generated.metadata" @@ -79,6 +81,7 @@ function M.Server:get_supported_filetypes() return {} end +---@return boolean function M.Server:is_installed() return servers.is_server_installed(self.name) end @@ -87,10 +90,13 @@ function M.Server:create_root_dir() fs.mkdirp(self.root_dir) end +---Queues the server to be asynchronously installed. Also opens the UI window. function M.Server:install() status_win().install_server(self) end +---@param context ServerInstallContext +---@param callback ServerInstallCallback function M.Server:install_attached(context, callback) local uninstall_ok, uninstall_err = pcall(self.uninstall, self) if not uninstall_ok then |
