mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
make stuff private
This commit is contained in:
parent
cec67b2b65
commit
30481808fb
1 changed files with 3 additions and 3 deletions
|
@ -110,7 +110,7 @@ impl ExprScopes {
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct ScopesWithSourceMap {
|
pub struct ScopesWithSourceMap {
|
||||||
pub(crate) source_map: Arc<BodySourceMap>,
|
pub(crate) source_map: Arc<BodySourceMap>,
|
||||||
pub scopes: Arc<ExprScopes>,
|
pub(crate) scopes: Arc<ExprScopes>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
@ -134,7 +134,7 @@ impl ScopesWithSourceMap {
|
||||||
generate(self.scope_for(node), move |&scope| self.scopes.scopes[scope].parent)
|
generate(self.scope_for(node), move |&scope| self.scopes.scopes[scope].parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn scope_for_offset(&self, offset: TextUnit) -> Option<ScopeId> {
|
pub(crate) fn scope_for_offset(&self, offset: TextUnit) -> Option<ScopeId> {
|
||||||
self.scopes
|
self.scopes
|
||||||
.scope_for
|
.scope_for
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -211,7 +211,7 @@ impl ScopesWithSourceMap {
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn scope_for(&self, node: &SyntaxNode) -> Option<ScopeId> {
|
pub(crate) fn scope_for(&self, node: &SyntaxNode) -> Option<ScopeId> {
|
||||||
node.ancestors()
|
node.ancestors()
|
||||||
.map(SyntaxNodePtr::new)
|
.map(SyntaxNodePtr::new)
|
||||||
.filter_map(|ptr| self.source_map.syntax_expr(ptr))
|
.filter_map(|ptr| self.source_map.syntax_expr(ptr))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue