remove inherent source impls

This commit is contained in:
Aleksey Kladov 2019-06-11 17:54:51 +03:00
parent dd63f17027
commit c4512fadb1
15 changed files with 22 additions and 67 deletions

View file

@ -1,7 +1,7 @@
//! This modules takes care of rendering various defenitions as completion items.
use join_to_string::join;
use test_utils::tested_by;
use hir::{Docs, PerNs, Resolution, HirDisplay};
use hir::{Docs, PerNs, Resolution, HirDisplay, HasSource};
use ra_syntax::ast::NameOwner;
use crate::completion::{

View file

@ -1,10 +1,11 @@
use super::{where_predicates, generic_parameters};
use crate::db;
use std::fmt::{self, Display};
use join_to_string::join;
use ra_syntax::ast::{self, AstNode, NameOwner, VisibilityOwner};
use std::convert::From;
use hir::{Docs, Documentation};
use hir::{Docs, Documentation, HasSource};
use crate::{db, display::{where_predicates, generic_parameters}};
/// Contains information about a function signature
#[derive(Debug)]

View file

@ -5,7 +5,7 @@ use ra_syntax::{
ast::{self, DocCommentsOwner},
algo::visit::{visitor, Visitor},
};
use hir::{ModuleSource, FieldSource, ImplItem};
use hir::{ModuleSource, FieldSource, ImplItem, HasSource};
use crate::{FileSymbol, db::RootDatabase};
use super::short_label::ShortLabel;
@ -182,7 +182,7 @@ impl NavigationTarget {
pub(crate) fn from_def_source<A, D>(db: &RootDatabase, def: D) -> NavigationTarget
where
D: hir::HasSource<Ast = TreeArc<A>>,
D: HasSource<Ast = TreeArc<A>>,
A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel,
{
let src = def.source(db);

View file

@ -4,7 +4,7 @@ use ra_syntax::{
ast::{self, DocCommentsOwner},
algo::{find_covering_element, find_node_at_offset, ancestors_at_offset, visit::{visitor, Visitor}},
};
use hir::HirDisplay;
use hir::{HirDisplay, HasSource};
use crate::{
db::RootDatabase,
@ -226,7 +226,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
fn from_def_source<A, D>(db: &RootDatabase, def: D) -> Option<String>
where
D: hir::HasSource<Ast = TreeArc<A>>,
D: HasSource<Ast = TreeArc<A>>,
A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel,
{
let src = def.source(db);