diff options
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r-- | crates/ra_ide_db/src/change.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_db/src/line_index.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs index a1bb3043b..32d9a8d1f 100644 --- a/crates/ra_ide_db/src/change.rs +++ b/crates/ra_ide_db/src/change.rs | |||
@@ -151,7 +151,7 @@ impl RootDatabase { | |||
151 | 151 | ||
152 | // Macros do take significant space, but less then the syntax trees | 152 | // Macros do take significant space, but less then the syntax trees |
153 | // self.query(hir::db::MacroDefQuery).sweep(sweep); | 153 | // self.query(hir::db::MacroDefQuery).sweep(sweep); |
154 | // self.query(hir::db::MacroArgQuery).sweep(sweep); | 154 | // self.query(hir::db::MacroArgTextQuery).sweep(sweep); |
155 | // self.query(hir::db::MacroExpandQuery).sweep(sweep); | 155 | // self.query(hir::db::MacroExpandQuery).sweep(sweep); |
156 | 156 | ||
157 | hir::db::AstIdMapQuery.in_db(self).sweep(sweep); | 157 | hir::db::AstIdMapQuery.in_db(self).sweep(sweep); |
@@ -199,7 +199,7 @@ impl RootDatabase { | |||
199 | 199 | ||
200 | // AstDatabase | 200 | // AstDatabase |
201 | hir::db::AstIdMapQuery | 201 | hir::db::AstIdMapQuery |
202 | hir::db::MacroArgQuery | 202 | hir::db::MacroArgTextQuery |
203 | hir::db::MacroDefQuery | 203 | hir::db::MacroDefQuery |
204 | hir::db::ParseMacroQuery | 204 | hir::db::ParseMacroQuery |
205 | hir::db::MacroExpandQuery | 205 | hir::db::MacroExpandQuery |
diff --git a/crates/ra_ide_db/src/line_index.rs b/crates/ra_ide_db/src/line_index.rs index c7c744fce..2ab662098 100644 --- a/crates/ra_ide_db/src/line_index.rs +++ b/crates/ra_ide_db/src/line_index.rs | |||
@@ -4,7 +4,7 @@ use std::iter; | |||
4 | 4 | ||
5 | use ra_syntax::{TextRange, TextSize}; | 5 | use ra_syntax::{TextRange, TextSize}; |
6 | use rustc_hash::FxHashMap; | 6 | use rustc_hash::FxHashMap; |
7 | use superslice::Ext; | 7 | use stdx::partition_point; |
8 | 8 | ||
9 | #[derive(Clone, Debug, PartialEq, Eq)] | 9 | #[derive(Clone, Debug, PartialEq, Eq)] |
10 | pub struct LineIndex { | 10 | pub struct LineIndex { |
@@ -89,7 +89,7 @@ impl LineIndex { | |||
89 | } | 89 | } |
90 | 90 | ||
91 | pub fn line_col(&self, offset: TextSize) -> LineCol { | 91 | pub fn line_col(&self, offset: TextSize) -> LineCol { |
92 | let line = self.newlines.upper_bound(&offset) - 1; | 92 | let line = partition_point(&self.newlines, |&it| it <= offset) - 1; |
93 | let line_start_offset = self.newlines[line]; | 93 | let line_start_offset = self.newlines[line]; |
94 | let col = offset - line_start_offset; | 94 | let col = offset - line_start_offset; |
95 | 95 | ||
@@ -103,8 +103,8 @@ impl LineIndex { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | pub fn lines(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ { | 105 | pub fn lines(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ { |
106 | let lo = self.newlines.lower_bound(&range.start()); | 106 | let lo = partition_point(&self.newlines, |&it| it < range.start()); |
107 | let hi = self.newlines.upper_bound(&range.end()); | 107 | let hi = partition_point(&self.newlines, |&it| it <= range.end()); |
108 | let all = iter::once(range.start()) | 108 | let all = iter::once(range.start()) |
109 | .chain(self.newlines[lo..hi].iter().copied()) | 109 | .chain(self.newlines[lo..hi].iter().copied()) |
110 | .chain(iter::once(range.end())); | 110 | .chain(iter::once(range.end())); |