From f411c2988d40bbdebc5c9a63ce4bfb883a2fbca1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 17:34:01 +0300 Subject: use Source for Trait --- crates/ra_assists/src/add_missing_impl_members.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/add_missing_impl_members.rs b/crates/ra_assists/src/add_missing_impl_members.rs index 23c01e747..046f53a8c 100644 --- a/crates/ra_assists/src/add_missing_impl_members.rs +++ b/crates/ra_assists/src/add_missing_impl_members.rs @@ -110,7 +110,7 @@ fn resolve_target_trait_def( impl_block.target_trait().map(AstNode::syntax).and_then(ast::PathType::cast)?.path()?; match analyzer.resolve_path(db, &ast_path) { - Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def.source(db).1), + Some(hir::PathResolution::Def(hir::ModuleDef::Trait(def))) => Some(def.source(db).ast), _ => None, } } -- cgit v1.2.3 From 178d8e96b5c810f40e7dd282ab06bb25d1fc8a2a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 17:43:36 +0300 Subject: use Source for StructField --- crates/ra_assists/src/fill_match_arms.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/fill_match_arms.rs b/crates/ra_assists/src/fill_match_arms.rs index 45e327cd4..0e08830d1 100644 --- a/crates/ra_assists/src/fill_match_arms.rs +++ b/crates/ra_assists/src/fill_match_arms.rs @@ -44,8 +44,8 @@ pub(crate) fn fill_match_arms(mut ctx: AssistCtx) -> Option name, FieldSource::Pos(_) => "_".to_string(), } -- cgit v1.2.3 From c4512fadb1b332b13bb41b0aa8a28aa964664842 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 17:54:51 +0300 Subject: remove inherent source impls --- crates/ra_assists/src/add_missing_impl_members.rs | 2 +- crates/ra_assists/src/fill_match_arms.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/add_missing_impl_members.rs b/crates/ra_assists/src/add_missing_impl_members.rs index 046f53a8c..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 @@ use crate::{Assist, AssistId, AssistCtx, ast_editor::{AstEditor, AstBuilder}}; -use hir::db::HirDatabase; +use hir::{HasSource, db::HirDatabase}; use ra_syntax::{SmolStr, TreeArc}; use ra_syntax::ast::{self, AstNode, FnDef, ImplItem, ImplItemKind, NameOwner}; use ra_db::FilePosition; diff --git a/crates/ra_assists/src/fill_match_arms.rs b/crates/ra_assists/src/fill_match_arms.rs index 0e08830d1..a7de6ae9f 100644 --- a/crates/ra_assists/src/fill_match_arms.rs +++ b/crates/ra_assists/src/fill_match_arms.rs @@ -1,7 +1,7 @@ use std::fmt::Write; use hir::{ - AdtDef, FieldSource, + AdtDef, FieldSource, HasSource, db::HirDatabase, }; use ra_syntax::ast::{self, AstNode}; -- cgit v1.2.3