diff options
author | Aleksey Kladov <[email protected]> | 2021-03-15 09:55:27 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-15 09:55:27 +0000 |
commit | 5dcdf2ceee2d9fcce9bb2bc5dcbafd5dbfc722b1 (patch) | |
tree | b83064da602dc881b15623959553aabc8b31bf91 /crates/ide/src | |
parent | cec676d08236076a48a9fdae28cf0e716ae99b16 (diff) |
Move code to the appropriate layer
StructureNodeKind is a type which is specific to a particular feature,
file_structure. It shouldn't be in the "code shared by all ide features"
part.
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/annotations.rs | 4 | ||||
-rw-r--r-- | crates/ide/src/file_structure.rs | 8 | ||||
-rw-r--r-- | crates/ide/src/lib.rs | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/crates/ide/src/annotations.rs b/crates/ide/src/annotations.rs index fd317874e..8e0a8fd8d 100644 --- a/crates/ide/src/annotations.rs +++ b/crates/ide/src/annotations.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use hir::Semantics; | 1 | use hir::Semantics; |
2 | use ide_db::{ | 2 | use ide_db::{ |
3 | base_db::{FileId, FilePosition, FileRange, SourceDatabase}, | 3 | base_db::{FileId, FilePosition, FileRange, SourceDatabase}, |
4 | RootDatabase, StructureNodeKind, SymbolKind, | 4 | RootDatabase, SymbolKind, |
5 | }; | 5 | }; |
6 | use syntax::TextRange; | 6 | use syntax::TextRange; |
7 | 7 | ||
@@ -11,7 +11,7 @@ use crate::{ | |||
11 | goto_implementation::goto_implementation, | 11 | goto_implementation::goto_implementation, |
12 | references::find_all_refs, | 12 | references::find_all_refs, |
13 | runnables::{runnables, Runnable}, | 13 | runnables::{runnables, Runnable}, |
14 | NavigationTarget, RunnableKind, | 14 | NavigationTarget, RunnableKind, StructureNodeKind, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | // Feature: Annotations | 17 | // Feature: Annotations |
diff --git a/crates/ide/src/file_structure.rs b/crates/ide/src/file_structure.rs index c21b3fa77..9f879a66e 100644 --- a/crates/ide/src/file_structure.rs +++ b/crates/ide/src/file_structure.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ide_db::{StructureNodeKind, SymbolKind}; | 1 | use ide_db::SymbolKind; |
2 | use syntax::{ | 2 | use syntax::{ |
3 | ast::{self, AttrsOwner, GenericParamsOwner, NameOwner}, | 3 | ast::{self, AttrsOwner, GenericParamsOwner, NameOwner}, |
4 | match_ast, AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange, | 4 | match_ast, AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange, |
@@ -16,6 +16,12 @@ pub struct StructureNode { | |||
16 | pub deprecated: bool, | 16 | pub deprecated: bool, |
17 | } | 17 | } |
18 | 18 | ||
19 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] | ||
20 | pub enum StructureNodeKind { | ||
21 | SymbolKind(SymbolKind), | ||
22 | Region, | ||
23 | } | ||
24 | |||
19 | // Feature: File Structure | 25 | // Feature: File Structure |
20 | // | 26 | // |
21 | // Provides a tree of the symbols defined in the file. Can be used to | 27 | // Provides a tree of the symbols defined in the file. Can be used to |
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index a8b169e87..662da5a96 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -71,7 +71,7 @@ pub use crate::{ | |||
71 | diagnostics::{Diagnostic, DiagnosticsConfig, Fix, Severity}, | 71 | diagnostics::{Diagnostic, DiagnosticsConfig, Fix, Severity}, |
72 | display::navigation_target::NavigationTarget, | 72 | display::navigation_target::NavigationTarget, |
73 | expand_macro::ExpandedMacro, | 73 | expand_macro::ExpandedMacro, |
74 | file_structure::StructureNode, | 74 | file_structure::{StructureNode, StructureNodeKind}, |
75 | folding_ranges::{Fold, FoldKind}, | 75 | folding_ranges::{Fold, FoldKind}, |
76 | hover::{HoverAction, HoverConfig, HoverGotoTypeData, HoverResult}, | 76 | hover::{HoverAction, HoverConfig, HoverGotoTypeData, HoverResult}, |
77 | inlay_hints::{InlayHint, InlayHintsConfig, InlayKind}, | 77 | inlay_hints::{InlayHint, InlayHintsConfig, InlayKind}, |
@@ -101,7 +101,7 @@ pub use ide_db::{ | |||
101 | search::{ReferenceAccess, SearchScope}, | 101 | search::{ReferenceAccess, SearchScope}, |
102 | source_change::{FileSystemEdit, SourceChange}, | 102 | source_change::{FileSystemEdit, SourceChange}, |
103 | symbol_index::Query, | 103 | symbol_index::Query, |
104 | RootDatabase, | 104 | RootDatabase, SymbolKind, |
105 | }; | 105 | }; |
106 | pub use ide_ssr::SsrError; | 106 | pub use ide_ssr::SsrError; |
107 | pub use syntax::{TextRange, TextSize}; | 107 | pub use syntax::{TextRange, TextSize}; |