From abe82d7fff34d4338ebc6793e719aa0ff0af6aea Mon Sep 17 00:00:00 2001 From: Praveen Perera Date: Tue, 26 Sep 2023 17:37:18 -0400 Subject: [PATCH] Run `cargo fmt` --- lsp/src/lib.rs | 40 ++++++++++++++++------------------ lsp/src/tree_sitter.rs | 4 ---- lsp/src/tree_sitter_querier.rs | 3 ++- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/lsp/src/lib.rs b/lsp/src/lib.rs index 1c0df10..bca855f 100644 --- a/lsp/src/lib.rs +++ b/lsp/src/lib.rs @@ -26,27 +26,25 @@ fn to_completion_list(items: Vec) -> 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(), }; diff --git a/lsp/src/tree_sitter.rs b/lsp/src/tree_sitter.rs index aadd437..f305383 100644 --- a/lsp/src/tree_sitter.rs +++ b/lsp/src/tree_sitter.rs @@ -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) } @@ -140,8 +138,6 @@ mod tests { .set_language(language) .expect("could not load html grammer"); - - parser.parse(text, None).expect("not to fail") } diff --git a/lsp/src/tree_sitter_querier.rs b/lsp/src/tree_sitter_querier.rs index 2b16d6d..36d32b4 100644 --- a/lsp/src/tree_sitter_querier.rs +++ b/lsp/src/tree_sitter_querier.rs @@ -23,7 +23,8 @@ fn query_props( source: &str, trigger_point: Point, ) -> HashMap { - 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();