mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
rename TreePtr -> TreeArc
This is much clearer about the semantics
This commit is contained in:
parent
aad1bf877e
commit
2d3940d0ab
25 changed files with 197 additions and 197 deletions
|
@ -1,6 +1,6 @@
|
|||
use ra_db::{Cancelable, SyntaxDatabase};
|
||||
use ra_syntax::{
|
||||
AstNode, SyntaxNode, TreePtr,
|
||||
AstNode, SyntaxNode, TreeArc,
|
||||
ast::{self, NameOwner},
|
||||
algo::{find_covering_node, find_node_at_offset, find_leaf_at_offset, visit::{visitor, Visitor}},
|
||||
};
|
||||
|
@ -87,7 +87,7 @@ fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Cancelable<Option<S
|
|||
}
|
||||
|
||||
impl NavigationTarget {
|
||||
fn node(&self, db: &RootDatabase) -> Option<TreePtr<SyntaxNode>> {
|
||||
fn node(&self, db: &RootDatabase) -> Option<TreeArc<SyntaxNode>> {
|
||||
let source_file = db.source_file(self.file_id());
|
||||
let source_file = source_file.syntax();
|
||||
let node = source_file
|
||||
|
|
|
@ -35,7 +35,7 @@ mod parent_module;
|
|||
|
||||
use std::{fmt, sync::Arc};
|
||||
|
||||
use ra_syntax::{SourceFile, TreePtr, TextRange, TextUnit};
|
||||
use ra_syntax::{SourceFile, TreeArc, TextRange, TextUnit};
|
||||
use ra_text_edit::TextEdit;
|
||||
use ra_db::{SyntaxDatabase, FilesDatabase, BaseDatabase};
|
||||
use rayon::prelude::*;
|
||||
|
@ -303,7 +303,7 @@ impl Analysis {
|
|||
}
|
||||
|
||||
/// Gets the syntax tree of the file.
|
||||
pub fn file_syntax(&self, file_id: FileId) -> TreePtr<SourceFile> {
|
||||
pub fn file_syntax(&self, file_id: FileId) -> TreeArc<SourceFile> {
|
||||
self.db.source_file(file_id).clone()
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ use std::{
|
|||
|
||||
use fst::{self, Streamer};
|
||||
use ra_syntax::{
|
||||
SyntaxNode, SourceFile, SmolStr, TreePtr, AstNode,
|
||||
SyntaxNode, SourceFile, SmolStr, TreeArc, AstNode,
|
||||
algo::{visit::{visitor, Visitor}, find_covering_node},
|
||||
SyntaxKind::{self, *},
|
||||
ast::{self, NameOwner},
|
||||
|
@ -141,7 +141,7 @@ impl SymbolIndex {
|
|||
}
|
||||
|
||||
pub(crate) fn for_files(
|
||||
files: impl ParallelIterator<Item = (FileId, TreePtr<SourceFile>)>,
|
||||
files: impl ParallelIterator<Item = (FileId, TreeArc<SourceFile>)>,
|
||||
) -> SymbolIndex {
|
||||
let symbols = files
|
||||
.flat_map(|(file_id, file)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue