Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

RLS crashes #229

Closed
jrmuizel opened this issue May 10, 2017 · 48 comments
Closed

RLS crashes #229

jrmuizel opened this issue May 10, 2017 · 48 comments

Comments

@jrmuizel
Copy link

jrmuizel commented May 10, 2017

Version of VSCode: Version 1.12.1 (1.12.1)
Version of the extension: 0.3.14
OS: OS X

Description: RLS crashes. The status bar shows "RLS: Crashed"

Output of the "Rust logging" channel:

DEBUG: Configuration: Rustup: create: sysroot=/Users/jrmuizel/.rustup/toolchains/nightly-x86_64-apple-darwin
DEBUG: Configuration: Rustup: updateComponents: this.components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsInstalled=true
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsPath=/Users/jrmuizel/.cargo/bin/rls
DEBUG: runInRlsMode: rlsPath=/Users/jrmuizel/.cargo/bin/rls
DEBUG: runInRlsMode: env={"RUST_SRC_PATH":"/Users/jrmuizel/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src"}
DEBUG: runInRlsMode: args=[]
DEBUG: runInRlsMode: revealOutputChannelOn=3
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start

RLS channel

[Error - 10:00:08 PM] Connection to server got closed. Server will not be restarted.
@KalitaAlexey
Copy link
Member

KalitaAlexey commented May 10, 2017

@jrmuizel,
In the "settings.json" (File->Preferences->Settings), add:

    "rust.rls": {
        "env": {
            "RUST_LOG": "rls=debug"
        }
    }

And post the output of the RLS channel.

@dvdplm
Copy link

dvdplm commented May 10, 2017

@KalitaAlexey Seeing the same thing. Here's the debug output:

DEBUG: Configuration: Rustup: create: sysroot=/Users/dvd/.rustup/toolchains/nightly-x86_64-apple-darwin
DEBUG: Configuration: Rustup: updateComponents: this.components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsInstalled=true
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsPath=/Users/dvd/.cargo/bin/rls
DEBUG: runInRlsMode: rlsPath=/Users/dvd/.cargo/bin/rls
DEBUG: runInRlsMode: env={"RUST_SRC_PATH":"/Users/dvd/dev/rust/rustc-src/rustc-1.9.0/src"}
DEBUG: runInRlsMode: args=[]
DEBUG: runInRlsMode: revealOutputChannelOn=3
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start
DEBUG: Language Client Manager: stop
DEBUG: Language Client Manager: start

EDIT: I actually think this is what you're looking for:

DEBUG:rls::server: Language Server Starting up
DEBUG:rls::server: response: "Content-Length: 490\r\n\r\n{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":true,\"triggerCharacters\":[\".\",\":\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":true,\"documentHighlightProvider\":true,\"documentSymbolProvider\":true,\"workspaceSymbolProvider\":true,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}"
DEBUG:rls::server: response: "Content-Length: 72\r\n\r\n{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}"
DEBUG:rls::actions: build "/Users/dvd/dev/rust/learn-db"
DEBUG:rls::server: response: "Content-Length: 72\r\n\r\n{\"jsonrpc\":\"2.0\",\"method\":\"rustDocument/diagnosticsBegin\",\"params\":null}"
DEBUG:rls::actions: build "/Users/dvd/dev/rust/learn-db"
[Error - 3:32:42 PM] Connection to server got closed. Server will not be restarted.

Edit2: Here's the output of rustup component list:

