Test for Builtin Type
This commit is contained in:
parent
b74b9797bc
commit
8317c8db1a
@ -473,7 +473,7 @@ fn get_doc_base_urls(
|
|||||||
// https://github.com/rust-lang/rust-analyzer/issues/12250
|
// https://github.com/rust-lang/rust-analyzer/issues/12250
|
||||||
if let Definition::BuiltinType(..) = def {
|
if let Definition::BuiltinType(..) = def {
|
||||||
let weblink = Url::parse("https://doc.rust-lang.org/nightly/core/").ok();
|
let weblink = Url::parse("https://doc.rust-lang.org/nightly/core/").ok();
|
||||||
return (weblink, local_doc_path);
|
return (weblink, None);
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some(krate) = def.krate(db) else { return Default::default() };
|
let Some(krate) = def.krate(db) else { return Default::default() };
|
||||||
|
@ -119,6 +119,19 @@ fn node_to_def(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn external_docs_doc_builtin_type() {
|
||||||
|
check_external_docs(
|
||||||
|
r#"
|
||||||
|
//- /main.rs crate:foo
|
||||||
|
let x: u3$02 = 0;
|
||||||
|
"#,
|
||||||
|
Some(&OsStr::new("/home/user/project")),
|
||||||
|
Some(expect![[r#"https://doc.rust-lang.org/nightly/core/primitive.u32.html"#]]),
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn external_docs_doc_url_crate() {
|
fn external_docs_doc_url_crate() {
|
||||||
check_external_docs(
|
check_external_docs(
|
||||||
|
Loading…
Reference in New Issue
Block a user