aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/annotations.rs
diff options
context:
space:
mode:
authorivan770 <[email protected]>2021-03-14 15:16:29 +0000
committerivan770 <[email protected]>2021-03-14 17:00:41 +0000
commit7d48e04f316a384967d48a261f1e3b70b5f85a98 (patch)
tree76eb426dcfa87e3b32f3b0efb4f88ca4416c57af /crates/ide/src/annotations.rs
parent8602f9573b3a450b6a29c23bb4bfb7bd4108a89c (diff)
Introduce StructureNodeKind
Diffstat (limited to 'crates/ide/src/annotations.rs')
-rw-r--r--crates/ide/src/annotations.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/crates/ide/src/annotations.rs b/crates/ide/src/annotations.rs
index 2e8e82b70..fd317874e 100644
--- a/crates/ide/src/annotations.rs
+++ b/crates/ide/src/annotations.rs
@@ -1,7 +1,7 @@
1use hir::Semantics; 1use hir::Semantics;
2use ide_db::{ 2use ide_db::{
3 base_db::{FileId, FilePosition, FileRange, SourceDatabase}, 3 base_db::{FileId, FilePosition, FileRange, SourceDatabase},
4 RootDatabase, SymbolKind, 4 RootDatabase, StructureNodeKind, SymbolKind,
5}; 5};
6use syntax::TextRange; 6use syntax::TextRange;
7 7
@@ -80,15 +80,17 @@ pub(crate) fn annotations(
80 .filter(|node| { 80 .filter(|node| {
81 matches!( 81 matches!(
82 node.kind, 82 node.kind,
83 SymbolKind::Trait 83 StructureNodeKind::SymbolKind(SymbolKind::Trait)
84 | SymbolKind::Struct 84 | StructureNodeKind::SymbolKind(SymbolKind::Struct)
85 | SymbolKind::Enum 85 | StructureNodeKind::SymbolKind(SymbolKind::Enum)
86 | SymbolKind::Union 86 | StructureNodeKind::SymbolKind(SymbolKind::Union)
87 | SymbolKind::Const 87 | StructureNodeKind::SymbolKind(SymbolKind::Const)
88 ) 88 )
89 }) 89 })
90 .for_each(|node| { 90 .for_each(|node| {
91 if config.annotate_impls && node.kind != SymbolKind::Const { 91 if config.annotate_impls
92 && node.kind != StructureNodeKind::SymbolKind(SymbolKind::Const)
93 {
92 annotations.push(Annotation { 94 annotations.push(Annotation {
93 range: node.node_range, 95 range: node.node_range,
94 kind: AnnotationKind::HasImpls { 96 kind: AnnotationKind::HasImpls {