rust-lang / vscode-rust Goto Github PK
View Code? Open in Web Editor NEWRust extension for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
License: Other
Rust extension for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
License: Other
I have seen closed ticket for this, but it works ones and fails. Am I doing something wrong?
versions
$ cargo --version
cargo 0.21.0-nightly (534ce6862 2017-06-21)
$ rustup --version
rustup 1.5.0 (92d0d1e9e 2017-06-24)
$ rustc --version
rustc 1.20.0-nightly (859c3236e 2017-06-26)
settings.json
"rust.rustup": {
"toolchain": "stable-x86_64-pc-windows-msvc",
"nightlyToolchain": "nightly-x86_64-pc-windows-msvc"
},
"rust.mode": "rls",
"rust.rls": {
"useRustfmt": true
}
Rust Log
DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"stable","host":"x86_64-pc-windows-msvc","isDefault":false},{"channel":"nightly","host":"x86_64-pc-windows-msvc","isDefault":true}]
DEBUG: activate: processPossibleSetButMissingUserToolchain: toolchainKind=toolchain
DEBUG: activate: processPossibleSetButMissingUserToolchain: user toolchain is installed
DEBUG: Rustup: updateComponents(stable-x86_64-pc-windows-msvc): components=["cargo-x86_64-pc-windows-msvc (default)","rust-analysis-x86_64-pc-windows-msvc","rust-docs-x86_64-pc-windows-msvc (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","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 (default)","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-pc-windows-msvc (default)",""]
DEBUG: RlsMode: start: enter
DEBUG: RlsMode: start: no RLS executable
DEBUG: RlsMode: start: processPossibleSetButMissingUserToolchain: toolchainKind=nightly toolchain
DEBUG: RlsMode: start: processPossibleSetButMissingUserToolchain: user nightly toolchain is installed
DEBUG: Rustup: updateComponents(nightly-x86_64-pc-windows-msvc): components=["cargo-x86_64-pc-windows-msvc (default)","rls-x86_64-pc-windows-msvc (installed)","rust-analysis-x86_64-pc-windows-msvc (installed)","rust-docs-x86_64-pc-windows-msvc (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","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 (default)","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-pc-windows-msvc (default)",""]
DEBUG: RlsMode: processPossiblyMissingRlsComponents: RLS is installed
DEBUG: RlsMode: processPossiblyMissingRlsComponents: rust-analysis is installed
DEBUG: RlsMode: start: User decided to use rustfmt
DEBUG: RlsMode: start: rlsPath=rustup
DEBUG: RlsMode: start: env={"RUST_SRC_PATH":"C:\\Users\\yaros\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust\\src"}
DEBUG: RlsMode: start: args=["run","nightly-x86_64-pc-windows-msvc","rls"]
DEBUG: RlsMode: start: revealOutputChannelOn=3
DEBUG: RlsMode: start: Language Client Manager: start
RLS Log
{"message":"cannot find value 'COMMAND_' in module 'cpu_commands'","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n'''compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name 'something_that_doesnt_exist::foo'\n\n// or:\n\ntrait Foo {\n fn bar() {\n Self; // error: unresolved name 'Self'\n }\n}\n\n// or:\n\nlet x = unknown_variable; // error: unresolved name 'unknown_variable'\n'''\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n'''\nenum something_that_does_exist {\n Foo,\n}\n'''\n\nOr:\n\n'''\nmod something_that_does_exist {\n pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n'''\n\nOr:\n\n'''\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n'''\n\nIf the item is not defined in the current module, it must be imported using a\n'use' statement, like so:\n\n'''\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n'''\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., 'pub fn').\n"},"level":"error","spans":[{"file_name":"src\\main.rs","byte_start":78,"byte_end":86,"line_start":4,"line_end":4,"column_start":48,"column_end":56,"is_primary":true,"text":[{"text":" println!(\"Hello, world! {}\", cpu_commands::COMMAND_);","highlight_start":48,"highlight_end":56}],"label":"not found in 'cpu_commands'","suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
Missing change, aborting. Found 2, expected Some(11)
[Error - 3:37:24 PM] Connection to server got closed. Server will not be restarted.
We need to support LSP 3.0 by rust-lang/rls#300
[Error - 9:55:04 PM] Request textDocument/formatting failed.
Message: Reformat failed to complete successfully
Code: -32601
error: file not found for module `serial_support`
--> stdin:12:6
|
12 | mod serial_support;
| ^^^^^^^^^^^^^^
|
= help: name the file either serial_support.rs or serial_support/mod.rs inside the directory ""
Tried updating rls nightly, still not working.
This is happening in main.rs, it can't seem to resolve local mods, though the files compile just fine with stable cargo build
rls.toml
unstable_features = true
settings.json
{
"workbench.colorTheme": "Blackboard",
"editor.formatOnSave": true,
"window.zoomLevel": -1,
"editor.fontSize": 18,
"editor.fontFamily": "Fira Code",
"rust.rls": {
"executable": "rustup",
"args": [
"run",
"nightly",
"rls"
]
}
}
Even with HIDE_WINDOW_OUTPUT = false
When necessary. I guess we'd have to restart the RLS afterwards?
In the following code RLS can't seem to figure out the type of 'count'. It figures out line just fine.
use std::fs::File;
use std::io::BufReader;
use std::io::BufRead;
use std::collections::BTreeMap;
use std::collections::btree_map::Entry::*;
use std::env;
fn main() {
let arg = env::args().nth(1).unwrap();
let f = File::open(arg).unwrap();
let mut uniq = BTreeMap::new();
for l in BufReader::new(&f).lines() {
let l = l.unwrap();
match uniq.entry(l) {
Vacant(v) => { v.insert(1); }
Occupied(mut o) => { let r = o.get_mut(); *r = *r + 1; }
}
}
for (line, count) in uniq.iter() {
println!("{} {}", line, count);
}
}
First, thanks for an amazing thing! The initial impression is really great: even I know is this is way pre-alpha and all of that, it's still an awesome feeling to launch this. It gives you something like the TypeScript editing experience in VSCode, which is really really nice. So, thanks a lot for what has already been done.
Having that said: have we considered publishing this as a "real" vscode extension, i.e. something you can just download and run? The current setup experience is "a bit" 😉 rough on the edges, of course I understand like everyone else why this is the case (we've mostly focused on getting the dev environment up thus far), but do you @jonathandturner see any immediate obstacles to publishing this to the VSCode Marketplace? Do you think it would be premature to do that at this stage? We can give an extremely low version number like 0.0.1 to make sure people understand what to expect...
(We will still depend on the rls
binary being available, downloaded and compiled by the user, but we can't really do much about that yet, and that's pretty much fine.)
The http client is legacy. Might as well remove it and move the lsp client into the root.
E.g., --lib
if rust.build_lib
is true
Putting the cursor in a word does, but actually selecting the word does not
When trying to run 'npm install', in Windows I get:
C:\Source\rls_vscode>npm install
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! code ETARGET
npm ERR! notarget No matching version found for vscode@^1.8.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'rls-vscode'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\proba\AppData\Roaming\npm-cache\_logs\
When I try to run vsce package
I get:
C:\Source\rls_vscode>vsce package
Error: Invalid publisher name 'The RLS developers'. Expected the identifier of a publisher, not its human-friendly name.
Version of VSCode: 0.1.13-insider
OS: macOS
Description:
If I'm hacking away on a big project, it won't always build successfully. That seems to cause incessant runaway build processes.
Expected:
Actual:
RLS analysis: working
), causing up to 8 rustc
processes to peg a CPU each.This is sufficient to make me disable the extension.
Output of the "Rust logging" channel:
DEBUG: Configuration: Rustup: create: sysroot=/Users/rnewman/.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/rnewman/.cargo/bin/rls
DEBUG: Configuration: updatePathToRacer: findRacerPathSpecifiedByUser: path=undefined
DEBUG: Configuration: updatePathToRacer: findDefaultRacerPath: foundPath=/Users/rnewman/.cargo/bin/racer
DEBUG: Legacy Mode Manager: MissingToolsInstallator: getMissingTools(): pathDirectories=["/Users/rnewman/.cargo/bin","/usr/local/bin/ccache","/Users/rnewman/.cabal/bin/","/usr/local/share/python","/Users/rnewman/bin","/Users/rnewman/bin/hosts","/Users/rnewman/bin/wireshark/","/Library/Ruby/Gems/1.8/gems/jello-5/bin","/Users/rnewman/repos/arcanist/bin/","/usr/local/bin","/usr/local/sbin","/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/X11/bin","/Library/TeX/texbin"]
DEBUG: Legacy Mode Manager: MissingToolsInstallator: getMissingTools(): tools={"racer":"/Users/rnewman/.cargo/bin/racer","rustfmt":"rustfmt","rustsym":"rustsym"}
DEBUG: Legacy Mode Manager: MissingToolsInstallator: getMissingTools(): racer's path=/Users/rnewman/.cargo/bin/racer
DEBUG: Legacy Mode Manager: MissingToolsInstallator: getMissingTools(): this.missingTools = []
DEBUG: Legacy Mode Manager: CompletionManager: start: enter
DEBUG: Legacy Mode Manager: CompletionManager: start: racerPath=/Users/rnewman/.cargo/bin/racer
DEBUG: Legacy Mode Manager: CompletionManager: start: ENV[RUST_SRC_PATH] = /Users/rnewman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src
Integration between LLDB and VSCode exists (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb / https://github.com/vadimcn/vscode-lldb) and by the sounds of it, has been tested and works with Rust code (and the author is a Rust contributor).
Alternatively, https://marketplace.visualstudio.com/items?itemName=webfreak.debug / https://github.com/WebFreak001/code-debug supports both GDB and LLDB (GDB has or will have better Rust support due to some integration into the debugger itself).
It seems, therefore like it should be relatively simple to package (or script) one of those plugins with the Rust/lldb/gdb script and our plugin and offer a decent debugging experience out of the box and without too much effort.
I've gotten the extension working when I start VSCode in the rls_vscode
directory, but can't get it working as a default extension.
That is, when I start the extension I get an error: Couldn't start client Rust Language Server
.
My link situation:
aozdemir@principia ~/.vscode/extensions $ ls -l
total 20K
drwxr-xr-x 4 aozdemir aozdemir 4.0K Apr 4 00:01 AndrsDC.base16-themes-1.1.2/
drwxr-xr-x 7 aozdemir aozdemir 4.0K Apr 3 23:52 ms-vscode.cpptools-0.10.5/
lrwxrwxrwx 1 aozdemir aozdemir 30 Apr 12 09:27 rls_vscode -> /home/aozdemir/code/rls_vscode/
drwxr-xr-x 5 aozdemir aozdemir 4.0K Apr 12 13:51 vscodevim.vim-0.6.15/
But I can start the extension via debug mode just fine, and it works:
aozdemir@principia ~/.vscode/extensions $ cd /home/aozdemir/code/rls_vscode
aozdemir@principia ~/code/rls_vscode $ code .
This latter approach does generate a warning though: [/home/aozdemir/code/rls_vscode]: Overwriting extension /home/aozdemir/.vscode/extensions/rls_vscode with /home/aozdemir/code/rls_vscode.
Any idea what I'm doing wrong?
When you open VSCode, we should start off a build so we have index and error info. This only happens sometimes, and even when it does, error highlighting does not work (we get the error list, but not highlights in the code).
hover on a std lib type to see a link to rustdoc. It should be clickable to open the page, but isn't.
e.g. searching for references of overscroll_amount() in clip_scroll_node.rs of webrender/webrender gives results that include "if overscrolling {" and "else if overscrolling &&"
I followed the instructions at https://github.com/rust-lang-nursery/rls to set up VS code and RLS. I wanted to use it to navigate the servo/webrender
repository. This repository contains a workspace Cargo.toml at the root and then a bunch of crates inside. If I open the root folder (with the workspace Cargo.toml) in VS Code, it seems to not do all the proper analysis, and doesn't find some things (a specific example is finding all references to the scroll function in webrender/src/clip_scroll_node.rs). However if I open the webrender crate folder, it works fine. It would be great if it worked with the workspace and could do analysis across both webrender and webrender_traits.
Not being familiar with npm, I've struggled to get this to build. I'm on debian testing. I've tried:
rm -rf /usr/local/lib/node_modules/
hash -r
npm install npm -g
source ~/.bashrc
npm install -g typescript
npm install -g vsce
npm dedupe
npm install
vsce package
Which says that there is a problem running "tsc -p ./"; running that manually gives me a bunch of errors:
node_modules/@types/mocha/index.d.ts(65,15): error TS2300: Duplicate identifier 'Mocha'.
node_modules/@types/mocha/index.d.ts(113,19): error TS2300: Duplicate identifier 'Mocha'.
node_modules/@types/mocha/index.d.ts(233,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/node/index.d.ts(102,6): error TS2300: Duplicate identifier 'BufferEncoding'.
node_modules/@types/node/index.d.ts(263,18): error TS2300: Duplicate identifier 'EventEmitter'.
node_modules/@types/node/index.d.ts(348,10): error TS2300: Duplicate identifier 'Platform'.
Previously with rustycode I used to automatic suggestions in such cases:
module::[here comes popup with siggestions]
Now I need to press ctrl+space to get suggestions after ::
.
I'm wondering if it's possible to configure such behaviour with rls plugin?
It is irritating to have the squiggles everywhere when you are working on something and there is a known bug. Would be nice to be able to temporarily turn them off. I assume this should be done in the plugin, but we could always do this at the RLS level too.
I tried to follow the setup instructions. I also set rustup override set nightly
on both the rls
directory and my Rust project directory.
vcscode 1.8.1, and all RLS checkouts from just a few minutes ago.
(One oddity about my system: The language is set to French, and vscode gives me some kind of cut off warning messages which might be related to missing messages. I tried re-running it English mode, but it the debugged copy of vscode doesn't honor environment variables set in the shell which launched the host vscode.)
/usr/share/code/code --debugBrkPluginHost=6242 --extensionDevelopmentPath=/home/emk/w/src/rust-libs/rls_vscode
TypeError: Cannot read property 'dispose' of null
at LanguageClient.cleanUp (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-languageclient/lib/main.js:647:30)
at LanguageClient.stop (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-languageclient/lib/main.js:621:14)
at LanguageClient.handleConnectionError (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-languageclient/lib/main.js:882:18)
at errorHandler (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-languageclient/lib/main.js:744:19)
at /home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-languageclient/lib/main.js:47:42
at CallbackList.invoke (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-jsonrpc/lib/events.js:103:39)
at Emitter.fire (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-jsonrpc/lib/events.js:167:36)
at writeErrorHandler (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-jsonrpc/lib/main.js:113:22)
at CallbackList.invoke (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-jsonrpc/lib/events.js:103:39)
at Emitter.fire (/home/emk/w/src/rust-libs/rls_vscode/node_modules/vscode-jsonrpc/lib/events.js:167:36)
Would be useful when testing the extension if it was logged to console or something otherwise getting the backtrace of a crash is hard.
Following the instructions from here. I open the extension in vs code and run it. When I open a cargo project it always errors with this: spawn els enoent. I've tried running the rls with cargo run
and then running the vscode extension, this does not make any differences. I am using rustup, and have the rls as well as the cargo project set to the same nightly. Any help or suggesting welcome. Thanks
Whenever I start the extension using the debug launch extension in VS Code. The following error comes up in the debugging console. The Window shows the message "RLS status: starting up" all the time.
/usr/share/code/code --debugPluginHost=32801 --extensionDevelopmentPath=/home/aman/Desktop/rls_vscode
Uncaught Exception: Error: spawn rls ENOENT
Error: spawn rls ENOENT
$ npm install
npm WARN package.json [email protected] No repository field.
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'types/mocha' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'rls_vscode'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 4.6.0-1-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd rls_vscode
npm ERR! node -v v4.3.1
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! npm-debug.log
npm ERR! not ok code 0
npm-debug.log contains the following:
55 http 404 https://registry.npmjs.org/types/mocha
56 silly registry.get cb [ 404,
56 silly registry.get { 'content-type': 'application/json',
56 silly registry.get 'cache-control': 'max-age=0',
56 silly registry.get 'content-length': '2',
56 silly registry.get 'accept-ranges': 'bytes',
56 silly registry.get date: 'Wed, 18 Jan 2017 11:56:50 GMT',
56 silly registry.get via: '1.1 varnish',
56 silly registry.get age: '0',
56 silly registry.get connection: 'close',
56 silly registry.get 'x-served-by': 'cache-hhn1545-HHN',
56 silly registry.get 'x-cache': 'MISS',
56 silly registry.get 'x-cache-hits': '0',
56 silly registry.get 'x-timer': 'S1484740609.979077,VS0,VE329',
56 silly registry.get vary: 'Accept-Encoding' } ]
57 silly lockFile 96189d3f-types-mocha-2-2-32 types/mocha@^2.2.32
58 silly lockFile 96189d3f-types-mocha-2-2-32 types/mocha@^2.2.32
59 error 404 Not Found
59 error 404
59 error 404 'types/mocha' is not in the npm registry.
59 error 404 You should bug the author to publish it
59 error 404 It was specified as a dependency of 'rls_vscode'
59 error 404
59 error 404 Note that you can also install from a
59 error 404 tarball, folder, or http url, or git url.
60 error System Linux 4.6.0-1-amd64
61 error command "/usr/bin/nodejs" "/usr/bin/npm" "install"
62 error cwd rls_vscode
63 error node -v v4.3.1
64 error npm -v 1.4.21
65 error code E404
Followed instructions from here. After vscode opens the new window for the plugin I see this in the debug console.
The Rust Language Service server crashed 5 times in the last 3 minutes. The server will not be restarted.
e.doShow @ messageService.ts:128
e.show @ messageService.ts:107
(anonymous function) @ mainThreadMessageService.ts:55
n.Class.derive._oncancel @ winjs.base.raw.js:164
1t.$showMessage @ mainThreadMessageService.ts:25
e.handle @ abstractThreadService.ts:34
s @ ipcRemoteCom.ts:269
f @ ipcRemoteCom.ts:226
_combinedTickCallback @ internal/process/next_tick.js:67
_tickCallback @ internal/process/next_tick.js:98
I am on latest macOS. How can I debug this issue further?
Just realized I am using rustup which is not recommended. What is the reason for not using rustup?
At this time, this project does not use any continuous integration service like TravisCI.
When debugging and you try to step into std library code (for example HashMap::new()
) in VS Code the following error message is displayed:
Unable to open 'map.rs': File not found (/buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libstd/collections/hash/map.rs).
RUST_SRC_PATH
environment variable for Racer is set up
OS: Ubuntu 16.04
VSCode: 1.11.1
rust-toolchain: nightly-2017-04-11
rls: d385f44
rls_vscode: 40044e9
Wish My bug report could have more details than this :(
[Info - 10:40:22 PM] Connection to server got closed. Server will restart.
[Info - 10:40:24 PM] Connection to server got closed. Server will restart.
[Info - 10:40:27 PM] Connection to server got closed. Server will restart.
[Info - 10:40:29 PM] Connection to server got closed. Server will restart.
[Error - 10:40:31 PM] Connection to server got closed. Server will not be restarted.
I have two files in my project, main.rs and other.rs.
If I do 'format document' on my other.rs, it works fine. If, instead, I do format document on my main.rs, it doesn't do anything and leaves the file as is (complete with trailing spaces).
Switching to Yarn would give us a couple easy wins here—builds would be coming both deterministic and much faster. Not to mention the obvious synergy of using another package manager Yehuda helped with, right? 😏
Tasks this would entail:
yarn
(perhaps with fallback to npm install
)yarn.lock
fileHappy to submit a PR to do those. 😄
If I hold command
on macOS, and hover over a symbol that I can't goto def, I see this error in the output:
[Error - 1:47:26 PM] Request textDocument/definition failed.
Message: GotoDef failed to complete successfully
Code: -32601
I.e., opening a rust file without opening the whole project as a folder. This makes the RLS unhappy. We should detect this situation and not start the RLS (or let it exit gracefully) and inform the user.
Or should we combine them?
Hello again!
This problem is somehow related to the problem described by @perlun in #14. I tried to reproduce the issue. I managed to get the same error and followed these steps:
6f46a9f
)npm install
in project rootPossible regression
When the RLS_ROOT
environment variable isn't present, the extension attempts to start RLS by spawning a child process with the command rls
. If we follow the instructions in the README, we should have installed RLS with rustup, which means that the child process should be using the command rustup
with the arguments ["run", "nightly", "rls"]
.
RLS VS Code doesn't work well with VS Code hot exit feature (preserving unsaved changes to files on exit).
Steps to reproduce:
unwrap
-> unwrp
).Expected result:
unwrp
is still underlined with red.
Actual result:
unwrp
is not underlined and hover shows the doc for unwrap
unwrap
Expected result:
No errors
Actual result:
Error: unwraap
not found.
Environment:
gentoo linux x64
vscode 1.9
rustc 1.16.0-nightly (eedaa94e3 2017-02-02)
rls fb63cd5fb
rls_vscode 12d432e3b
I feel this project should be placed in rust-lang-nursery by these reasons:
On ubunt 16.04
VSCode: 1.8.1
npm: 3.10.10
node: 6.9.4
Commit: e7f8a8b(master)
Developer console: Activating extension JanathanTurner.rls_vscode
failed: undefined
I have RLS_ROOT pointing at a built rls.
I keep getting "[ERROR] The Rust Language Service server crashed 5 times in the last 3 minutes. The server will not be restarted." Is there any way I can get output from the server to see what might be happening?
I noticed that if I'm editing, I'll sometimes miss that the rls is still working.
In this case, the vscode plugin lists the analysis as being complete when it's not. This is mostly just confusing, as the rls/plugin do sync back up and become available again.
kelvin@gnux:~/rls_vscode> vsce package
Executing prepublish script 'npm run vscode:prepublish'...
Error: Command failed: npm run vscode:prepublish
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] vscode:prepublish: tsc -p ./
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] vscode:prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kelvin/.npm/_logs/2017-06-17T08_06_39_393Z-debug.log
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.