mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
add notable_trait predicate to CompletionRelevance
implement the predicate set on the case function from traits
This commit is contained in:
parent
af40101841
commit
df5c647982
5 changed files with 28 additions and 0 deletions
|
@ -529,6 +529,11 @@ impl CompletionContext<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Whether the given trait has `#[doc(notable_trait)]`
|
||||
pub(crate) fn is_doc_notable_trait(&self, trait_: hir::Trait) -> bool {
|
||||
trait_.attrs(self.db).has_doc_notable_trait()
|
||||
}
|
||||
|
||||
/// Returns the traits in scope, with the [`Drop`] trait removed.
|
||||
pub(crate) fn traits_in_scope(&self) -> hir::VisibleTraits {
|
||||
let mut traits_in_scope = self.scope.visible_traits();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue