Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 56ced3b

Browse files
committed
fix: only show debug lens with a valid root
1 parent 4f754f4 commit 56ced3b

File tree

1 file changed

+19
-15
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src/lsp

1 file changed

+19
-15
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,22 +1584,26 @@ pub(crate) fn code_lens(
15841584
};
15851585

15861586
let lens_config = snap.config.lens();
1587-
if lens_config.run && client_commands_config.run_single && has_root {
1588-
let command = command::run_single(&r, &title);
1589-
acc.push(lsp_types::CodeLens {
1590-
range: annotation_range,
1591-
command: Some(command),
1592-
data: None,
1593-
})
1594-
}
1595-
if lens_config.debug && can_debug && client_commands_config.debug_single {
1596-
let command = command::debug_single(&r);
1597-
acc.push(lsp_types::CodeLens {
1598-
range: annotation_range,
1599-
command: Some(command),
1600-
data: None,
1601-
})
1587+
1588+
if has_root {
1589+
if lens_config.run && client_commands_config.run_single {
1590+
let command = command::run_single(&r, &title);
1591+
acc.push(lsp_types::CodeLens {
1592+
range: annotation_range,
1593+
command: Some(command),
1594+
data: None,
1595+
})
1596+
}
1597+
if lens_config.debug && can_debug && client_commands_config.debug_single {
1598+
let command = command::debug_single(&r);
1599+
acc.push(lsp_types::CodeLens {
1600+
range: annotation_range,
1601+
command: Some(command),
1602+
data: None,
1603+
})
1604+
}
16021605
}
1606+
16031607
if lens_config.interpret {
16041608
let command = command::interpret_single(&r);
16051609
acc.push(lsp_types::CodeLens {

0 commit comments

Comments
 (0)