rust-lang / rust-lang/rust-analyzer

RA doesn't provide docs for exported item when importing `polars::lazy::prelude::*`

Open
#13,617 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-nameres C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer version: 0.3.1285-standalone (45ec315e0 2022-11-11)

rustc version: rustc 1.65.0 (897e37553 2022-11-02)

relevant settings: None that I can think of.

Description

RA does not find an item exported from polars-lazy's prelude. However, the code builds and runs fine so the item does exist in the prelude.

Code

Cargo.toml

[dependencies]
	polars = { version = "0.25.1", features = ["lazy"] }

main.rs

use polars::lazy::prelude::*;

fn main() {
	println!("{:?}", lit(1)); // <-- `lit` is the problematic item
}

Expected Results

Hovering over lit should show its documentation, as it's exported from polars::lazy::prelude.

Actual Results

It shows {unknown}.
image

Partial Workaround

Explicitly import the item from the prelude. Unfortunately this only provides hover information on the use statement itself, not uses of the item throughout the file.
image
image

Full Workaround

Import the item from somewhere other than the prelude.
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the Cargo.toml dependency and main.rs example, then inspect hover information for lit imported through polars::lazy::prelude::*. Compare it with the explicit-import workarounds shown in the report; done means hover on the use site displays lit's documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.