/// Allows `NavigationTarget` to be created from a `NameOwner`
Allows `NavigationTarget` to be created from a `NameOwner`
Allows ` NavigationTarget ` to be created from a ` NameOwner `
pub(crate) fn from_named(
        db: &RootDatabase,
        node: InFile<&dyn ast::NameOwner>,
        kind: SymbolKind,
    ) -> NavigationTarget {
        let name =
            node.value.name().map(|it| it.text().clone()).unwrap_or_else(|| SmolStr::new("_"));
        let focus_range =
            node.value.name().map(|it| node.with_value(it.syntax()).original_file_range(db).range);
        let frange = node.map(|it| it.syntax()).original_file_range(db);
        NavigationTarget::from_syntax(frange.file_id, name, focus_range, frange.range, kind)
    }
pub ( crate ) fn from_named ( db : & RootDatabase , node : InFile < & dyn ast :: NameOwner > , kind : SymbolKind , ) -> NavigationTarget { let name = node . value . name ( ) . map ( | it | it . text ( ) . clone ( ) ) . unwrap_or_else ( | | SmolStr :: new ( " " ) ) ; let focus_range = node . value . name ( ) . map ( | it | node . with_value ( it . syntax ( ) ) . original_file_range ( db ) . range ) ; let frange = node . map ( | it | it . syntax ( ) ) . original_file_range ( db ) ; NavigationTarget :: from_syntax ( frange . file_id , name , focus_range , frange . range , kind ) }
Allows `NavigationTarget` to be created from a `NameOwner`
Allows ` NavigationTarget ` to be created from a ` NameOwner `
db
&RootDatabase
node
InFile<&dyn ast::NameOwner>
kind
SymbolKind