vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

No Autocomplete in Integration Tests for Items from the Library Target

Open zehuac2 opened this issue 7 years ago • 4 comments

I am running:

  • rls: 1.35.0 (49efc06 2019-04-06)
  • VSCode Rust (rls) 0.6.1
  • OS: macOS 10.14.5

In my integration tests, autocomplete does not seem to be able to provide completions for items from my library target. However, autocomplete works fine for items within the integration test.

Cargo.toml

[package]
name = "xxx"
version = "0.1.0"
authors = ["xxx"]
edition = "2018"

[lib]
name="mylib"
path="src/lib.rs"

src/lib.rs

pub struct Node {
    value: i32 
}

tests/test.rs

use mylib;

fn other() {
}
#[test]
fn test() {
    let node = mylib::Node{ value: 1 }; // No autocomplete for Node
    other(); // Autocomplete works fine for other
}

Although this compiles just fine.

Put extern crate mylib at the top of the test.rs fixes the issue and still compiles just fine, but the tutorial doesn't use them. It just uses use mylib;

Edit:

I rustup to 1.36, still having the same problem.

zehuac2 avatar Jul 03 '19 05:07 zehuac2

I'm experiencing the same thing.

My setup:

  • VS Code: 1.37.1
  • Language server on VS Code: 0.6.1
  • macOS 10.14.4

focorner avatar Aug 24 '19 15:08 focorner

ditto, was going to raise and issue It does work with CLion and the intelli-j rust plugin.

Is this an RLS issue or a vscode issue?

CLion + rust has a whole bunch of other issues...

ta32 avatar Aug 29 '19 07:08 ta32

I have this as well. Experienced on Ubuntu 19.10/VSCode and Windows with same configuration.

eoarch avatar Feb 15 '20 15:02 eoarch

rust-analyzer fixes this issue!

zehuac2 avatar Jul 30 '20 04:07 zehuac2