Skip to content

Commit 348cbc0

Browse files
bors[bot]matklad
andauthored
Merge #4418
4418: Refactor protocol handling r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 225f353 + 3bec2be commit 348cbc0

File tree

11 files changed

+999
-1123
lines changed

11 files changed

+999
-1123
lines changed

crates/ra_ide/src/display/navigation_target.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use ra_syntax::{
1111
TextRange,
1212
};
1313

14-
use crate::FileSymbol;
14+
use crate::{FileRange, FileSymbol};
1515

1616
use super::short_label::ShortLabel;
1717

@@ -22,10 +22,11 @@ use super::short_label::ShortLabel;
2222
/// code, like a function or a struct, but this is not strictly required.
2323
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2424
pub struct NavigationTarget {
25+
// FIXME: use FileRange?
2526
file_id: FileId,
27+
full_range: TextRange,
2628
name: SmolStr,
2729
kind: SyntaxKind,
28-
full_range: TextRange,
2930
focus_range: Option<TextRange>,
3031
container_name: Option<SmolStr>,
3132
description: Option<String>,
@@ -63,6 +64,10 @@ impl NavigationTarget {
6364
self.file_id
6465
}
6566

67+
pub fn file_range(&self) -> FileRange {
68+
FileRange { file_id: self.file_id, range: self.full_range }
69+
}
70+
6671
pub fn full_range(&self) -> TextRange {
6772
self.full_range
6873
}

crates/ra_text_edit/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl TextEdit {
7575
self.indels.is_empty()
7676
}
7777

78+
// FXME: impl IntoIter instead
7879
pub fn as_indels(&self) -> &[Indel] {
7980
&self.indels
8081
}

0 commit comments

Comments
 (0)