diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/completion/presentation.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/display/function_signature.rs | 7 | ||||
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 4 |
4 files changed, 9 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 495899262..f4ff4404b 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! This modules takes care of rendering various defenitions as completion items. | 1 | //! This modules takes care of rendering various defenitions as completion items. |
2 | use join_to_string::join; | 2 | use join_to_string::join; |
3 | use test_utils::tested_by; | 3 | use test_utils::tested_by; |
4 | use hir::{Docs, PerNs, Resolution, HirDisplay}; | 4 | use hir::{Docs, PerNs, Resolution, HirDisplay, HasSource}; |
5 | use ra_syntax::ast::NameOwner; | 5 | use ra_syntax::ast::NameOwner; |
6 | 6 | ||
7 | use crate::completion::{ | 7 | use crate::completion::{ |
diff --git a/crates/ra_ide_api/src/display/function_signature.rs b/crates/ra_ide_api/src/display/function_signature.rs index d0c155de7..b0b0c7122 100644 --- a/crates/ra_ide_api/src/display/function_signature.rs +++ b/crates/ra_ide_api/src/display/function_signature.rs | |||
@@ -1,10 +1,11 @@ | |||
1 | use super::{where_predicates, generic_parameters}; | ||
2 | use crate::db; | ||
3 | use std::fmt::{self, Display}; | 1 | use std::fmt::{self, Display}; |
2 | |||
4 | use join_to_string::join; | 3 | use join_to_string::join; |
5 | use ra_syntax::ast::{self, AstNode, NameOwner, VisibilityOwner}; | 4 | use ra_syntax::ast::{self, AstNode, NameOwner, VisibilityOwner}; |
6 | use std::convert::From; | 5 | use std::convert::From; |
7 | use hir::{Docs, Documentation}; | 6 | use hir::{Docs, Documentation, HasSource}; |
7 | |||
8 | use crate::{db, display::{where_predicates, generic_parameters}}; | ||
8 | 9 | ||
9 | /// Contains information about a function signature | 10 | /// Contains information about a function signature |
10 | #[derive(Debug)] | 11 | #[derive(Debug)] |
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index d7687e1a4..1e9cdaff4 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -5,7 +5,7 @@ use ra_syntax::{ | |||
5 | ast::{self, DocCommentsOwner}, | 5 | ast::{self, DocCommentsOwner}, |
6 | algo::visit::{visitor, Visitor}, | 6 | algo::visit::{visitor, Visitor}, |
7 | }; | 7 | }; |
8 | use hir::{ModuleSource, FieldSource, ImplItem}; | 8 | use hir::{ModuleSource, FieldSource, ImplItem, HasSource}; |
9 | 9 | ||
10 | use crate::{FileSymbol, db::RootDatabase}; | 10 | use crate::{FileSymbol, db::RootDatabase}; |
11 | use super::short_label::ShortLabel; | 11 | use super::short_label::ShortLabel; |
@@ -182,7 +182,7 @@ impl NavigationTarget { | |||
182 | 182 | ||
183 | pub(crate) fn from_def_source<A, D>(db: &RootDatabase, def: D) -> NavigationTarget | 183 | pub(crate) fn from_def_source<A, D>(db: &RootDatabase, def: D) -> NavigationTarget |
184 | where | 184 | where |
185 | D: hir::HasSource<Ast = TreeArc<A>>, | 185 | D: HasSource<Ast = TreeArc<A>>, |
186 | A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel, | 186 | A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel, |
187 | { | 187 | { |
188 | let src = def.source(db); | 188 | let src = def.source(db); |
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 77657607b..ad00abe49 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -4,7 +4,7 @@ use ra_syntax::{ | |||
4 | ast::{self, DocCommentsOwner}, | 4 | ast::{self, DocCommentsOwner}, |
5 | algo::{find_covering_element, find_node_at_offset, ancestors_at_offset, visit::{visitor, Visitor}}, | 5 | algo::{find_covering_element, find_node_at_offset, ancestors_at_offset, visit::{visitor, Visitor}}, |
6 | }; | 6 | }; |
7 | use hir::HirDisplay; | 7 | use hir::{HirDisplay, HasSource}; |
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{ |
10 | db::RootDatabase, | 10 | db::RootDatabase, |
@@ -226,7 +226,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
226 | 226 | ||
227 | fn from_def_source<A, D>(db: &RootDatabase, def: D) -> Option<String> | 227 | fn from_def_source<A, D>(db: &RootDatabase, def: D) -> Option<String> |
228 | where | 228 | where |
229 | D: hir::HasSource<Ast = TreeArc<A>>, | 229 | D: HasSource<Ast = TreeArc<A>>, |
230 | A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel, | 230 | A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel, |
231 | { | 231 | { |
232 | let src = def.source(db); | 232 | let src = def.source(db); |