aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r--crates/ra_hir_expand/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 6ca4bc7a3..1389f64ce 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -174,7 +174,7 @@ impl ExpansionInfo {
174 174
175 let token = algo::find_covering_element(&self.expanded.value, range).into_token()?; 175 let token = algo::find_covering_element(&self.expanded.value, range).into_token()?;
176 176
177 Some(self.expanded.with_ast(token)) 177 Some(self.expanded.with_value(token))
178 } 178 }
179 179
180 pub fn map_token_up(&self, token: Source<&SyntaxToken>) -> Option<Source<SyntaxToken>> { 180 pub fn map_token_up(&self, token: Source<&SyntaxToken>) -> Option<Source<SyntaxToken>> {
@@ -192,7 +192,7 @@ impl ExpansionInfo {
192 range + tt.value.syntax().text_range().start(), 192 range + tt.value.syntax().text_range().start(),
193 ) 193 )
194 .into_token()?; 194 .into_token()?;
195 Some(tt.with_ast(token)) 195 Some(tt.with_value(token))
196 } 196 }
197} 197}
198 198
@@ -259,7 +259,7 @@ impl<T> Source<T> {
259 } 259 }
260 260
261 // Similarly, naming here is stupid... 261 // Similarly, naming here is stupid...
262 pub fn with_ast<U>(&self, value: U) -> Source<U> { 262 pub fn with_value<U>(&self, value: U) -> Source<U> {
263 Source::new(self.file_id, value) 263 Source::new(self.file_id, value)
264 } 264 }
265 265
@@ -267,7 +267,7 @@ impl<T> Source<T> {
267 Source::new(self.file_id, f(self.value)) 267 Source::new(self.file_id, f(self.value))
268 } 268 }
269 pub fn as_ref(&self) -> Source<&T> { 269 pub fn as_ref(&self) -> Source<&T> {
270 self.with_ast(&self.value) 270 self.with_value(&self.value)
271 } 271 }
272 pub fn file_syntax(&self, db: &impl db::AstDatabase) -> SyntaxNode { 272 pub fn file_syntax(&self, db: &impl db::AstDatabase) -> SyntaxNode {
273 db.parse_or_expand(self.file_id).expect("source created from invalid file") 273 db.parse_or_expand(self.file_id).expect("source created from invalid file")