aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-20 10:10:03 +0000
committerGitHub <[email protected]>2019-11-20 10:10:03 +0000
commit3d56e3d85516fe9061aea84571ac88c3322a687c (patch)
treebd923b623ffe43df04ef00e1f0662c00c0d919d1 /crates/ra_hir_expand
parentfa50b16cb2309c0c4fcb4e90378993a1f3d2ffb6 (diff)
parent51baaf298d4ac56036062786bf070aeab7ab8e79 (diff)
Merge #2323
2323: Rename with_ast -> with_value r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-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")