mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Shuffle hir-expand things around
This commit is contained in:
parent
e320004dad
commit
880baa9e56
8 changed files with 295 additions and 258 deletions
|
@ -155,7 +155,14 @@ impl PartialEq for AstIdMap {
|
|||
impl Eq for AstIdMap {}
|
||||
|
||||
impl AstIdMap {
|
||||
pub(crate) fn from_source(node: &SyntaxNode) -> AstIdMap {
|
||||
pub(crate) fn ast_id_map(
|
||||
db: &dyn ExpandDatabase,
|
||||
file_id: span::HirFileId,
|
||||
) -> triomphe::Arc<AstIdMap> {
|
||||
triomphe::Arc::new(AstIdMap::from_source(&db.parse_or_expand(file_id)))
|
||||
}
|
||||
|
||||
fn from_source(node: &SyntaxNode) -> AstIdMap {
|
||||
assert!(node.parent().is_none());
|
||||
let mut res = AstIdMap::default();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue