IntelliJ/Rust, not auto completion on priority-queue v1.2.3

Cargo.toml:

priority-queue = "1.2.3"

Anyone else getting no auto completion in IntelliJ for objects of type PriorityQueue<K, V> ?

In the same file/buffer, other objects are auto completing, but for some reason, PriorityQueue is not.

It doesn't look like I get that issue. I'm on CLion, but that shouldn't make a difference.

  1. Thank you for the new data point.

  2. I'm on IntelliJ Ultimate edition.

  3. This sounds silly -- I can't figure out how to screen shot on Linux (running Xmonad).

  4. I just ran a test of

use super::*;

#[test]

pub fn test_00() {
    let pq = priority_queue::PriorityQueue::new();
    pq.
}

I am getting completion options of:

dbr
dbgr
err
lambda
let
match
...
(the stuff IntelliJ suggest when it has no idea about the type of the variable)

I think I figured out why it's not working for you; it has to do with the crate having a build script. Enabling the org.rust.cargo.evaluate.build.scripts experimental feature should fix the problem:

  1. I appreciate the effort.

  2. I invested some time on screenshot setup, here is the my current setup. (This is after toggling the options in Experimental Features and restarting IntelliJ, twice).

These three should show that: (1) pq auto completion not working, (2) vec auto completion working, (3) right options set in IntelliJ Experimental Features (I restarted IntelliJ after setting this)



There might be some clues in the rust-analyzer log files if you haven't checked yet. Oh whoops you're on IntelliJ - I don't know how that's set up, but maybe it has some log files to look at.

Can you try doing File > Invalidate Caches? Maybe restarting isn't enough by itself. I was pretty sure the issue was the build scripts option, because when I turned it off and invalidated the caches, I reproduced the issue you were having.

Thanks. Very interesting data point.

Here are the steps I did:

mkdir asdf; cd asdf; cargo new --lib proj;
open proj in IntelliJ
IntelliJ -> File -> Invalidate Caches -> "invalidate caches & exit"
reopen IntelliJ

Not shown in above, but if I do a

let mut v = vec![];
v.

then it completes Vector methods

Consider reporting an issue to ijrust's repo with logs attached.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.