diff options
author | Aleksey Kladov <[email protected]> | 2019-01-08 08:28:42 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-08 08:28:42 +0000 |
commit | da0b348ae9f629c5cbe4a836a90ed85e36ca18e5 (patch) | |
tree | 614fd83f614632e3c87130117421708a7a028c13 /crates/ra_hir/src/code_model_api.rs | |
parent | d6020f516f2826dac7188171241e9a72d6248cf8 (diff) |
migrate ra_hir to rowan 2.0
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 09b532f74..43cddb504 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use relative_path::RelativePathBuf; | 1 | use relative_path::RelativePathBuf; |
2 | use ra_db::{CrateId, Cancelable, FileId}; | 2 | use ra_db::{CrateId, Cancelable, FileId}; |
3 | use ra_syntax::{ast, SyntaxNode}; | 3 | use ra_syntax::{ast, TreePtr, SyntaxNode}; |
4 | 4 | ||
5 | use crate::{Name, db::HirDatabase, DefId, Path, PerNs, nameres::ModuleScope}; | 5 | use crate::{Name, db::HirDatabase, DefId, Path, PerNs, nameres::ModuleScope}; |
6 | 6 | ||
@@ -36,8 +36,8 @@ pub struct Module { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | pub enum ModuleSource { | 38 | pub enum ModuleSource { |
39 | SourceFile(ast::SourceFileNode), | 39 | SourceFile(TreePtr<ast::SourceFile>), |
40 | Module(ast::ModuleNode), | 40 | Module(TreePtr<ast::Module>), |
41 | } | 41 | } |
42 | 42 | ||
43 | #[derive(Clone, Debug, Hash, PartialEq, Eq)] | 43 | #[derive(Clone, Debug, Hash, PartialEq, Eq)] |
@@ -66,7 +66,7 @@ impl Module { | |||
66 | pub fn declaration_source( | 66 | pub fn declaration_source( |
67 | &self, | 67 | &self, |
68 | db: &impl HirDatabase, | 68 | db: &impl HirDatabase, |
69 | ) -> Cancelable<Option<(FileId, ast::ModuleNode)>> { | 69 | ) -> Cancelable<Option<(FileId, TreePtr<ast::Module>)>> { |
70 | self.declaration_source_impl(db) | 70 | self.declaration_source_impl(db) |
71 | } | 71 | } |
72 | 72 | ||
@@ -104,7 +104,10 @@ impl Module { | |||
104 | pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> { | 104 | pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> { |
105 | self.resolve_path_impl(db, path) | 105 | self.resolve_path_impl(db, path) |
106 | } | 106 | } |
107 | pub fn problems(&self, db: &impl HirDatabase) -> Cancelable<Vec<(SyntaxNode, Problem)>> { | 107 | pub fn problems( |
108 | &self, | ||
109 | db: &impl HirDatabase, | ||
110 | ) -> Cancelable<Vec<(TreePtr<SyntaxNode>, Problem)>> { | ||
108 | self.problems_impl(db) | 111 | self.problems_impl(db) |
109 | } | 112 | } |
110 | } | 113 | } |