Vscode-rust: extension does not work with VSCode 1.18.0

Created on 10 Nov 2017  ·  25Comments  ·  Source: rust-lang/vscode-rust

updated VSCode to 1.18.0 and Rust (rls) to 0.3.2 and apart of syntax highlight, nothing seems to work:
go to definition
find references

etc.

tested on Win 10 64bits

bug

Most helpful comment

Hover, real-time errors and refactoring do not work anymore

All 25 comments

Same effect as in #186? So a spinning "RLS: working"? If yes this is maybe a duplicate.

Nope, RLS: done here

Having the same issue.

In the "Rust Language" output pane, it shows the following error:

thread '<unnamed>' panicked at 'need to specify SYSROOT or RUSTC env vars, or rustc must be in PATH', src\libcore\option.rs:839:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

which seems to indicate that it can't find "rustc", but it is definitely in my PATH.

There's a fix on master which should address this. Currently waiting for it to get processed through the Rust infra and hit rustup. Fingers crossed that fixes things here.

fixed in today's nightly build. let's hope it'll not happen again.

Is that supposed to fix VS Code Rust (rls) plugin?

Hover, real-time errors and refactoring do not work anymore

same here: hover, errors etc. not working anymore. Is the cause for this known? Anything one can do to help?

@paukul They started to work after:

  1. I ran rustup update and updated everything I could
  2. Switched rls to stable in vs code settings
  3. Added misssing dll's to PATH for my project

FYI: after enabling logging, I noticed the following errors piling up in the rls.logs:

thread 'rustc' panicked at 'Could not deserialize save-analysis config: MissingFieldError("reachable_only")', src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic

@Yanpas how did you switch to stable rls?

this error seems to be known: https://github.com/rust-lang/rust/issues/46244

@Yanpas cheers, switching it to stable for now fixed the issue and made it work again, thanks.
For everyone who's curious:

 "rust-client.channel": "stable"

in the (workspace) settings

It doesn't work for me - neither with stable, nor with nightly-2017-11-15-x86_64-unknown-linux-gnu. rls, however, works with the later. I get some output like:

{"message":"unused import: `c_int`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"sync/prog/gpgpu/stochastic_particles/compute_kernel/lib.rs","byte_start":53,"byte_end":58,"line_start":4,"line_end":4,"column_start":12,"column_end":17,"is_primary":true,"text":[{"text":"use libc::{c_int};","highlight_start":12,"highlight_end":17}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(unused_imports)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":null}
{"message":"unused import: `ndarray::prelude::*;`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"sync/prog/gpgpu/stochastic_particles/compute_kernel/lib.rs","byte_start":65,"byte_end":85,"line_start":5,"line_end":5,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"use ndarray::prelude::*;","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(unused_imports)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":null}
{"message":"missing field `positions` in initializer of `root::SimulationState`","code":{"code":"E0063","explanation":"\nThis error indicates that during an attempt to build a struct or struct-like\nenum variant, one of the fields was not provided. Erroneous code example:\n\n```compile_fail,E0063\nstruct Foo {\n    x: i32,\n    y: i32,\n}\n\nfn main() {\n    let x = Foo { x: 0 }; // error: missing field: `y`\n}\n```\n\nEach field should be specified exactly once. Example:\n\n```\nstruct Foo {\n    x: i32,\n    y: i32,\n}\n\nfn main() {\n    let x = Foo { x: 0, y: 0 }; // ok!\n}\n```\n"},"level":"error","spans":[{"file_name":"sync/prog/gpgpu/stochastic_particles/compute_kernel/lib.rs","byte_start":745,"byte_end":766,"line_start":36,"line_end":36,"column_start":21,"column_end":42,"is_primary":true,"text":[{"text":"    let mut state = root::SimulationState {","highlight_start":21,"highlight_end":42}],"label":"missing `positions`","suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
{"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"sync/prog/gpgpu/stochastic_particles/compute_kernel/lib.rs","byte_start":811,"byte_end":819,"line_start":39,"line_end":39,"column_start":23,"column_end":31,"is_primary":true,"text":[{"text":"        root::RunDemo(settings, state) == 0","highlight_start":23,"highlight_end":31}],"label":"expected *-ptr, found struct `root::SimulationSettingsBase`","suggested_replacement":null,"expansion":null}],"children":[{"message":"expected type `*const root::SimulationSettingsBase`\n   found type `root::SimulationSettingsBase`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":null}
{"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"sync/prog/gpgpu/stochastic_particles/compute_kernel/lib.rs","byte_start":821,"byte_end":826,"line_start":39,"line_end":39,"column_start":33,"column_end":38,"is_primary":true,"text":[{"text":"        root::RunDemo(settings, state) == 0","highlight_start":33,"highlight_end":38}],"label":"expected *-ptr, found struct `root::SimulationState`","suggested_replacement":null,"expansion":null}],"children":[{"message":"expected type `*mut root::SimulationState`\n   found type `root::SimulationState`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":null}
{"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":null}

There is no output in the debugger console. This is my config:

{
    "rust.workspace_mode": true,
    "rust-client.logToFile": true,
    "rust.unstable_features": true,
    "rust-client.channel": "nightly-2017-11-15-x86_64-unknown-linux-gnu"
}

EDIT:

No, I think I'm hit by bug #200 . For some other project, errors are reported and this very project contains a build.rs file.

I'm having this issue on the nightly compiler also, same error

thread 'rustc' panicked at 'Could not deserialize save-analysis config: MissingFieldError("reachable_only")', src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic

@leshow : That's a bug in nightly rls, not the extension. Try an earlier version, i.e. by setting "rust-client.channel": "nightly-2017-11-15-x86_64-unknown-linux-gnu"

works again in todays nightly

Doesn't work with

nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.26.0-nightly (c9334404f 2018-03-05)

Is this again a bug in rls?

Perhaps a bit off-topic but since rustup has implemented "update only if installed components are all available", is it better to have some tests to prevent buggy rls's from being published?

Okay, interestingly enough, everything seems to be working on stable and nightly now, since my last rustup update! Odd.

You are lucky, it's not working for me. nightly-x86_64-pc-windows-msvc unchanged - rustc 1.26.0-nightly (2789b067d 2018-03-06) or even stable

@Geobert @fuszenecker could you give some more details please?

is it better to have some tests to prevent buggy rls's from being published?

We do test every RLS we publish and publish working versions, furthermore we no longer publish nightly Rust without a working RLS. However, some problems aren't caught by our tests because they only occur on certain projects or platforms.

On cobalt.rs, with nightly-x86_64-pc-windows-msvc unchanged - rustc 1.26.0-nightly (2789b067d 2018-03-06). No find definition, nor find references. Completion seems to work though.

RLS works on a fresh simple project though

This project doesn't work neither (since end of Jan) https://github.com/Geobert/rusty_flexi

Right now the issue seems too vague - the extension has been working correctly for quite some time now. If you experience any problems, please make sure to file another issue with reproduction steps. Thanks!

Was this page helpful?
0 / 5 - 0 ratings