diff options
author | Nick Spain <[email protected]> | 2021-01-01 02:05:28 +0000 |
---|---|---|
committer | Nick Spain <[email protected]> | 2021-01-02 10:53:51 +0000 |
commit | 27cadcd531c017aa7c78c6f7a36f2b7f2ce8a196 (patch) | |
tree | 24f43261eeafffc8b98be361c9c2841c2e4861f0 /crates/completion/src/render | |
parent | aa3ce16f2641b7eb562a8eae67738b0ff0c0b7b0 (diff) |
HasSource::source -> HasSource::source_old
To start migrating HasSource::source to return an Option.
Diffstat (limited to 'crates/completion/src/render')
-rw-r--r-- | crates/completion/src/render/const_.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/render/function.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/render/macro_.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/render/type_alias.rs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/crates/completion/src/render/const_.rs b/crates/completion/src/render/const_.rs index 039bdabc0..a8820a4fe 100644 --- a/crates/completion/src/render/const_.rs +++ b/crates/completion/src/render/const_.rs | |||
@@ -27,7 +27,7 @@ struct ConstRender<'a> { | |||
27 | 27 | ||
28 | impl<'a> ConstRender<'a> { | 28 | impl<'a> ConstRender<'a> { |
29 | fn new(ctx: RenderContext<'a>, const_: hir::Const) -> ConstRender<'a> { | 29 | fn new(ctx: RenderContext<'a>, const_: hir::Const) -> ConstRender<'a> { |
30 | let ast_node = const_.source(ctx.db()).value; | 30 | let ast_node = const_.source_old(ctx.db()).value; |
31 | ConstRender { ctx, const_, ast_node } | 31 | ConstRender { ctx, const_, ast_node } |
32 | } | 32 | } |
33 | 33 | ||
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs index 316e05b52..d9ea425a0 100644 --- a/crates/completion/src/render/function.rs +++ b/crates/completion/src/render/function.rs | |||
@@ -34,7 +34,7 @@ impl<'a> FunctionRender<'a> { | |||
34 | fn_: hir::Function, | 34 | fn_: hir::Function, |
35 | ) -> FunctionRender<'a> { | 35 | ) -> FunctionRender<'a> { |
36 | let name = local_name.unwrap_or_else(|| fn_.name(ctx.db()).to_string()); | 36 | let name = local_name.unwrap_or_else(|| fn_.name(ctx.db()).to_string()); |
37 | let ast_node = fn_.source(ctx.db()).value; | 37 | let ast_node = fn_.source_old(ctx.db()).value; |
38 | 38 | ||
39 | FunctionRender { ctx, name, func: fn_, ast_node } | 39 | FunctionRender { ctx, name, func: fn_, ast_node } |
40 | } | 40 | } |
diff --git a/crates/completion/src/render/macro_.rs b/crates/completion/src/render/macro_.rs index dac79592f..3d13fd9e2 100644 --- a/crates/completion/src/render/macro_.rs +++ b/crates/completion/src/render/macro_.rs | |||
@@ -96,7 +96,7 @@ impl<'a> MacroRender<'a> { | |||
96 | } | 96 | } |
97 | 97 | ||
98 | fn detail(&self) -> String { | 98 | fn detail(&self) -> String { |
99 | let ast_node = self.macro_.source(self.ctx.db()).value; | 99 | let ast_node = self.macro_.source_old(self.ctx.db()).value; |
100 | macro_label(&ast_node) | 100 | macro_label(&ast_node) |
101 | } | 101 | } |
102 | } | 102 | } |
diff --git a/crates/completion/src/render/type_alias.rs b/crates/completion/src/render/type_alias.rs index 9605c7fa9..4099a5d0e 100644 --- a/crates/completion/src/render/type_alias.rs +++ b/crates/completion/src/render/type_alias.rs | |||
@@ -27,7 +27,7 @@ struct TypeAliasRender<'a> { | |||
27 | 27 | ||
28 | impl<'a> TypeAliasRender<'a> { | 28 | impl<'a> TypeAliasRender<'a> { |
29 | fn new(ctx: RenderContext<'a>, type_alias: hir::TypeAlias) -> TypeAliasRender<'a> { | 29 | fn new(ctx: RenderContext<'a>, type_alias: hir::TypeAlias) -> TypeAliasRender<'a> { |
30 | let ast_node = type_alias.source(ctx.db()).value; | 30 | let ast_node = type_alias.source_old(ctx.db()).value; |
31 | TypeAliasRender { ctx, type_alias, ast_node } | 31 | TypeAliasRender { ctx, type_alias, ast_node } |
32 | } | 32 | } |
33 | 33 | ||