cargo-x86_64-apple-darwin (default)
rls-x86_64-apple-darwin (installed)
rust-analysis-x86_64-apple-darwin (installed)
rust-docs-x86_64-apple-darwin (default)
rust-src (installed)
rust-std-aarch64-apple-ios
rust-std-aarch64-linux-android
rust-std-aarch64-unknown-fuchsia
rust-std-aarch64-unknown-linux-gnu
rust-std-arm-linux-androideabi
rust-std-arm-unknown-linux-gnueabi
rust-std-arm-unknown-linux-gnueabihf
rust-std-arm-unknown-linux-musleabi
rust-std-arm-unknown-linux-musleabihf
rust-std-armv7-apple-ios
rust-std-armv7-linux-androideabi
rust-std-armv7-unknown-linux-gnueabihf
rust-std-armv7-unknown-linux-musleabihf
rust-std-armv7s-apple-ios
rust-std-asmjs-unknown-emscripten
rust-std-i386-apple-ios
rust-std-i586-pc-windows-msvc
rust-std-i586-unknown-linux-gnu
rust-std-i686-apple-darwin
rust-std-i686-linux-android
rust-std-i686-pc-windows-gnu
rust-std-i686-pc-windows-msvc
rust-std-i686-unknown-freebsd
rust-std-i686-unknown-linux-gnu
rust-std-i686-unknown-linux-musl
rust-std-mips-unknown-linux-gnu
rust-std-mips-unknown-linux-musl
rust-std-mips64-unknown-linux-gnuabi64
rust-std-mips64el-unknown-linux-gnuabi64
rust-std-mipsel-unknown-linux-gnu
rust-std-mipsel-unknown-linux-musl
rust-std-powerpc-unknown-linux-gnu
rust-std-powerpc64-unknown-linux-gnu
rust-std-powerpc64le-unknown-linux-gnu
rust-std-s390x-unknown-linux-gnu
rust-std-sparc64-unknown-linux-gnu
rust-std-wasm32-unknown-emscripten
rust-std-x86_64-apple-darwin (default)
rust-std-x86_64-apple-ios
rust-std-x86_64-linux-android
rust-std-x86_64-pc-windows-gnu
rust-std-x86_64-pc-windows-msvc
rust-std-x86_64-rumprun-netbsd
rust-std-x86_64-unknown-freebsd
rust-std-x86_64-unknown-fuchsia
rust-std-x86_64-unknown-linux-gnu
rust-std-x86_64-unknown-linux-musl
rust-std-x86_64-unknown-netbsd
rustc-x86_64-apple-darwin (default)

@jrmuizel
Copy link
Author

That matches what I see.

@KalitaAlexey
Copy link
Member

Did it work before? A week ago?

@jrmuizel
Copy link
Author

I have had rls working previously, but that was a more manual setup using these steps from rls_vscode:

"Next, without installing the client as a regular VSCode extension, open the client folder in VSCode. Go to the debugger and run "Launch Extension". This opens a new instance of VSCode with the plugin installed."

@KalitaAlexey
Copy link
Member

@jrmuizel,
Could you try it again?
Try also rls_vscode.
If that works, then something is broken in the extension otherwise it can be RLS issue.

@jrmuizel
Copy link
Author

That no longer works. I'll try investigate the RLS issue.

@jrmuizel
Copy link
Author

I've filed rust-lang/rls#306

@durch
Copy link

durch commented May 12, 2017

Version of VSCode: 1.12.1
Version of the extension: 0.3.14
OS: macOS 10.12.4

Not sure if the same underlaying issues, RLS crashes almost immediately.

RLS console output

DEBUG:rls::server: Language Server Starting up
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorImpl { code: Message("missing field `experimental`"), line: 0, column: 0 }', src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: rls::server::parse_message
  10: rls::server::MessageReader::parsed_message
  11: rls::server::LsService::run
  12: rls::main
  13: __rust_maybe_catch_panic
  14: std::rt::lang_start
[Error - 5:35:12 PM] Connection to server got closed. Server will not be restarted.

Rust logging output

DEBUG: Configuration: Rustup: create: sysroot=/Users/durch/.rustup/toolchains/nightly-x86_64-apple-darwin
DEBUG: Configuration: Rustup: updateComponents: this.components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsInstalled=true
DEBUG: Configuration: Rustup: updatePathToRlsExecutable: rlsPath=/Users/durch/.cargo/bin/rls
DEBUG: runInRlsMode: rlsPath=/Users/durch/.cargo/bin/rustup
DEBUG: runInRlsMode: env={"RUST_LOG":"rls=debug","RUST_SRC_PATH":"/Users/durch/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src"}
DEBUG: runInRlsMode: args=["run","nightly","rls"]
DEBUG: runInRlsMode: revealOutputChannelOn=3
DEBUG: Language Client Manager: start

My rust settings

"rust.forceLegacyMode": false,
    "rust.actionOnSave": "check",
    "rust.rls": {
        "executable": "rustup",
        "args": [
            "run",
            "nightly",
            "rls"
        ],
        "env": {
            "RUST_LOG": "rls=debug",
            "RUST_BACKTRACE": 1
        }
    }

I am having no trouble running rls_vcode.

@KalitaAlexey
Copy link
Member

Does it crash when you don't set "rust.rls.env"?

@Enet4
Copy link

Enet4 commented May 12, 2017

There's a cross-issue in RLS already: rust-lang/rls#312

It might have to do with a new field in the ClientCapabilities message struct.

@durch
Copy link

durch commented May 12, 2017

@KalitaAlexey yes, crashes no matter the combo of the config

@Enet4
Copy link

Enet4 commented May 12, 2017

A further look into the RLS type definitions brought me to these changes in ClientCapabilties, which is no longer a generic JSON value, but instead an object with the fields "workspace", "textDocument" and "experimental". Making sure that we have these three might solve the problem. That, or probably relaxing the definition over at the RLS.

@Enet4
Copy link

Enet4 commented May 12, 2017

Just a tiny update, rust-lang/rls#313 should fix this issue without requiring changes to this extension. :)

@dvdplm
Copy link

dvdplm commented May 13, 2017

@Enet4 do you know if rustup update should work to pull in latest changes? I ran it but still seeing crashes. Here's the backtrace I see with RUST_BACKTRACE=1 in the env:

Does anyone know what the "missing field experimental" means?

DEBUG:rls::server: Language Server Starting up
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorImpl { code: Message("missing field `experimental`"), line: 0, column: 0 }', src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: rls::server::parse_message
  10: rls::server::MessageReader::parsed_message
  11: rls::server::LsService::run
  12: rls::main
  13: __rust_maybe_catch_panic
  14: std::rt::lang_start
[Error - 8:48:22 AM] Connection to server got closed. Server will not be restarted.

@Enet4
Copy link

Enet4 commented May 13, 2017

@dvdplm It was a consequence of the field "experimental" in one of the RLS type definitions being declared as mandatory, while it should have been optional in accordance to the language server protocol. The fix has already landed in the master branch, but apparently still not in Nightly. We'll probably have to wait and see.

@durch
Copy link

durch commented May 14, 2017

Still crashing with the latest nightly, hopefully they make us happy soon...

@Enet4
Copy link

Enet4 commented May 14, 2017

The PR was only merged this morning, so it sounds unlikely that the fix hit nightly already.

Those of you who want RLS to work right away can do so by building rls from the sources and directing vscode to the built executable in the extension's settings. You might also need to add the path to the Rust nightly dynamic libraries into your system's library path environment variable (LD_LIBRARY_PATH on Linux) if the program crashes about a missing dynamically linked file (.so, .dll, ...).

@Enet4
Copy link

Enet4 commented May 15, 2017

Just in case someone's still wondering, the fix to this crash is already available in rustc 1.19.0-nightly (386b0b9d3 2017-05-14). It should be safe to close this issue.

@Banashek
Copy link

So I was having the same "missing field experimental error". Updated to the latest nightly via rustup. Opened vscode and now have it maxing out all cores making it pretty much unusable:

image

@Enet4
Copy link

Enet4 commented May 15, 2017

It might be that you have opened a fairly large project (or at least with large dependencies). RLS isn't very efficient yet, and will eagerly perform a static analysis of the project and its dependencies right when a Rust source code file is opened.

If that extreme usage doesn't disappear after a while, it could be a bug.

@Banashek
Copy link

The project is 2 files with the following dependencies:

[dependencies]
rocket = "0.2.6"
rocket_codegen = "0.2.6"
diesel = { version = "0.11.0", features = ["postgres"] }
diesel_codegen = { version = "0.11.0", features = ["postgres"] }
dotenv = "0.8.0"

@Enet4
Copy link

Enet4 commented May 15, 2017

@Banashek I can reproduce that in my core i5 machine, it took around 2 minutes to complete. It might be diesel and its carpload of dependencies that take long to analyse. AFAIK, other than using the extension in legacy mode, there is no other way around that at the moment.

@Banashek
Copy link

Thanks. That's good to know.

@Banashek
Copy link

@Enet4
Followup question: what do you do in cases where there is a large crate in your project? Do you change vscode to legacy mode, use another editor, etc?

