Skip to content

Commit

Permalink
feat(lsp): add "info" codelens
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Oct 4, 2023
1 parent c6f660e commit fdaccec
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tooling/lsp/src/codelens/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const TEST_COMMAND: &str = "nargo.test";
const TEST_CODELENS_TITLE: &str = "Run Test";
const COMPILE_COMMAND: &str = "nargo.compile";
const COMPILE_CODELENS_TITLE: &str = "Compile";
const INFO_COMMAND: &str = "nargo.info";
const INFO_CODELENS_TITLE: &str = "Info";
const EXECUTE_COMMAND: &str = "nargo.execute";
const EXECUTE_CODELENS_TITLE: &str = "Execute";

Expand Down Expand Up @@ -148,6 +150,16 @@ fn on_code_lens_request_inner(

lenses.push(compile_lens);

let info_command = Command {
title: INFO_CODELENS_TITLE.to_string(),
command: INFO_COMMAND.into(),
arguments: Some(package_selection_args(&workspace, package)),
};

let info_lens = CodeLens { range, command: Some(info_command), data: None };

lenses.push(info_lens);

let execute_command = Command {
title: EXECUTE_CODELENS_TITLE.to_string(),
command: EXECUTE_COMMAND.into(),
Expand Down Expand Up @@ -186,6 +198,16 @@ fn on_code_lens_request_inner(
let compile_lens = CodeLens { range, command: Some(compile_command), data: None };

lenses.push(compile_lens);

let info_command = Command {
title: INFO_CODELENS_TITLE.to_string(),
command: INFO_COMMAND.into(),
arguments: Some(package_selection_args(&workspace, package)),
};

let info_lens = CodeLens { range, command: Some(info_command), data: None };

lenses.push(info_lens);
}
}
}
Expand Down

0 comments on commit fdaccec

Please sign in to comment.