Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Support navigation on primitives #19112

Open
davidbarsky opened this issue Feb 7, 2025 · 4 comments
Open

feature: Support navigation on primitives #19112

davidbarsky opened this issue Feb 7, 2025 · 4 comments
Labels
A-ide general IDE features C-enhancement Category: enhancement

Comments

@davidbarsky
Copy link
Contributor

davidbarsky commented Feb 7, 2025

We could maybe point the primitive types to their core re-exports https://doc.rust-lang.org/src/core/primitive.rs.html or rustdoc module shims https://doc.rust-lang.org/src/core/primitive_docs.rs.html

Originally posted by @Veykril in #19105 (comment)

@Wilfred
Copy link
Contributor

Wilfred commented Feb 7, 2025

FWIW we do see users sometimes doing go-to-def on primitive types, so taking them somewhere would be a nice experience for them. E.g. https://doc.rust-lang.org/src/core/primitive_docs.rs.html#1413 does seem nice for u64.

@Veykril
Copy link
Member

Veykril commented Feb 7, 2025

Fwiw we already have logic for hover to resolve primitives to those modules for doc rendering purposes

@Veykril Veykril added A-ide general IDE features C-enhancement Category: enhancement labels Feb 7, 2025
@ChayimFriedman2
Copy link
Contributor

FWIW I don't agree this is useful. Goto def should give me more information about the thing, but here there isn't really anything new (besides the docs, and we already show them on hover).

@Wilfred
Copy link
Contributor

Wilfred commented Feb 10, 2025

Users do generally expect that they can go-to-def on things that have hover information. There is some additional information they can learn from viewing the 'definition', e.g.:

#[rustc_doc_primitive = "i128"]
//
/// The 128-bit signed integer type.
#[stable(feature = "i128", since = "1.26.0")]
mod prim_i128 {}

I can see that it's a primitive, and when it was introduced to rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features C-enhancement Category: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants