mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
fix: only show debug lens with a valid root
This commit is contained in:
parent
693b110e3d
commit
59e3d6684b
1 changed files with 19 additions and 15 deletions
|
|
@ -1584,22 +1584,26 @@ pub(crate) fn code_lens(
|
||||||
};
|
};
|
||||||
|
|
||||||
let lens_config = snap.config.lens();
|
let lens_config = snap.config.lens();
|
||||||
if lens_config.run && client_commands_config.run_single && has_root {
|
|
||||||
let command = command::run_single(&r, &title);
|
if has_root {
|
||||||
acc.push(lsp_types::CodeLens {
|
if lens_config.run && client_commands_config.run_single {
|
||||||
range: annotation_range,
|
let command = command::run_single(&r, &title);
|
||||||
command: Some(command),
|
acc.push(lsp_types::CodeLens {
|
||||||
data: None,
|
range: annotation_range,
|
||||||
})
|
command: Some(command),
|
||||||
}
|
data: None,
|
||||||
if lens_config.debug && can_debug && client_commands_config.debug_single {
|
})
|
||||||
let command = command::debug_single(&r);
|
}
|
||||||
acc.push(lsp_types::CodeLens {
|
if lens_config.debug && can_debug && client_commands_config.debug_single {
|
||||||
range: annotation_range,
|
let command = command::debug_single(&r);
|
||||||
command: Some(command),
|
acc.push(lsp_types::CodeLens {
|
||||||
data: None,
|
range: annotation_range,
|
||||||
})
|
command: Some(command),
|
||||||
|
data: None,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if lens_config.interpret {
|
if lens_config.interpret {
|
||||||
let command = command::interpret_single(&r);
|
let command = command::interpret_single(&r);
|
||||||
acc.push(lsp_types::CodeLens {
|
acc.push(lsp_types::CodeLens {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue