mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-06 18:28:51 +00:00
146f6f5a45
It's not entirely clear what subnode ranges should mean in the presence of macros, so let's leave them out for now. We are not using them heavily anyway.
28 lines
664 B
Rust
28 lines
664 B
Rust
//! Diagnostics produced by `hir_def`.
|
|
|
|
use std::any::Any;
|
|
|
|
use hir_expand::diagnostics::Diagnostic;
|
|
use ra_db::RelativePathBuf;
|
|
use ra_syntax::{ast, AstPtr, SyntaxNodePtr};
|
|
|
|
use hir_expand::{HirFileId, InFile};
|
|
|
|
#[derive(Debug)]
|
|
pub struct UnresolvedModule {
|
|
pub file: HirFileId,
|
|
pub decl: AstPtr<ast::Module>,
|
|
pub candidate: RelativePathBuf,
|
|
}
|
|
|
|
impl Diagnostic for UnresolvedModule {
|
|
fn message(&self) -> String {
|
|
"unresolved module".to_string()
|
|
}
|
|
fn source(&self) -> InFile<SyntaxNodePtr> {
|
|
InFile::new(self.file, self.decl.clone().into())
|
|
}
|
|
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
|
self
|
|
}
|
|
}
|