@@ -912,7 +912,7 @@ fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
912 cx.editor.open(PathBuf::from(location.uri.path()));
912 cx.editor.open(PathBuf::from(location.uri.path()));
913 let doc = cx.doc();
913 let doc = cx.doc();
914 let definition_pos = location.range.start;
914 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);
916 doc.set_selection(Selection::point(new_pos));
916 doc.set_selection(Selection::point(new_pos));
918 [] => (), // maybe show user message that no definition was found?
918 [] => (), // maybe show user message that no definition was found?
@@ -928,8 +928,7 @@ fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
928 editor.open(PathBuf::from(item.uri.path()));
928 editor.open(PathBuf::from(item.uri.path()));
929 let mut doc = &mut editor.view_mut().doc;
929 let mut doc = &mut editor.view_mut().doc;
930 let definition_pos = item.range.start;
930 let definition_pos = item.range.start;
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);
933 doc.set_selection(Selection::point(new_pos));
932 doc.set_selection(Selection::point(new_pos));
@@ -946,7 +945,7 @@ pub fn goto_definition(cx: &mut Context) {
948 // TODO: blocking here is not ideal
947 // 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());
951 // TODO: handle fails
950 // TODO: handle fails
952 let res =
951 let res =
@@ -962,7 +961,7 @@ pub fn goto_type_definition(cx: &mut Context) {
964 // TODO: blocking here is not ideal
963 // 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());
967 // TODO: handle fails
966 // TODO: handle fails
968 let res = smol::block_on(language_server.goto_type_definition(doc.identifier(), pos))
967 let res = smol::block_on(language_server.goto_type_definition(doc.identifier(), pos))
@@ -978,7 +977,7 @@ pub fn goto_implementation(cx: &mut Context) {
980 // TODO: blocking here is not ideal
979 // 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());
983 // TODO: handle fails
982 // TODO: handle fails
984 let res = smol::block_on(language_server.goto_implementation(doc.identifier(), pos))
983 let res = smol::block_on(language_server.goto_implementation(doc.identifier(), pos))
@@ -994,7 +993,7 @@ pub fn goto_reference(cx: &mut Context) {
996 // TODO: blocking here is not ideal
995 // 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());
999 // TODO: handle fails
998 // TODO: handle fails
1000 let res =
999 let res =
@@ -1223,7 +1222,7 @@ pub fn format_selections(cx: &mut Context) {
1223 .selection()
1222 .selection()
1224 .ranges()
1223 .ranges()
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))
1227 .collect();
1226 .collect();
1229 for range in ranges {
1228 for range in ranges {
@@ -1333,7 +1332,7 @@ pub fn completion(cx: &mut Context) {
1335 // TODO: blocking here is not ideal
1334 // 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());
1338 // TODO: handle fails
1337 // TODO: handle fails
@@ -1435,7 +1434,7 @@ pub fn hover(cx: &mut Context) {
1436 // TODO: blocking here is not ideal, make commands async fn?
1435 // TODO: blocking here is not ideal, make commands async fn?
1437 // not like we can process additional input meanwhile though
1436 // 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());
1440 // TODO: handle fails
1439 // TODO: handle fails
1441 let res = smol::block_on(language_server.text_document_hover(doc.identifier(), pos))
1440 let res = smol::block_on(language_server.text_document_hover(doc.identifier(), pos))