From 97c92eaa217608d2b338babf3de85e39f352d8ea Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 12 Jun 2021 00:29:20 +0200 Subject: Server: add get_default_options() method Closes #23. --- doc/nvim-lsp-installer.txt | 4 ++++ lua/nvim-lsp-installer/server.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/nvim-lsp-installer.txt b/doc/nvim-lsp-installer.txt index ed3dc023..ac16488b 100644 --- a/doc/nvim-lsp-installer.txt +++ b/doc/nvim-lsp-installer.txt @@ -119,6 +119,10 @@ class: Server See |lspconfig-custom-config| for more information on {opts}. + - get_default_options() + Returns a deep copy of the default options provided to + lspconfig in the setup({opts}) method. + - is_installed() Returns {true} is server is installed, else returns {false}. diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index 67965e9b..79d66d23 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -132,6 +132,10 @@ function M.Server:setup(opts) ) end +function M.Server:get_default_options() + return vim.deepcopy(self._default_options) +end + function M.Server:is_installed() return fs.dir_exists(self._root_dir) end -- cgit v1.2.3-70-g09d2