Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

GoTo Definition for items in the standard library fails, probably looking in wrong place for source #256

Closed
PhilipDaniels opened this issue Feb 12, 2018 · 9 comments

Comments

@PhilipDaniels
Copy link

When I press F12 GoTo Definition on standard library functions I either get "No definition found for foo"

no_defn_for_retain

or a file not found error

file_not_found

It is not predictable as to which I get - you always get the same error for a particular function, but there is no way of predicting which one. Note the path is wrong in the gif, I actually have the source installed here:

C:\Users\Phil\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

Expectation: Should find the appropriate rust-src and take me there.

OS               : Windows 10
VS Code          : 1.19.3
rls plugin       : 0.3.2
cargo --version  : cargo 0.24.0 (45043115c 2017-12-05)
rustup --version : rustup 1.10.0 (c6a8f7c60 2018-01-25)
rustup show      : stable-x86_64-pc-windows-msvc (default)
rls --version    : prints "error: toolchain 'stable-x86_64-pc-windows-msvc' does not have the binary `rls.exe`"
    I do have another rls.exe at C:\Users\Phil\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\rls.exe
    I am not sure which one the plugin is using.

Everything was installed via rustup and cargo.

Possibly related issue: #185 But that is talking about it always failing. For me, GoTo Definition works OK for my own source and for source in crates I am using. It's just the std stuff that doesn't work.

@statpro-awebb
Copy link

After an recent rustup update to nightly, go-to-def now only works on my own source. It doesn't work for std, nor for crates I use.

@nrc nrc added the bug label Feb 13, 2018
@nrc
Copy link
Member

nrc commented Feb 13, 2018

Not jumping into std is a known issue, but not jumping to dep crates is a new bug

@nrc nrc added the P-High label Feb 13, 2018
@KaneGreen
Copy link

I am using stable-msvc, and my vscode tried to find src in file:///c:/Program Files/Microsoft VS Code/src/libstd/io/mod.rs.
Even though I've set env RUST_SRC_PATH=C:\Users\KaneGreen\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

@PhilipDaniels
Copy link
Author

Probably related issue in RLS: rust-lang/rls#227

@uudashr
Copy link

uudashr commented Jun 6, 2018

Any progress?

@uudashr
Copy link

uudashr commented Jun 7, 2018

FYI use this config

{
    "rust-client.channel": "nightly"
}

Then reload window, should works.
Somehow the stable channel are buggy, and not catching up with the fixes on the nightly.

@nrc nrc closed this as completed Jun 7, 2018
@dvic
Copy link
Contributor

dvic commented Aug 9, 2018

@nrc This seems to be broken again for me (even with nightly): #391

Given the fact I also have the problem with atom rust-lang/atom-ide-rust#96, it might be a regression in RLS?

Can anyone confirm whether or not the extension works for std and external crates? Thanks

@dvic
Copy link
Contributor

dvic commented Aug 9, 2018

By the way: it's not just GoTo Definition, also type information etc. is currently not working for me outside the current crate.

@nrc nrc reopened this Aug 24, 2018
@nrc
Copy link
Member

nrc commented Aug 24, 2018

Yeah, currently you can jump to def into an external crate, but once there you don't get any further help from the RLS (this is a client problem, but is a bit hard to fix and affects multiple clients).

@nrc nrc closed this as completed Aug 24, 2018
@rust-lang rust-lang deleted a comment from DanielJoyce Jan 8, 2019
Xanewok pushed a commit to Xanewok/rls-vscode that referenced this issue Mar 27, 2019
LsService::handle_message match replaced with macro
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants