This repository was archived by the owner on Jan 3, 2024. It is now read-only.
File tree 3 files changed +16
-3
lines changed
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ local opts = {
141
141
-- options right now: termopen / quickfix
142
142
executor = require (" rust-tools/executors" ).termopen ,
143
143
144
+ -- callback to execute once rust-analyzer is done initializing the workspace
145
+ -- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
146
+ on_initialized = nil ,
147
+
144
148
runnables = {
145
149
-- whether to use telescope for selection menu or not
146
150
use_telescope = true
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ local defaults = {
25
25
-- options right now: termopen / quickfix
26
26
executor = require (" rust-tools/executors" ).termopen ,
27
27
28
+ -- callback to execute once rust-analyzer is done initializing the workspace
29
+ -- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
30
+ on_initialized = nil ,
31
+
28
32
-- These apply to the default RustSetInlayHints command
29
33
inlay_hints = {
30
34
Original file line number Diff line number Diff line change @@ -4,9 +4,14 @@ local inlay = require("rust-tools.inlay_hints")
4
4
local M = {}
5
5
6
6
function M .handler (_ , result )
7
- if result .quiescent and config .options .tools .autoSetHints and not M .ran_once then
8
- inlay .set_inlay_hints ()
9
- require (" rust-tools.inlay_hints" ).setup_autocmd ()
7
+ if result .quiescent and not M .ran_once then
8
+ if config .options .tools .autoSetHints then
9
+ inlay .set_inlay_hints ()
10
+ require (" rust-tools.inlay_hints" ).setup_autocmd ()
11
+ end
12
+ if config .options .tools .on_initialized then
13
+ config .options .tools .on_initialized (result )
14
+ end
10
15
M .ran_once = true
11
16
end
12
17
end
You can’t perform that action at this time.
0 commit comments