mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
HasSource::source -> HasSource::source_old
To start migrating HasSource::source to return an Option.
This commit is contained in:
parent
aa3ce16f26
commit
27cadcd531
15 changed files with 55 additions and 55 deletions
|
@ -285,7 +285,7 @@ where
|
|||
D::Ast: ast::NameOwner + ShortLabel,
|
||||
{
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
let mut res = NavigationTarget::from_named(
|
||||
db,
|
||||
src.as_ref().map(|it| it as &dyn ast::NameOwner),
|
||||
|
@ -314,7 +314,7 @@ impl ToNav for hir::Module {
|
|||
|
||||
impl ToNav for hir::Impl {
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
let derive_attr = self.is_builtin_derive(db);
|
||||
let frange = if let Some(item) = &derive_attr {
|
||||
item.syntax().original_file_range(db)
|
||||
|
@ -339,7 +339,7 @@ impl ToNav for hir::Impl {
|
|||
|
||||
impl ToNav for hir::Field {
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
|
||||
match &src.value {
|
||||
FieldSource::Named(it) => {
|
||||
|
@ -365,7 +365,7 @@ impl ToNav for hir::Field {
|
|||
|
||||
impl ToNav for hir::MacroDef {
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
log::debug!("nav target {:#?}", src.value.syntax());
|
||||
let mut res = NavigationTarget::from_named(
|
||||
db,
|
||||
|
@ -448,7 +448,7 @@ impl ToNav for hir::Label {
|
|||
|
||||
impl ToNav for hir::TypeParam {
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
let full_range = match &src.value {
|
||||
Either::Left(it) => it.syntax().text_range(),
|
||||
Either::Right(it) => it.syntax().text_range(),
|
||||
|
@ -472,7 +472,7 @@ impl ToNav for hir::TypeParam {
|
|||
|
||||
impl ToNav for hir::LifetimeParam {
|
||||
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
|
||||
let src = self.source(db);
|
||||
let src = self.source_old(db);
|
||||
let full_range = src.value.syntax().text_range();
|
||||
NavigationTarget {
|
||||
file_id: src.file_id.original_file(db),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue