Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 7a67ac7f..cf7f7bf8 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -211,12 +211,15 @@ pub struct Document {
/// Annotations for LSP document color swatches
pub color_swatches: Option<DocumentColorSwatches>,
+ /// Cached LSP document links for navigation (e.g. goto_file).
+ pub document_links: Vec<DocumentLink>,
// NOTE: ideally this would live on the handler for color swatches. This is blocked on a
// large refactor that would make `&mut Editor` available on the `DocumentDidChange` event.
pub color_swatch_controller: TaskController,
/// Per-view task controllers for canceling in-flight document highlight requests.
pub document_highlight_controllers: HashMap<ViewId, TaskController>,
pub pull_diagnostic_controller: TaskController,
+ pub document_link_controller: TaskController,
// NOTE: this field should eventually go away - we should use the Editor's syn_loader instead
// of storing a copy on every doc. Then we can remove the surrounding `Arc` and use the
@@ -237,6 +240,15 @@ pub struct DocumentHighlights {
pub ranges: Vec<std::ops::Range<usize>>,
}
+#[derive(Debug, Clone)]
+pub struct DocumentLink {
+ /// Character offsets in the document for the link range.
+ pub start: usize,
+ pub end: usize,
+ pub link: lsp::DocumentLink,
+ pub language_server_id: LanguageServerId,
+}
+
/// Inlay hints for a single `(Document, View)` combo.
///
/// There are `*_inlay_hints` field for each kind of hints an LSP can send since we offer the
@@ -741,11 +753,13 @@ impl Document {
jump_labels: HashMap::new(),
document_highlights: HashMap::new(),
color_swatches: None,
+ document_links: Vec::new(),
color_swatch_controller: TaskController::new(),
document_highlight_controllers: HashMap::new(),
syn_loader,
previous_diagnostic_id: None,
pull_diagnostic_controller: TaskController::new(),
+ document_link_controller: TaskController::new(),
}
}