diff options
author | Aleksey Kladov <[email protected]> | 2019-11-20 06:40:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-20 06:42:30 +0000 |
commit | 36e3fc9d5413f7e6e17e82867aae1318645880a3 (patch) | |
tree | 166ee3c45f99611f7c20740c2a246f5b3bed41a3 /crates/ra_ide_api/src/completion | |
parent | e975f6364cb3caf50467835afb0dafce887f51f0 (diff) |
Rename Source::ast -> Source::value
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_context.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/presentation.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index 0906a4e1b..b8345c91d 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs | |||
@@ -54,7 +54,7 @@ impl<'a> CompletionContext<'a> { | |||
54 | let src = hir::ModuleSource::from_position(db, position); | 54 | let src = hir::ModuleSource::from_position(db, position); |
55 | let module = hir::Module::from_definition( | 55 | let module = hir::Module::from_definition( |
56 | db, | 56 | db, |
57 | hir::Source { file_id: position.file_id.into(), ast: src }, | 57 | hir::Source { file_id: position.file_id.into(), value: src }, |
58 | ); | 58 | ); |
59 | let token = | 59 | let token = |
60 | original_parse.tree().syntax().token_at_offset(position.offset).left_biased()?; | 60 | original_parse.tree().syntax().token_at_offset(position.offset).left_biased()?; |
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 501b7da4e..b20329459 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -169,7 +169,7 @@ impl Completions { | |||
169 | None => return, | 169 | None => return, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | let ast_node = macro_.source(ctx.db).ast; | 172 | let ast_node = macro_.source(ctx.db).value; |
173 | let detail = macro_label(&ast_node); | 173 | let detail = macro_label(&ast_node); |
174 | 174 | ||
175 | let docs = macro_.docs(ctx.db); | 175 | let docs = macro_.docs(ctx.db); |
@@ -201,7 +201,7 @@ impl Completions { | |||
201 | ) { | 201 | ) { |
202 | let data = func.data(ctx.db); | 202 | let data = func.data(ctx.db); |
203 | let name = name.unwrap_or_else(|| data.name().to_string()); | 203 | let name = name.unwrap_or_else(|| data.name().to_string()); |
204 | let ast_node = func.source(ctx.db).ast; | 204 | let ast_node = func.source(ctx.db).value; |
205 | let detail = function_label(&ast_node); | 205 | let detail = function_label(&ast_node); |
206 | 206 | ||
207 | let mut builder = | 207 | let mut builder = |
@@ -234,7 +234,7 @@ impl Completions { | |||
234 | } | 234 | } |
235 | 235 | ||
236 | pub(crate) fn add_const(&mut self, ctx: &CompletionContext, constant: hir::Const) { | 236 | pub(crate) fn add_const(&mut self, ctx: &CompletionContext, constant: hir::Const) { |
237 | let ast_node = constant.source(ctx.db).ast; | 237 | let ast_node = constant.source(ctx.db).value; |
238 | let name = match ast_node.name() { | 238 | let name = match ast_node.name() { |
239 | Some(name) => name, | 239 | Some(name) => name, |
240 | _ => return, | 240 | _ => return, |
@@ -250,7 +250,7 @@ impl Completions { | |||
250 | } | 250 | } |
251 | 251 | ||
252 | pub(crate) fn add_type_alias(&mut self, ctx: &CompletionContext, type_alias: hir::TypeAlias) { | 252 | pub(crate) fn add_type_alias(&mut self, ctx: &CompletionContext, type_alias: hir::TypeAlias) { |
253 | let type_def = type_alias.source(ctx.db).ast; | 253 | let type_def = type_alias.source(ctx.db).value; |
254 | let name = match type_def.name() { | 254 | let name = match type_def.name() { |
255 | Some(name) => name, | 255 | Some(name) => name, |
256 | _ => return, | 256 | _ => return, |