mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Add View Mir
command and fix some bugs
This commit is contained in:
parent
a25710b0c0
commit
ac04bfd7a7
23 changed files with 876 additions and 122 deletions
|
@ -10,8 +10,8 @@ use hir_expand::InFile;
|
|||
use syntax::ast;
|
||||
|
||||
use crate::{
|
||||
db::HirDatabase, Adt, Const, Enum, Field, FieldSource, Function, Impl, LifetimeParam, Macro,
|
||||
Module, Static, Struct, Trait, TraitAlias, TypeAlias, TypeOrConstParam, Union, Variant,
|
||||
db::HirDatabase, Adt, Const, Enum, Field, FieldSource, Function, Impl, LifetimeParam,
|
||||
LocalSource, Macro, Module, Static, Struct, Trait, TypeAlias, TraitAlias, TypeOrConstParam, Union, Variant,
|
||||
};
|
||||
|
||||
pub trait HasSource {
|
||||
|
@ -178,3 +178,11 @@ impl HasSource for LifetimeParam {
|
|||
Some(child_source.map(|it| it[self.id.local_id].clone()))
|
||||
}
|
||||
}
|
||||
|
||||
impl HasSource for LocalSource {
|
||||
type Ast = Either<ast::IdentPat, ast::SelfParam>;
|
||||
|
||||
fn source(self, _: &dyn HirDatabase) -> Option<InFile<Self::Ast>> {
|
||||
Some(self.source)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue