feat: preserve diff context during LSP navigation

This commit is contained in:
Valdemar Lorenzen
2026-10-12 14:03:19 +02:00
parent 6eb99a792a
commit 1b8b669ca0
10 changed files with 2559 additions and 126 deletions
+16
View File
@@ -140,6 +140,13 @@ pub struct CompletionItem {
pub snippet: Option<CompletionSnippet>,
}
/// Native LSP range; each coordinate is (zero-based row, UTF-16 column).
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Utf16Range {
pub start: (usize, usize),
pub end: (usize, usize),
}
#[derive(Debug, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)]
pub enum UpdateEffect {
@@ -162,6 +169,15 @@ pub enum UpdateEffect {
row: usize,
column: usize,
},
/// Native LSP targets retain UTF-16 coordinates until their source text is resolved.
#[serde(skip_deserializing)]
NavigateUtf16 {
buffer_id: usize,
revision: u64,
path: PathBuf,
range: Utf16Range,
target_range: Option<Utf16Range>,
},
Hover {
buffer_id: usize,
revision: u64,