@@ -912,7 +912,7 @@ fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
912912 cx.editor.open(PathBuf::from(location.uri.path()));
913913 let doc = cx.doc();
914914 let definition_pos = location.range.start;
915− let new_pos = helix_lsp::util::lsp_pos_to_pos(doc.text().slice(..), definition_pos);
915+ let new_pos = helix_lsp::util::lsp_pos_to_pos(doc.text(), definition_pos);
916916 doc.set_selection(Selection::point(new_pos));
917917 }
918918 [] => (), // maybe show user message that no definition was found?
@@ -928,8 +928,7 @@ fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
928928 editor.open(PathBuf::from(item.uri.path()));
929929 let mut doc = &mut editor.view_mut().doc;
930930 let definition_pos = item.range.start;
931− let new_pos =
932− helix_lsp::util::lsp_pos_to_pos(doc.text().slice(..), definition_pos);
931+ let new_pos = helix_lsp::util::lsp_pos_to_pos(doc.text(), definition_pos);
933932 doc.set_selection(Selection::point(new_pos));
934933 },
935934 );
@@ -946,7 +945,7 @@ pub fn goto_definition(cx: &mut Context) {
946945 };
947946
948947 // TODO: blocking here is not ideal
949− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
948+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
950949
951950 // TODO: handle fails
952951 let res =
@@ -962,7 +961,7 @@ pub fn goto_type_definition(cx: &mut Context) {
962961 };
963962
964963 // TODO: blocking here is not ideal
965− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
964+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
966965
967966 // TODO: handle fails
968967 let res = smol::block_on(language_server.goto_type_definition(doc.identifier(), pos))
@@ -978,7 +977,7 @@ pub fn goto_implementation(cx: &mut Context) {
978977 };
979978
980979 // TODO: blocking here is not ideal
981− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
980+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
982981
983982 // TODO: handle fails
984983 let res = smol::block_on(language_server.goto_implementation(doc.identifier(), pos))
@@ -994,7 +993,7 @@ pub fn goto_reference(cx: &mut Context) {
994993 };
995994
996995 // TODO: blocking here is not ideal
997− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
996+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
998997
999998 // TODO: handle fails
1000999 let res =
@@ -1223,7 +1222,7 @@ pub fn format_selections(cx: &mut Context) {
12231222 .selection()
12241223 .ranges()
12251224 .iter()
1226− .map(|range| helix_lsp::util::range_to_lsp_range(doc.text().slice(..), *range))
1225+ .map(|range| helix_lsp::util::range_to_lsp_range(doc.text(), *range))
12271226 .collect();
12281227
12291228 for range in ranges {
@@ -1333,7 +1332,7 @@ pub fn completion(cx: &mut Context) {
13331332 };
13341333
13351334 // TODO: blocking here is not ideal
1336− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
1335+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
13371336
13381337 // TODO: handle fails
13391338
@@ -1435,7 +1434,7 @@ pub fn hover(cx: &mut Context) {
14351434
14361435 // TODO: blocking here is not ideal, make commands async fn?
14371436 // not like we can process additional input meanwhile though
1438− let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
1437+ let pos = helix_lsp::util::pos_to_lsp_pos(doc.text(), doc.selection().cursor());
14391438
14401439 // TODO: handle fails
14411440 let res = smol::block_on(language_server.text_document_hover(doc.identifier(), pos))