diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-11 16:29:42 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-11 16:29:42 +0100 |
commit | 80aa9d5f9f55341d2a51176e385d8aa6d2d2cec8 (patch) | |
tree | b6fee9faf5f82ba6ee063667605e39ac3bcbe37c /crates/ra_assists/src | |
parent | e505fe9d7b96f3454711e923c70d763c5cee5f47 (diff) | |
parent | ff6f6b3a5223ddab81c7357a3c59bdb09936a552 (diff) |
Merge #1395
1395: move docs under code model 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/add_missing_impl_members.rs | 4 | ||||
-rw-r--r-- | crates/ra_assists/src/fill_match_arms.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/add_missing_impl_members.rs b/crates/ra_assists/src/add_missing_impl_members.rs index 23c01e747..0e49b0401 100644 --- a/crates/ra_assists/src/add_missing_impl_members.rs +++ b/crates/ra_assists/src/add_missing_impl_members.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use crate::{Assist, AssistId, AssistCtx, ast_editor::{AstEditor, AstBuilder}}; | 1 | use crate::{Assist, AssistId, AssistCtx, ast_editor::{AstEditor, AstBuilder}}; |
2 | 2 | ||
3 | use hir::db::HirDatabase; | 3 | use hir::{HasSource, db::HirDatabase}; |
4 | use ra_syntax::{SmolStr, TreeArc}; | 4 | use ra_syntax::{SmolStr, TreeArc}; |
5 | use ra_syntax::ast::{self, AstNode, FnDef, ImplItem, ImplItemKind, NameOwner}; | 5 | use ra_syntax::ast::{self, AstNode, FnDef, ImplItem, ImplItemKind, NameOwner}; |
6 | use ra_db::FilePosition; | 6 | use ra_db::FilePosition; |
@@ -110,7 +110,7 @@ fn resolve_target_trait_def( | |||
110 | impl_block.target_trait().map(AstNode::syntax).and_then(ast::PathType::cast)?.path()?; | 110 | impl_block.target_trait().map(AstNode::syntax).and_then(ast::PathType::cast)?.path()?; |
111 | 111 | ||
112 | match analyzer.resolve_path(db, &ast_path) { | 112 | match analyzer.resolve_path(db, &ast_path) { |
113 | Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def.source(db).1), | 113 | Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def.source(db).ast), |
114 | _ => None, | 114 | _ => None, |
115 | } | 115 | } |
116 | } | 116 | } |
diff --git a/crates/ra_assists/src/fill_match_arms.rs b/crates/ra_assists/src/fill_match_arms.rs index 45e327cd4..a7de6ae9f 100644 --- a/crates/ra_assists/src/fill_match_arms.rs +++ b/crates/ra_assists/src/fill_match_arms.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::fmt::Write; | 1 | use std::fmt::Write; |
2 | 2 | ||
3 | use hir::{ | 3 | use hir::{ |
4 | AdtDef, FieldSource, | 4 | AdtDef, FieldSource, HasSource, |
5 | db::HirDatabase, | 5 | db::HirDatabase, |
6 | }; | 6 | }; |
7 | use ra_syntax::ast::{self, AstNode}; | 7 | use ra_syntax::ast::{self, AstNode}; |
@@ -44,8 +44,8 @@ pub(crate) fn fill_match_arms(mut ctx: AssistCtx<impl HirDatabase>) -> Option<As | |||
44 | .into_iter() | 44 | .into_iter() |
45 | .map(|field| { | 45 | .map(|field| { |
46 | let name = field.name(db).to_string(); | 46 | let name = field.name(db).to_string(); |
47 | let (_, source) = field.source(db); | 47 | let src = field.source(db); |
48 | match source { | 48 | match src.ast { |
49 | FieldSource::Named(_) => name, | 49 | FieldSource::Named(_) => name, |
50 | FieldSource::Pos(_) => "_".to_string(), | 50 | FieldSource::Pos(_) => "_".to_string(), |
51 | } | 51 | } |