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): add "info" codelens #2982

Merged
merged 1 commit into from
Oct 4, 2023
Merged
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
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