diff options
author | Aleksey Kladov <[email protected]> | 2019-01-11 16:59:06 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-11 16:59:06 +0000 |
commit | 2d3940d0ab862dbfaed4f4c844faaca6a38e31e9 (patch) | |
tree | 0d8412f73a0fa6f9c1e6913e6133d3daf25dcb91 /crates/ra_db | |
parent | aad1bf877e4ba5ce9e28e8bde14f790ef8d1551b (diff) |
rename TreePtr -> TreeArc
This is much clearer about the semantics
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/lib.rs | 6 | ||||
-rw-r--r-- | crates/ra_db/src/syntax_ptr.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 20e712afe..0c4dfc8c6 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -7,7 +7,7 @@ pub mod mock; | |||
7 | 7 | ||
8 | use std::panic; | 8 | use std::panic; |
9 | 9 | ||
10 | use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr}; | 10 | use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; |
11 | 11 | ||
12 | pub use crate::{ | 12 | pub use crate::{ |
13 | cancellation::{Canceled, Cancelable}, | 13 | cancellation::{Canceled, Cancelable}, |
@@ -40,13 +40,13 @@ pub trait BaseDatabase: salsa::Database + panic::RefUnwindSafe { | |||
40 | 40 | ||
41 | salsa::query_group! { | 41 | salsa::query_group! { |
42 | pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { | 42 | pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { |
43 | fn source_file(file_id: FileId) -> TreePtr<SourceFile> { | 43 | fn source_file(file_id: FileId) -> TreeArc<SourceFile> { |
44 | type SourceFileQuery; | 44 | type SourceFileQuery; |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreePtr<SourceFile> { | 49 | fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> { |
50 | let text = db.file_text(file_id); | 50 | let text = db.file_text(file_id); |
51 | SourceFile::parse(&*text) | 51 | SourceFile::parse(&*text) |
52 | } | 52 | } |
diff --git a/crates/ra_db/src/syntax_ptr.rs b/crates/ra_db/src/syntax_ptr.rs index be64d417c..5270826da 100644 --- a/crates/ra_db/src/syntax_ptr.rs +++ b/crates/ra_db/src/syntax_ptr.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreePtr}; | 1 | use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreeArc}; |
2 | 2 | ||
3 | /// A pointer to a syntax node inside a file. | 3 | /// A pointer to a syntax node inside a file. |
4 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 4 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -15,7 +15,7 @@ impl LocalSyntaxPtr { | |||
15 | } | 15 | } |
16 | } | 16 | } |
17 | 17 | ||
18 | pub fn resolve(self, file: &SourceFile) -> TreePtr<SyntaxNode> { | 18 | pub fn resolve(self, file: &SourceFile) -> TreeArc<SyntaxNode> { |
19 | let mut curr = file.syntax(); | 19 | let mut curr = file.syntax(); |
20 | loop { | 20 | loop { |
21 | if curr.range() == self.range && curr.kind() == self.kind { | 21 | if curr.range() == self.range && curr.kind() == self.kind { |