aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/diagnostics.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-16 17:45:58 +0100
committerAleksey Kladov <[email protected]>2020-06-16 17:45:58 +0100
commit3c72fc05738b8a08dbf90dab18a15b9894d9e2a1 (patch)
tree18501e20ac9848d31019c572170aee9259f1d0ea /crates/ra_hir_def/src/diagnostics.rs
parentda34d630b878f14e85be02b8ffdb702edf736539 (diff)
Anchor file-system operations to the file, and not to the source root.
Anchoring to the SourceRoot wont' work if the path is absolute: #[path = "/tmp/foo.rs"] mod foo; Anchoring to a file will. However, we *should* anchor, instead of just producing an abs path. I can imagine a situation where, for example, rust-analyzer processes crates from different machines (or, for example, from in-memory git branch), where the same absolute path in different crates might refer to different files in the end!
Diffstat (limited to 'crates/ra_hir_def/src/diagnostics.rs')
-rw-r--r--crates/ra_hir_def/src/diagnostics.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs
index 510c5e064..30db48f86 100644
--- a/crates/ra_hir_def/src/diagnostics.rs
+++ b/crates/ra_hir_def/src/diagnostics.rs
@@ -3,7 +3,6 @@
3use std::any::Any; 3use std::any::Any;
4 4
5use hir_expand::diagnostics::Diagnostic; 5use hir_expand::diagnostics::Diagnostic;
6use ra_db::RelativePathBuf;
7use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; 6use ra_syntax::{ast, AstPtr, SyntaxNodePtr};
8 7
9use hir_expand::{HirFileId, InFile}; 8use hir_expand::{HirFileId, InFile};
@@ -12,7 +11,7 @@ use hir_expand::{HirFileId, InFile};
12pub struct UnresolvedModule { 11pub struct UnresolvedModule {
13 pub file: HirFileId, 12 pub file: HirFileId,
14 pub decl: AstPtr<ast::Module>, 13 pub decl: AstPtr<ast::Module>,
15 pub candidate: RelativePathBuf, 14 pub candidate: String,
16} 15}
17 16
18impl Diagnostic for UnresolvedModule { 17impl Diagnostic for UnresolvedModule {