Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lsp): pass client_id to on_initialized (#582) #583

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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