diff --git a/doc/jdtls.txt b/doc/jdtls.txt index 9f82576..d41ac79 100644 --- a/doc/jdtls.txt +++ b/doc/jdtls.txt @@ -1,13 +1,18 @@ ============================================================================== LSP extensions for Neovim and eclipse.jdt.ls *jdtls* -M.start_or_attach({config}) *jdtls.start_or_attach* + *jdtls.start_or_attach* +M.start_or_attach({config}, {opts?}, {start_opts?}) Start the language server (if not started), and attach the current buffer. Parameters: ~ - {config} (table) configuration. See |vim.lsp.start_client| - @return integer? client_id + {config} (table) configuration. See |vim.lsp.start_client| + {opts?} (jdtls.start.opts) + {start_opts?} (lsp.StartOpts) options passed to vim.lsp.start + + Returns: ~ + (integer|nil) client_id M.organize_imports() *jdtls.organize_imports* diff --git a/lua/jdtls.lua b/lua/jdtls.lua index 67134ed..d81e7b9 100644 --- a/lua/jdtls.lua +++ b/lua/jdtls.lua @@ -33,10 +33,12 @@ local M = { --- Start the language server (if not started), and attach the current buffer. --- ----@param config table configuration. See |vim.lsp.start_client| ----@return integer? client_id -function M.start_or_attach(config) - return setup.start_or_attach(config) +---@param config table configuration. See |vim.lsp.start_client| +---@param opts? jdtls.start.opts +---@param start_opts? lsp.StartOpts options passed to vim.lsp.start +---@return integer|nil client_id +function M.start_or_attach(config, opts, start_opts) + return setup.start_or_attach(config, opts, start_opts) end diff --git a/lua/jdtls/setup.lua b/lua/jdtls/setup.lua index 9b7bb02..9e4f50c 100644 --- a/lua/jdtls/setup.lua +++ b/lua/jdtls/setup.lua @@ -251,9 +251,13 @@ end ---@field dap? JdtSetupDapOpts +--- Start the language server (if not started), and attach the current buffer. +--- +---@param config table configuration. See |vim.lsp.start_client| ---@param opts? jdtls.start.opts +---@param start_opts? lsp.StartOpts options passed to vim.lsp.start ---@return integer? client_id -function M.start_or_attach(config, opts) +function M.start_or_attach(config, opts, start_opts) opts = opts or {} assert(config, 'config is required') assert( @@ -316,7 +320,7 @@ function M.start_or_attach(config, opts) } }) maybe_implicit_save() - return vim.lsp.start(config) + return vim.lsp.start(config, start_opts) end