Both the neovim languageservice and vscode seem to be wrecking my cpu with just these few declared dependencies (I'm sure they each have a ton of their own).

@KalitaAlexey
Copy link
Member

@Banashek,
Could you compile it on stable/beta/on previous nightly?
It may be speed regression. If it is, then you should open an issue in https://github.com/rust-lang/rust

@KalitaAlexey
Copy link
Member

The new version will remove the problem. I'm about to publish it: #279.
If the problem still happens on the new version, open the issue again please.

@archer884
Copy link

Note to anyone who comes here because it blows up: I uninstalled and reinstalled the extension and that fixed things.

@peterschussheim
Copy link

@KalitaAlexey I am not able to use the extension. Please see the output attached. Thanks.

google chrome031

Rust Logging output:

DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"stable","host":"x86_64-apple-darwin","isDefault":false},{"channel":"nightly","host":"x86_64-apple-darwin","isDefault":true}]
DEBUG: Rustup: updateComponents(nightly-x86_64-apple-darwin): components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: activate: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: enter
DEBUG: RlsMode: start: User decided to use rustfmt
DEBUG: RlsMode: start: rlsPath=/Users/peter/.cargo/bin/rustup 
DEBUG: RlsMode: start: env={"RUST_SRC_PATH":"/Users/peter/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src"} 
DEBUG: Rustup: isRlsInstalled: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: args=["run","nightly","rls","run","nightly","rls"] 
DEBUG: RlsMode: start: revealOutputChannelOn=3 
DEBUG: RlsMode: start: Language Client Manager: start
DEBUG: RlsMode: start: Language Client Manager: stop
DEBUG: RlsMode: start: Language Client Manager: start
DEBUG: RlsMode: start: Language Client Manager: stop
DEBUG: RlsMode: start: Language Client Manager: start
DEBUG: RlsMode: start: Language Client Manager: stop
DEBUG: RlsMode: start: Language Client Manager: start

User Settings:

"rust.rls": {
    "executable": "rustup",
    "args": [
        "run",
        "nightly",
        "rls"
    ],
    "useRustfmt": true,
    "env": {
        "RUST_LOG": "rls=debug"
    }
},
"rust.rustup": {
    "toolchain": "nightly-x86_64-apple-darwin"
},
"rust.mode": "rls"
}

VS Code:

  • VSCode Version: Code - Insiders 1.14.0-insider (0b44bcd79af6783dff3fd9db4a9869c6de83c7bc, 2017-06-20T08:37:03.945Z)
  • OS Version: Darwin x64 16.6.0

@KalitaAlexey
Copy link
Member

Add "RUST_BACKTRACE" = 1 to "rust.rls.env" and attach what the output channel will give you.

@peterschussheim
Copy link

Can you confirm I added the backtrace correctly? Adding in VSCode settings as "RUST_BACKTRACE" = 1 is not valid.

"rust.rls": {
    "executable": "rustup",
    "args": [
        "run",
        "nightly",
        "rls"
    ],
    "useRustfmt": true,
    "env": {
        "RUST_LOG": "rls=debug",
        "RUST_BACKTRACE": 1
    }
},
"rust.rustup": {
    "toolchain": "nightly-x86_64-apple-darwin"
},
"rust.mode": "rls"
}

RLS output:

thread 'main' panicked at 'unknown action', src/tools/rls/src/cmd.rs:90
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread '<unnamed>' panicked at 'Error reading from channel: RecvError', src/libcore/result.rs:860
[Error - 4:20:43 PM] Connection to server got closed. Server will not be restarted.

@KalitaAlexey
Copy link
Member

I think you add it correct. Could you paste the output of "Rust Logging"?

@peterschussheim
Copy link

DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"stable","host":"x86_64-apple-darwin","isDefault":false},{"channel":"nightly","host":"x86_64-apple-darwin","isDefault":true}]
DEBUG: Rustup: updateComponents(nightly-x86_64-apple-darwin): components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: activate: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: enter
DEBUG: RlsMode: start: User decided to use rustfmt
DEBUG: RlsMode: start: rlsPath=/Users/peter/.cargo/bin/rustup 
DEBUG: RlsMode: start: env={"RUST_SRC_PATH":"/Users/peter/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src"} 
DEBUG: Rustup: isRlsInstalled: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: args=["run","nightly","rls","run","nightly","rls"] 
DEBUG: RlsMode: start: revealOutputChannelOn=3 
DEBUG: RlsMode: start: Language Client Manager: start
DEBUG: RlsMode: start: Language Client Manager: stop
DEBUG: RlsMode: start: Language Client Manager: start

@KalitaAlexey
Copy link
Member

@peterschussheim,
It seems I have a bug.

@peterschussheim
Copy link

OK, please let me know if you need more data from me.

@KalitaAlexey
Copy link
Member

Nope. I hate JavaScript.

@KalitaAlexey
Copy link
Member

KalitaAlexey commented Jun 20, 2017

That's my fault of course. I wrote Object.create instead of Object.assign.

@KalitaAlexey
Copy link
Member

As a workaround:
Open a terminal.

export RUST_BACKTRACE=1
code <your_project>

It should open VSCode.
Try again.
Post what output channels give you.

@peterschussheim
Copy link

RLS output:

thread 'main' panicked at 'unknown action', src/tools/rls/src/cmd.rs:90
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: rls::main
   6: __rust_maybe_catch_panic
   7: std::rt::lang_start
thread '<unnamed>' panicked at 'Error reading from channel: RecvError', src/libcore/result.rs:860
[Error - 4:39:03 PM] Connection to server got closed. Server will not be restarted.

Rust Logging output:

DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"stable","host":"x86_64-apple-darwin","isDefault":false},{"channel":"nightly","host":"x86_64-apple-darwin","isDefault":true}]
DEBUG: Rustup: updateComponents(nightly-x86_64-apple-darwin): components=["cargo-x86_64-apple-darwin (default)","rls-x86_64-apple-darwin (installed)","rust-analysis-x86_64-apple-darwin (installed)","rust-docs-x86_64-apple-darwin (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin (default)","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-apple-darwin (default)",""]
DEBUG: activate: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: enter
DEBUG: RlsMode: start: User decided to use rustfmt
DEBUG: RlsMode: start: rlsPath=/Users/peter/.cargo/bin/rustup 
DEBUG: RlsMode: start: env={"RUST_SRC_PATH":"/Users/peter/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src"} 
DEBUG: Rustup: isRlsInstalled: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: args=["run","nightly","rls","run","nightly","rls"] 
DEBUG: RlsMode: start: revealOutputChannelOn=3 
DEBUG: RlsMode: start: Language Client Manager: start

@KalitaAlexey
Copy link
Member

Still not enough.
Please set export RUST_BACKTRACE=full and try again.

@peterschussheim
Copy link

thread 'main' panicked at 'unknown action', src/tools/rls/src/cmd.rs:90
stack backtrace:
   0:        0x10db8b7d3 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h3d2cfb40e0cd5f46
   1:        0x10db97f13 - std::panicking::default_hook::{{closure}}::h024382d18a587449
   2:        0x10db97b41 - std::panicking::default_hook::hfc600a1caf69c2a0
   3:        0x10db9a087 - std::panicking::rust_panic_with_hook::h8fffb75b51f6cd41
   4:        0x10a9b4ba4 - std::panicking::begin_panic::hfeeaa5fd0dac7280
   5:        0x10aa65b68 - rls::main::h6c2adf9c41c91220
   6:        0x10db9d16a - __rust_maybe_catch_panic
   7:        0x10db9ab94 - std::rt::lang_start::h94b537509ec623ee
thread '<unnamed>' panicked at 'Error reading from channel: RecvError', src/libcore/result.rs:860
stack backtrace:
   0:        0x10db8b7d3 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h3d2cfb40e0cd5f46
   1:        0x10db97f13 - std::panicking::default_hook::{{closure}}::h024382d18a587449
[Error - 4:51:51 PM] Connection to server got closed. Server will not be restarted.

@KalitaAlexey
Copy link
Member

My bad. It showed src/tools/rls/src/cmd.rs:90 before.
I'll look at it now.

@KalitaAlexey
Copy link
Member

Okay now I see.
You have rust.rls.args set, but now it detects it itself.
You can remove rust.rls.executable, rust.rls.args.
Anyway I see I have a bug.

@KalitaAlexey
Copy link
Member

I'm a bad programmer)
Sorry about that.

@KalitaAlexey
Copy link
Member

I have opened two bugs: #284, #285.

@KalitaAlexey
Copy link
Member

Tomorrow I'll publish another version.

@peterschussheim
Copy link

Removing rust.rls.executable, rust.rls.args fixed the issue locally. Thanks for your help and work on maintaining this extension!

@KalitaAlexey
Copy link
Member

Thanks for finding problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants