aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/diagnostics.rs6
-rw-r--r--crates/ra_hir_def/src/nameres.rs3
2 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs
index 2ee28fbaa..510c5e064 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
5use hir_expand::diagnostics::Diagnostic; 5use hir_expand::diagnostics::Diagnostic;
6use ra_db::RelativePathBuf; 6use ra_db::RelativePathBuf;
7use ra_syntax::{ast, AstPtr, SyntaxNodePtr, TextRange}; 7use ra_syntax::{ast, AstPtr, SyntaxNodePtr};
8 8
9use hir_expand::{HirFileId, InFile}; 9use hir_expand::{HirFileId, InFile};
10 10
@@ -12,7 +12,6 @@ use hir_expand::{HirFileId, InFile};
12pub struct UnresolvedModule { 12pub 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,
16 pub candidate: RelativePathBuf, 15 pub candidate: RelativePathBuf,
17} 16}
18 17
@@ -20,9 +19,6 @@ impl Diagnostic for UnresolvedModule {
20 fn message(&self) -> String { 19 fn message(&self) -> String {
21 "unresolved module".to_string() 20 "unresolved module".to_string()
22 } 21 }
23 fn highlight_range(&self) -> InFile<TextRange> {
24 InFile::new(self.file, self.highlight_range)
25 }
26 fn source(&self) -> InFile<SyntaxNodePtr> { 22 fn source(&self) -> InFile<SyntaxNodePtr> {
27 InFile::new(self.file, self.decl.clone().into()) 23 InFile::new(self.file, self.decl.clone().into())
28 } 24 }
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index 4a5a93dad..f279c2ad4 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -297,7 +297,7 @@ pub enum ModuleSource {
297mod diagnostics { 297mod diagnostics {
298 use hir_expand::diagnostics::DiagnosticSink; 298 use hir_expand::diagnostics::DiagnosticSink;
299 use ra_db::RelativePathBuf; 299 use ra_db::RelativePathBuf;
300 use ra_syntax::{ast, AstNode, AstPtr}; 300 use ra_syntax::{ast, AstPtr};
301 301
302 use crate::{db::DefDatabase, diagnostics::UnresolvedModule, nameres::LocalModuleId, AstId}; 302 use crate::{db::DefDatabase, diagnostics::UnresolvedModule, nameres::LocalModuleId, AstId};
303 303
@@ -326,7 +326,6 @@ mod diagnostics {
326 sink.push(UnresolvedModule { 326 sink.push(UnresolvedModule {
327 file: declaration.file_id, 327 file: declaration.file_id,
328 decl: AstPtr::new(&decl), 328 decl: AstPtr::new(&decl),
329 highlight_range: decl.syntax().text_range(),
330 candidate: candidate.clone(), 329 candidate: candidate.clone(),
331 }) 330 })
332 } 331 }