diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-28 10:02:46 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-28 10:02:46 +0000 |
commit | 16030528b53d38e24c1e5733aa4cc46058d0bbd1 (patch) | |
tree | e878f88aebf11c0e54eff2e107dfaa4d192ab272 /crates/ra_assists/src | |
parent | 2702fa1c5d6d8ad504c0d7703b6363ea09ba5570 (diff) | |
parent | ccd1b0800a5de5e046e6e9a4b6f49030c1ce3639 (diff) |
Merge #2440
2440: Rename Source -> InFile r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/assist_ctx.rs | 4 | ||||
-rw-r--r-- | crates/ra_assists/src/assists/add_new.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index 0ea84d548..993aebc47 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! This module defines `AssistCtx` -- the API surface that is exposed to assists. | 1 | //! This module defines `AssistCtx` -- the API surface that is exposed to assists. |
2 | use hir::{db::HirDatabase, SourceAnalyzer}; | 2 | use hir::{db::HirDatabase, InFile, SourceAnalyzer}; |
3 | use ra_db::FileRange; | 3 | use ra_db::FileRange; |
4 | use ra_fmt::{leading_indent, reindent}; | 4 | use ra_fmt::{leading_indent, reindent}; |
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
@@ -117,7 +117,7 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> { | |||
117 | node: &SyntaxNode, | 117 | node: &SyntaxNode, |
118 | offset: Option<TextUnit>, | 118 | offset: Option<TextUnit>, |
119 | ) -> SourceAnalyzer { | 119 | ) -> SourceAnalyzer { |
120 | SourceAnalyzer::new(self.db, hir::Source::new(self.frange.file_id.into(), node), offset) | 120 | SourceAnalyzer::new(self.db, InFile::new(self.frange.file_id.into(), node), offset) |
121 | } | 121 | } |
122 | 122 | ||
123 | pub(crate) fn covering_node_for_range(&self, range: TextRange) -> SyntaxElement { | 123 | pub(crate) fn covering_node_for_range(&self, range: TextRange) -> SyntaxElement { |
diff --git a/crates/ra_assists/src/assists/add_new.rs b/crates/ra_assists/src/assists/add_new.rs index 8f68bd5fb..f977547fb 100644 --- a/crates/ra_assists/src/assists/add_new.rs +++ b/crates/ra_assists/src/assists/add_new.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use format_buf::format; | 1 | use format_buf::format; |
2 | use hir::{db::HirDatabase, FromSource}; | 2 | use hir::{db::HirDatabase, FromSource, InFile}; |
3 | use join_to_string::join; | 3 | use join_to_string::join; |
4 | use ra_syntax::{ | 4 | use ra_syntax::{ |
5 | ast::{ | 5 | ast::{ |
@@ -141,7 +141,7 @@ fn find_struct_impl( | |||
141 | })?; | 141 | })?; |
142 | 142 | ||
143 | let struct_ty = { | 143 | let struct_ty = { |
144 | let src = hir::Source { file_id: ctx.frange.file_id.into(), value: strukt.clone() }; | 144 | let src = InFile { file_id: ctx.frange.file_id.into(), value: strukt.clone() }; |
145 | hir::Struct::from_source(db, src).unwrap().ty(db) | 145 | hir::Struct::from_source(db, src).unwrap().ty(db) |
146 | }; | 146 | }; |
147 | 147 | ||
@@ -152,7 +152,7 @@ fn find_struct_impl( | |||
152 | return false; | 152 | return false; |
153 | } | 153 | } |
154 | 154 | ||
155 | let src = hir::Source { file_id: ctx.frange.file_id.into(), value: impl_blk.clone() }; | 155 | let src = InFile { file_id: ctx.frange.file_id.into(), value: impl_blk.clone() }; |
156 | let blk = hir::ImplBlock::from_source(db, src).unwrap(); | 156 | let blk = hir::ImplBlock::from_source(db, src).unwrap(); |
157 | 157 | ||
158 | let same_ty = blk.target_ty(db) == struct_ty; | 158 | let same_ty = blk.target_ty(db) == struct_ty; |