From fb775a293d42787ae7c3a78fc341cbbba5863fcd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 2 Jan 2019 17:11:04 +0300 Subject: make FileSymbol private --- crates/ra_analysis/src/lib.rs | 3 +-- crates/ra_analysis/src/symbol_index.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/ra_analysis') diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 75867ee86..392437ad9 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -31,13 +31,12 @@ use relative_path::RelativePathBuf; use crate::{ imp::{AnalysisHostImpl, AnalysisImpl}, - symbol_index::SymbolIndex, + symbol_index::{SymbolIndex, FileSymbol}, }; pub use crate::{ completion::{CompletionItem, CompletionItemKind, InsertText}, runnables::{Runnable, RunnableKind}, - symbol_index::FileSymbol, }; pub use ra_editor::{ Fold, FoldKind, HighlightedRange, LineIndex, StructureNode, Severity diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs index edb2268fb..56a84a850 100644 --- a/crates/ra_analysis/src/symbol_index.rs +++ b/crates/ra_analysis/src/symbol_index.rs @@ -125,14 +125,14 @@ fn is_type(kind: SyntaxKind) -> bool { } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct FileSymbol { - pub name: SmolStr, - pub node_range: TextRange, - pub kind: SyntaxKind, +pub(crate) struct FileSymbol { + pub(crate) name: SmolStr, + pub(crate) node_range: TextRange, + pub(crate) kind: SyntaxKind, } impl FileSymbol { - pub fn docs(&self, file: &SourceFileNode) -> Option { + pub(crate) fn docs(&self, file: &SourceFileNode) -> Option { file.syntax() .descendants() .filter(|node| node.kind() == self.kind && node.range() == self.node_range) @@ -162,7 +162,7 @@ impl FileSymbol { /// Get a description of this node. /// /// e.g. `struct Name`, `enum Name`, `fn Name` - pub fn description(&self, file: &SourceFileNode) -> Option { + pub(crate) fn description(&self, file: &SourceFileNode) -> Option { // TODO: After type inference is done, add type information to improve the output file.syntax() .descendants() -- cgit v1.2.3