mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Rename Source::ast -> Source::value
This commit is contained in:
parent
e975f6364c
commit
36e3fc9d54
43 changed files with 226 additions and 214 deletions
|
@ -101,11 +101,11 @@ fn hover_text_from_name_kind(
|
|||
return match name_kind {
|
||||
Macro(it) => {
|
||||
let src = it.source(db);
|
||||
hover_text(src.ast.doc_comment_text(), Some(macro_label(&src.ast)))
|
||||
hover_text(src.value.doc_comment_text(), Some(macro_label(&src.value)))
|
||||
}
|
||||
Field(it) => {
|
||||
let src = it.source(db);
|
||||
match src.ast {
|
||||
match src.value {
|
||||
hir::FieldSource::Named(it) => hover_text(it.doc_comment_text(), it.short_label()),
|
||||
_ => None,
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ fn hover_text_from_name_kind(
|
|||
hir::AssocItem::TypeAlias(it) => from_def_source(db, it),
|
||||
},
|
||||
Def(it) => match it {
|
||||
hir::ModuleDef::Module(it) => match it.definition_source(db).ast {
|
||||
hir::ModuleDef::Module(it) => match it.definition_source(db).value {
|
||||
hir::ModuleSource::Module(it) => {
|
||||
hover_text(it.doc_comment_text(), it.short_label())
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ fn hover_text_from_name_kind(
|
|||
A: ast::DocCommentsOwner + ast::NameOwner + ShortLabel,
|
||||
{
|
||||
let src = def.source(db);
|
||||
hover_text(src.ast.doc_comment_text(), src.ast.short_label())
|
||||
hover_text(src.value.doc_comment_text(), src.value.short_label())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
let mut res = HoverResult::new();
|
||||
|
||||
let mut range = match_ast! {
|
||||
match (token.ast.parent()) {
|
||||
match (token.value.parent()) {
|
||||
ast::NameRef(name_ref) => {
|
||||
let mut no_fallback = false;
|
||||
if let Some(name_kind) =
|
||||
|
@ -211,7 +211,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
};
|
||||
|
||||
if range.is_none() {
|
||||
let node = token.ast.ancestors().find(|n| {
|
||||
let node = token.value.ancestors().find(|n| {
|
||||
ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some()
|
||||
})?;
|
||||
let frange = FileRange { file_id: position.file_id, range: node.text_range() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue