Skip to content

Go-to-definition not working for symbols defined outside of file #4402

Closed
@pwaller

Description

@pwaller

Hi! rust newbie here just trying things out. The first things I'm trying haven't worked and I thought you might like to know. Perhaps there is something obvious wrong with what I'm trying to do, but looking over the docs and issue tracker I can't figure it out quickly.

~/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version
rust-analyzer 6a48a94
  1. I've just installed rust-analyser 0.2.159 in vscode.
  2. I've done cargo new.
  3. In my main.rs I put the following code, which runs ok with cargo run:
use std::process::{Stdio};

fn main() -> std::io::Result<()> {
    std::process::Command::new("echo")
        .args(&["hello", "world"])
        .stdout(Stdio::inherit())
        .spawn()
        .unwrap();
    Ok(())
}

Go to definition does not work on any symbol, as far as I can tell. For example, Command, or new, Result, Ok, etc. Should I expect this to work?

Go-to-symbol works if I define and use a symbol within the file.

Completion doesn't seem to work for symbols outside the file, either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions