Skip to content

Commit 109e76b

Browse files
committed
Remove superfluous definition of point_from_cursor()
There's a more robust version already in `crates/ark/src/fixtures/utils.rs`.
1 parent 5d504f3 commit 109e76b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

crates/ark/src/lsp/completions/parameter_hints.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,14 @@ fn skip_namespace_operator(node: Node) -> Node {
117117
mod tests {
118118
use tower_lsp::lsp_types::CompletionItem;
119119
use tower_lsp::lsp_types::InsertTextFormat;
120-
use tree_sitter::Point;
121120

121+
use crate::fixtures::point_from_cursor;
122122
use crate::lsp::completions::provide_completions;
123123
use crate::lsp::document_context::DocumentContext;
124124
use crate::lsp::documents::Document;
125125
use crate::lsp::state::WorldState;
126126
use crate::r_task;
127127

128-
fn point_from_cursor(text: &str) -> (String, Point) {
129-
let cursor_pos = text.find('@').unwrap();
130-
let text = text.replace('@', "");
131-
(text, Point::new(0, cursor_pos))
132-
}
133-
134128
fn find_completion(completions: &[CompletionItem], label: &str) -> CompletionItem {
135129
completions
136130
.iter()

0 commit comments

Comments
 (0)