Skip to content

Commit

Permalink
fix: fix CR comments
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Jun 3, 2024
1 parent 7cc84a3 commit 1047480
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kclvm/api/src/service/service_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ impl KclvmServiceImpl {
/// assert_eq!(result.variables.get("a").unwrap().value, "1");
/// ```
pub fn list_variables(&self, args: &ListVariablesArgs) -> anyhow::Result<ListVariablesResult> {
let k_files = args.files.iter().map(|s| s.as_str()).collect();
let k_files = args.files.clone();
let specs = args.specs.clone();

let select_res = list_variables(k_files, specs)?;
Expand Down
10 changes: 7 additions & 3 deletions kclvm/query/src/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,14 @@ impl Variable {

/// list_options provides users with the ability to parse kcl program and get all option
/// calling information.
pub fn list_variables(files: Vec<&str>, specs: Vec<String>) -> Result<ListVariablesResult> {
pub fn list_variables(files: Vec<String>, specs: Vec<String>) -> Result<ListVariablesResult> {
let mut selector = Selector::new(specs)?;
// let parse_result = parse_file(&file, None)?;
let mut load_result = load_program(Arc::new(ParseSession::default()), &files, None, None)?;
let mut load_result = load_program(
Arc::new(ParseSession::default()),
&files.iter().map(AsRef::as_ref).collect::<Vec<&str>>(),
None,
None,
)?;

let mut opts = Options::default();
opts.merge_program = true;
Expand Down

0 comments on commit 1047480

Please sign in to comment.