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 #584

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
38 changes: 19 additions & 19 deletions doc/rustaceanvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,35 +156,35 @@ rustaceanvim.tools.Opts *rustaceanvim.tools.Opts*

Fields: ~
{executor?} (rustaceanvim.Executor|rustaceanvim.executor_alias)
The executor to use for runnables/debuggables
The executor to use for runnables/debuggables
{test_executor?} (rustaceanvim.Executor|rustaceanvim.test_executor_alias)
The executor to use for runnables that are tests / testables
The executor to use for runnables that are tests / testables
{crate_test_executor?} (rustaceanvim.Executor|rustaceanvim.test_executor_alias)
The executor to use for runnables that are crate test suites (--all-targets)
The executor to use for runnables that are crate test suites (--all-targets)
{cargo_override?} (string)
Set this to override the 'cargo' command for runnables, debuggables (etc., e.g. to 'cross').
If set, this takes precedence over 'enable_nextest'.
Set this to override the 'cargo' command for runnables, debuggables (etc., e.g. to 'cross').
If set, this takes precedence over 'enable_nextest'.
{enable_nextest?} (boolean)
Whether to enable nextest. If enabled, `cargo test` commands will be transformed to `cargo nextest run` commands.
Defaults to `true` if cargo-nextest is detected. Ignored if `cargo_override` is set.
Whether to enable nextest. If enabled, `cargo test` commands will be transformed to `cargo nextest run` commands.
Defaults to `true` if cargo-nextest is detected. Ignored if `cargo_override` is set.
{enable_clippy?} (boolean)
Whether to enable clippy checks on save if a clippy installation is detected.
Default: `true`
{on_initialized?} (fun(health:rustaceanvim.RAInitializedStatus))
Function that is invoked when the LSP server has finished initializing
Whether to enable clippy checks on save if a clippy installation is detected.
Default: `true`
{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
{hover_actions?} (rustaceanvim.hover-actions.Opts) Options for hover actions
{code_actions?} (rustaceanvim.code-action.Opts) Options for code actions
Automatically call `RustReloadWorkspace` when writing to a Cargo.toml file
{hover_actions?} (rustaceanvim.hover-actions.Opts) Options for hover actions
{code_actions?} (rustaceanvim.code-action.Opts) Options for code actions
{float_win_config?} (rustaceanvim.FloatWinConfig)
Options applied to floating windows.
See |api-win_config|.
Options applied to floating windows.
See |api-win_config|.
{create_graph?} (rustaceanvim.crate-graph.Opts)
Options for showing the crate graph based on graphviz and the dot
Options for showing the crate graph based on graphviz and the dot
{open_url?} (fun(url:string):nil)
If set, overrides how to open URLs
If set, overrides how to open URLs
{rustc?} (rustaceanvim.rustc.Opts)
Options for `rustc`
Options for `rustc`


rustaceanvim.Executor *rustaceanvim.Executor*
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
Loading