diff options
author | Aleksey Kladov <[email protected]> | 2020-04-17 10:38:51 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-17 11:25:41 +0100 |
commit | 302bf97bbf1855e3c7def9ab4f9f3d338be5e3b7 (patch) | |
tree | f26fcf569dea4fa40ca3814d30e340572a66374b /crates/ra_hir_def/src/diagnostics.rs | |
parent | 69f0cb6cd77c2dc93f2eed180a6c16fd8c3fca5a (diff) |
Don't expose impl details of SyntaxPtr
Diffstat (limited to 'crates/ra_hir_def/src/diagnostics.rs')
-rw-r--r-- | crates/ra_hir_def/src/diagnostics.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs index cfa0f2f76..dbaf4deef 100644 --- a/crates/ra_hir_def/src/diagnostics.rs +++ b/crates/ra_hir_def/src/diagnostics.rs | |||
@@ -4,7 +4,7 @@ use std::any::Any; | |||
4 | 4 | ||
5 | use hir_expand::diagnostics::Diagnostic; | 5 | use hir_expand::diagnostics::Diagnostic; |
6 | use ra_db::RelativePathBuf; | 6 | use ra_db::RelativePathBuf; |
7 | use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; | 7 | use ra_syntax::{ast, AstPtr, SyntaxNodePtr, TextRange}; |
8 | 8 | ||
9 | use hir_expand::{HirFileId, InFile}; | 9 | use hir_expand::{HirFileId, InFile}; |
10 | 10 | ||
@@ -12,6 +12,7 @@ use hir_expand::{HirFileId, InFile}; | |||
12 | pub struct UnresolvedModule { | 12 | pub struct UnresolvedModule { |
13 | pub file: HirFileId, | 13 | pub file: HirFileId, |
14 | pub decl: AstPtr<ast::Module>, | 14 | pub decl: AstPtr<ast::Module>, |
15 | pub highlight_range: TextRange, | ||
15 | pub candidate: RelativePathBuf, | 16 | pub candidate: RelativePathBuf, |
16 | } | 17 | } |
17 | 18 | ||
@@ -19,6 +20,9 @@ impl Diagnostic for UnresolvedModule { | |||
19 | fn message(&self) -> String { | 20 | fn message(&self) -> String { |
20 | "unresolved module".to_string() | 21 | "unresolved module".to_string() |
21 | } | 22 | } |
23 | fn highlight_range(&self) -> TextRange { | ||
24 | self.highlight_range | ||
25 | } | ||
22 | fn source(&self) -> InFile<SyntaxNodePtr> { | 26 | fn source(&self) -> InFile<SyntaxNodePtr> { |
23 | InFile { file_id: self.file, value: self.decl.clone().into() } | 27 | InFile { file_id: self.file, value: self.decl.clone().into() } |
24 | } | 28 | } |