You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: navigation_target.rs
    path of file: ./repos/rust-analyzer/crates/ide/src
    
    the code of the file until where you have to start completion: //! See [`NavigationTarget`].

use std::fmt;

use arrayvec::ArrayVec;
use either::Either;
use hir::{
    db::ExpandDatabase, symbols::FileSymbol, AssocItem, FieldSource, HasContainer, HasSource,
    HirDisplay, HirFileId, InFile, LocalSource, ModuleSource,
};
use ide_db::{
    base_db::{FileId, FileRange},
    defs::Definition,
    documentation::{Documentation, HasDocs},
    RootDatabase, SymbolKind,
};
use stdx::never;
use syntax::{
    ast::{self, HasName},
    format_smolstr, AstNode, SmolStr, SyntaxNode, TextRange,
};

/// `NavigationTarget` represents an element in the editor's UI which you can
/// click on to navigate to a particular piece of code.
///
/// Typically, a `NavigationTarget` corresponds to some element in the source
/// code, like a function or a struct, but this is not strictly required.
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct NavigationTarget {
    pub file_id: FileId,
    /// Range which encompasses the whole element.
    ///
    /// Should include body, doc comments, attributes, etc.
    ///
    /// Clients should use this range to answer "is the cursor inside the
    /// element?" question.
    pub full_range: TextRange,
    /// A "most interesting" range within the `full_range`.
    ///
    /// Typically, `full_range` is the whole syntax node, including doc
    /// comments, and `focus_range` is the range
    
    fn try_to_nav(&self, db: &RootDatabase) -> Option<UpmappingResult<NavigationTarget>> {
        Some(
            orig_range_with_focus_r(
                db,
                self.loc.hir_file_id,
                self.loc.ptr.text_range(),
                Some(self.loc.name_ptr.text_range()),
            )
            .map(|(FileRange { file_id, range: full_range }, focus_range)| {
                NavigationTarget {
                    file_id,
                    name: self
                        .is_alias
                        .then(|| self.def.name(db))
                        .flatten()
                        .map_or_else(|| self.name.clone(), |it| it.to_smol_str()),
                    alias: self.is_alias.then(|| self.name.clone()),
                    kind: Some(hir::ModuleDefId::from(self.def).into()),
                    full_range,
                    focus_range,
                    container_name: self.container_name.clone(),
                    description: match self.def {
                        hir::ModuleDef::Module(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Function(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Adt(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Variant(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Const(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Static(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Trait(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::TraitAlias(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::TypeAlias(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::Macro(it) => Some(it.display(db).to_string()),
                        hir::ModuleDef::BuiltinType(_) => None,
                    },
                    docs: None,
                }
            }),
        )
    }