|
|
|
@ -18,7 +18,8 @@ use tui::{
|
|
|
|
|
use super::{align_view, push_jump, Align, Context, Editor, Open};
|
|
|
|
|
|
|
|
|
|
use helix_core::{
|
|
|
|
|
path, syntax::LanguageServerFeature, text_annotations::InlineAnnotation, Selection,
|
|
|
|
|
movement::Direction, path, syntax::LanguageServerFeature, text_annotations::InlineAnnotation,
|
|
|
|
|
Selection,
|
|
|
|
|
};
|
|
|
|
|
use helix_view::{
|
|
|
|
|
document::{DocumentInlayHints, DocumentInlayHintsId, Mode},
|
|
|
|
@ -1148,13 +1149,20 @@ pub fn goto_reference(cx: &mut Context) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn goto_reference_direction(cx: &mut Context, direction: Direction) {
|
|
|
|
|
let config = cx.editor.config();
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
|
let language_server = language_server!(cx.editor, doc);
|
|
|
|
|
let language_server =
|
|
|
|
|
language_server_with_feature!(cx.editor, doc, LanguageServerFeature::GotoReference);
|
|
|
|
|
let offset_encoding = language_server.offset_encoding();
|
|
|
|
|
|
|
|
|
|
let pos = doc.position(view.id, offset_encoding);
|
|
|
|
|
|
|
|
|
|
let future = match language_server.goto_reference(doc.identifier(), pos, None) {
|
|
|
|
|
let future = match language_server.goto_reference(
|
|
|
|
|
doc.identifier(),
|
|
|
|
|
pos,
|
|
|
|
|
config.lsp.goto_reference_include_declaration,
|
|
|
|
|
None,
|
|
|
|
|
) {
|
|
|
|
|
Some(future) => future,
|
|
|
|
|
None => {
|
|
|
|
|
cx.editor
|
|
|
|
|