Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goto definition outside crate #391

Open
dvic opened this Issue Aug 2, 2018 · 14 comments

Comments

Projects
None yet
6 participants
@dvic
Copy link
Contributor

dvic commented Aug 2, 2018

Is the goto definition feature supposed to work also outside the current crate? E.g., when you click on a method from an external crate, you cannot use goto definition from there. However, if I open that external crate folder and make RLS index it (by opening a .rs file), then it works. Is this the way it's supposed to work or is there something wrong with my configuration? Thanks!

@kavu

This comment has been minimized.

Copy link

kavu commented Aug 6, 2018

@dvic can you try "rust-client.channel": "nightly" in your VS Code settings? It worked for me — now I can go to definitions of std library members, along with external crates. Obviously, I am on nightly version of Rust.

@dvic

This comment has been minimized.

Copy link
Contributor Author

dvic commented Aug 7, 2018

@kavu thanks for the tip, but it did not work for me. I'm also using nightly. Are you on MacOS?

@kavu

This comment has been minimized.

Copy link

kavu commented Aug 7, 2018

@dvic yeah. Just checked it on my office Mac. Still works, but I had to reopen my VS Code project to force RLS to rebuild / update the project info. After that I could hover over functions from external crates and even Cmd-click them to jump to their source. Maybe you were asking about something else and I misunderstood you?..

@dvic

This comment has been minimized.

Copy link
Contributor Author

dvic commented Aug 7, 2018

@kavu No no it's exactly what you are describing that I'm trying to achieve. I tried restarting visual code, restarting RLS, still doesn't work. So I guess there is something wrong with my environment/setup? Do you know how I can debug the visual code extension (e.g., enable logging?)

@dvic

This comment has been minimized.

Copy link
Contributor Author

dvic commented Aug 7, 2018

Found it here: https://github.com/rust-lang-nursery/rls/blob/master/debugging.md#logging

I don't see anything in the logs that could explain the behavior. It simple stops after I cmd click and jump to a source file outside my crate.

@dvic

This comment has been minimized.

Copy link
Contributor Author

dvic commented Aug 14, 2018

Update from rust-lang/atom-ide-rust#96: it seems that the Atom plugin filters project files before sending them out to the RLS. Does Visual Code also do this? That could explain the issue.

@JeanMertz

This comment has been minimized.

Copy link

JeanMertz commented Aug 16, 2018

I have the exact same issue. I tried using cargo-vendor to have my dependencies be in the same directory as the project, and after restarting vscode the first "click through" indeed goes inside the vendor directory, but even then when I click on the next object, it complaints "no definition found", even though I can see the file that has the definition right there in the side bar, inside my project, next to the file I'm currently in.

I also tried "rust-client.channel": "nightly", but that too doesn't work.

I'm trying this on macOS 10.13.6, vscode 1.27.0-insiders, vscode-rls 0.4.9 rustc 1.30.0-nightly (d767ee116 2018-08-15) rls-preview 0.130.5-nightly (9e4d8d5 2018-08-10)

@JeanMertz

This comment has been minimized.

Copy link

JeanMertz commented Aug 16, 2018

By the way, setting "rust.goto_def_racer_fallback": true as described here makes this work for most of the cases, but not all of them, and obviously without using RLS.

@kbarros

This comment has been minimized.

Copy link

kbarros commented Oct 2, 2018

Ran into this issue as well. Bummer.

@kbarros

This comment has been minimized.

Copy link

kbarros commented Oct 2, 2018

Same as this issue?

@DanielJoyce

This comment has been minimized.

Copy link

DanielJoyce commented Oct 9, 2018

If RLS is still this broken, maybe they should just go back and use racer then. Ugh.

@DanielJoyce

This comment has been minimized.

Copy link

DanielJoyce commented Jan 3, 2019

Still not working for me. Can not go to definitions for external projects...

@dvic

This comment has been minimized.

Copy link
Contributor Author

dvic commented Jan 3, 2019

Same here, still not working.. It still only works when you add the crate folder to the workspace.

@prasannavl

This comment has been minimized.

Copy link

prasannavl commented Apr 4, 2019

Same here. I think it has to do with the rls itself rather than vscode plugin. Had stayed on some Nov/Dec 2018 nightly where everything from the https://rust-lang.github.io/rustup-components-history/ actually built, for a long time now. Go-to-def worked great across crates and stdlib.

Just upgraded to to another March variant last week that built most of the components I need and it no longer works outside of the crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.