Skip to content

Commit

Permalink
feat(lsp): pass client_id to on_initialized (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamekoro authored and mrcjkb committed Nov 18, 2024
1 parent 383d03e commit f138dde
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/rustaceanvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ rustaceanvim.tools.Opts *rustaceanvim.tools.Opts*
{enable_clippy?} (boolean)
Whether to enable clippy checks on save if a clippy installation is detected.
Default: `true`
{on_initialized?} (fun(health:rustaceanvim.RAInitializedStatus))
{on_initialized?} (fun(health:rustaceanvim.RAInitializedStatus,client_id:integer))
Function that is invoked when the LSP server has finished initializing
{reload_workspace_from_cargo_toml?} (boolean)
Automatically call `RustReloadWorkspace` when writing to a Cargo.toml file
Expand Down
2 changes: 1 addition & 1 deletion lua/rustaceanvim/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ vim.g.rustaceanvim = vim.g.rustaceanvim
---@field enable_clippy? boolean
---
---Function that is invoked when the LSP server has finished initializing
---@field on_initialized? fun(health:rustaceanvim.RAInitializedStatus)
---@field on_initialized? fun(health:rustaceanvim.RAInitializedStatus,client_id:integer)
---
---Automatically call `RustReloadWorkspace` when writing to a Cargo.toml file
---@field reload_workspace_from_cargo_toml? boolean
Expand Down
2 changes: 1 addition & 1 deletion lua/rustaceanvim/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ local RustaceanDefaultConfig = {

--- callback to execute once rust-analyzer is done initializing the workspace
--- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
---@type fun(health:rustaceanvim.RAInitializedStatus) | nil
---@type fun(health:rustaceanvim.RAInitializedStatus,client_id:integer) | nil
on_initialized = nil,

--- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
Expand Down
2 changes: 1 addition & 1 deletion lua/rustaceanvim/server_status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ see ':h rustaceanvim.lsp.ClientOpts'.
end
-- Load user on_initialized
if config.tools.on_initialized then
config.tools.on_initialized(result)
config.tools.on_initialized(result, ctx.client_id)
end
if config.dap.autoload_configurations then
require('rustaceanvim.commands.debuggables').add_dap_debuggables()
Expand Down

0 comments on commit f138dde

Please sign in to comment.