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: goto.rs
    path of file: ./repos/slint/tools/lsp/language
    
    the code of the file until where you have to start completion: // Copyright Â© SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial

use super::DocumentCache;
use crate::util::{lookup_current_element_type, map_node_and_url, with_lookup_ctx};

use i_slint_compiler::diagnostics::Spanned;
use i_slint_compiler::expression_tree::Expression;
use i_slint_compiler::langtype::{ElementType, Type};
use i_slint_compiler::lookup::{LookupObject, LookupResult};
use i_slint_compiler::parser::{syntax_nodes, SyntaxKind, SyntaxNode, SyntaxToken};
use i_slint_compiler::pathutils::clean_path;

use lsp_types::{GotoDefinitionResponse, LocationLink, Range};
use std::path::Path;

pub fn goto_definition(
    document_cache: &mut DocumentCache,
    token: SyntaxToken,
) -> Option<GotoDefinitionResponse> {
    let mut node = token.parent();
    loop {
        if let Some(n) = syntax_nodes::QualifiedName::new(node.clone()) {
            let parent = n.parent()
    
fn test_goto_definition() {
    fn first_link(def: &GotoDefinitionResponse) -> &LocationLink {
        let GotoDefinitionResponse::Link(link) = def else { panic!("not a single link {def:?}") };
        link.first().unwrap()
    }

    let source = r#"
import { Button } from "std-widgets.slint";
component Abc {
    in property <string> hello;
}
export component Test {
    abc := Abc {
        hello: "foo";
    }
    btn := Button {
        text: abc.hello;
    }
    rec := Rectangle { }
}"#;

    let (mut dc, uri, _) = crate::language::test::loaded_document_cache(source.into());
    let doc = dc
        .documents
        .get_document(&crate::language::uri_to_file(&uri).unwrap())
        .unwrap()
        .node
        .clone()
        .unwrap();

    // Jump to the definition of Abc
    let offset = source.find("abc := Abc").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset + 8).unwrap();
    assert_eq!(token.text(), "Abc");
    let def = goto_definition(&mut dc, token).unwrap();
    let link = first_link(&def);
    assert_eq!(link.target_uri, uri);
    assert_eq!(link.target_range.start.line, 2);

    // Jump to the definition of abc
    let offset = source.find("text: abc.hello").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset + 7).unwrap();
    assert_eq!(token.text(), "abc");
    let def = goto_definition(&mut dc, token).unwrap();
    let link = first_link(&def);
    assert_eq!(link.target_uri, uri);
    assert_eq!(link.target_range.start.line, 6);

    // Jump to the definition of hello
    let offset = source.find("text: abc.hello").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset + 12).unwrap();
    assert_eq!(token.text(), "hello");
    let def = goto_definition(&mut dc, token).unwrap();
    let link = first_link(&def);
    assert_eq!(link.target_uri, uri);
    assert_eq!(link.target_range.start.line, 3);

    // Also jump to the definition of hello
    let offset = source.find("hello: \"foo\"").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset).unwrap();
    assert_eq!(token.text(), "hello");
    let def = goto_definition(&mut dc, token).unwrap();
    let link = first_link(&def);
    assert_eq!(link.target_uri, uri);
    assert_eq!(link.target_range.start.line, 3);

    // Rectangle is builtin and not accessible
    let offset = source.find("rec := ").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset + 8).unwrap();
    assert_eq!(token.text(), "Rectangle");
    assert!(goto_definition(&mut dc, token).is_none());

    // Button is builtin and not accessible
    let offset = source.find("btn := ").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset + 9).unwrap();
    assert_eq!(token.text(), "Button");
    assert!(goto_definition(&mut dc, token).is_none());
    let offset = source.find("text: abc.hello").unwrap() as u32;
    let token = crate::language::token_at_offset(&doc, offset).unwrap();
    assert_eq!(token.text(), "text");
    assert!(goto_definition(&mut dc, token).is_none());
}