Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Sep 26, 2023
1 parent 6afac5d commit abe82d7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
40 changes: 19 additions & 21 deletions lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@ fn to_completion_list(items: Vec<HxCompletion>) -> CompletionList {
is_incomplete: true,
items: items
.iter()
.map(|x| {
CompletionItem {
label: x.name.clone(),
label_details: None,
kind: Some(CompletionItemKind::TEXT),
detail: Some(x.desc.clone()),
documentation: None,
deprecated: Some(false),
preselect: None,
sort_text: None,
filter_text: None,
insert_text: None,
insert_text_format: None,
insert_text_mode: None,
text_edit: None,
additional_text_edits: None,
command: None,
commit_characters: None,
data: None,
tags: None,
}
.map(|x| CompletionItem {
label: x.name.clone(),
label_details: None,
kind: Some(CompletionItemKind::TEXT),
detail: Some(x.desc.clone()),
documentation: None,
deprecated: Some(false),
preselect: None,
sort_text: None,
filter_text: None,
insert_text: None,
insert_text_format: None,
insert_text_mode: None,
text_edit: None,
additional_text_edits: None,
command: None,
commit_characters: None,
data: None,
tags: None,
})
.collect(),
};
Expand Down
4 changes: 0 additions & 4 deletions lsp/src/tree_sitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ fn query_position(root: Node<'_>, source: &str, trigger_point: Point) -> Option<
return attr_completion;
}



query_attr_values_for_completion(element, source, trigger_point)
}

Expand Down Expand Up @@ -140,8 +138,6 @@ mod tests {
.set_language(language)
.expect("could not load html grammer");



parser.parse(text, None).expect("not to fail")
}

Expand Down
3 changes: 2 additions & 1 deletion lsp/src/tree_sitter_querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ fn query_props(
source: &str,
trigger_point: Point,
) -> HashMap<String, CaptureDetails> {
let query = Query::new(tree_sitter_html::language(), query_string).unwrap_or_else(|_| panic!("get_position_by_query invalid query {query_string}"));
let query = Query::new(tree_sitter_html::language(), query_string)
.unwrap_or_else(|_| panic!("get_position_by_query invalid query {query_string}"));
let mut cursor_qry = QueryCursor::new();

let capture_names = query.capture_names();
Expand Down

0 comments on commit abe82d7

Please sign in to comment.