rls-vs2017 icon indicating copy to clipboard operation
rls-vs2017 copied to clipboard

MSVS does not prompt for RLS install

Open brackleian opened this issue 6 years ago • 21 comments

Platform is x86 64-bit Windows 10 MSVC MSVS 2017. Installed as per instructions at https://marketplace.visualstudio.com/items?itemName=DanielGriffen.Rust#overview When I open a Rust folder, then a Rust source file, nothing special happens, apart from the source being displayed in the edit window.

>rustup component list | find "installed"
rls-x86_64-pc-windows-msvc (installed)
rust-analysis-x86_64-pc-windows-msvc (installed)
rust-src (installed)

Am I missing something obvious?

brackleian avatar Feb 28 '19 23:02 brackleian

It looks like you already have the rls installed so you shouldn't get a prompt to install it again. rls should start running and provide language features for your project.

ZoeyR avatar Feb 28 '19 23:02 ZoeyR

It doesn't; I'll remove it and start again.

brackleian avatar Feb 28 '19 23:02 brackleian

Odd. Can you open task manager and make sure that the rls executable isn't running?

ZoeyR avatar Feb 28 '19 23:02 ZoeyR

Did that; it's definitely not running. Checked with ps in WSL, no show.

brackleian avatar Mar 01 '19 00:03 brackleian

ps will only show the processes running under WSL afaik. You need to be using native windows rust for this.

ZoeyR avatar Mar 01 '19 00:03 ZoeyR

With task mgr I could not see anything with 'rls' in its name.

One thing I did notice, after removing rls and starting MSVS again, was that it now offered a 'path to rustup' in the options; that was missing before. I've entered the correct path, and on the first run of MSVC it did say 'missing components', and when I clicked 'install', the 'ready' indicator flickered for a couple of seconds, but nothing else happened.

brackleian avatar Mar 01 '19 00:03 brackleian

Checked after the above, and rls was installed, but still not running.

brackleian avatar Mar 01 '19 00:03 brackleian

is rustup on your PATH?

ZoeyR avatar Mar 01 '19 00:03 ZoeyR

My home dir .cargo\bin is on the path, and rustup.exe is certainly in that dir.

brackleian avatar Mar 01 '19 00:03 brackleian

Have added that to system path,in case MSVS needs it to be there; a moment while I restart ...

brackleian avatar Mar 01 '19 00:03 brackleian

Still no change in MSVS's behaviour ...

brackleian avatar Mar 01 '19 00:03 brackleian

I have tried uninstalling the VS Rust extension, uninstalling Rust completely, reinstalling both. On opening the Rust source file, VS prompts for installing; it takes a few seconds, then sits there doing nothing. Task manager shows rls running as a sub-process of VS. It also shows rustup running there too - is this expected? What is rustup trying to do? Rustup from command line shows rls, rust-analysis, and rust-src as installed. Is there any other config to do to VS? Does it matter if VS uses stable or nightly?

brackleian avatar Mar 01 '19 03:03 brackleian

rustup is used to run the rls. If you see the rls running as a subprocess of VS then everything should be working as expected.

ZoeyR avatar Mar 01 '19 04:03 ZoeyR

OK, but nothing is happening in VS! Especially, no compilation of Rust. Very grateful for any ideas for debugging this one.

brackleian avatar Mar 01 '19 07:03 brackleian

Are you opening your Rust project with open folder? And if so try hovering over a variable, if you get hover text (like the type name showing up) then the RLS is working. Try it with a small project first just in case the background compilation time is taking too long.

ZoeyR avatar Mar 01 '19 16:03 ZoeyR

Yes, open folder, selecting the one with Cargo.toml in. My test project is basically a hello world, so added a variable, and yes, hovering over it displays the type and the definition. Progress! It must have been working all along, but it makes no sign of doing the compilation. Examining the target folder (after deleting it and restarting VS) found a whole tree of stuff, so looks like it might have at least tried. But can't see an executable file in there, and VS offers no way of executing or debugging (menu items greyed out)

brackleian avatar Mar 01 '19 20:03 brackleian

The support is purely through the RLS, so there is no tie-in to the VS F5 features. Odd that there was no exe though. If there was the simple way to debug is to right-click on the exe in the target folder and there should be an option to debug. The lack of compilation notifications is something I am aware of and will start working on a fix for that.

ZoeyR avatar Mar 01 '19 21:03 ZoeyR

The compiler has done something (see screenshot) but not as far as the .exe. Could it have failed the link for some reason (VS or Rust config) ? The lack of error messages is disconcerting. Perhaps VS could be persuaded to show the output of the build process?

vs-rust-after-compile

You've done a great job so far. My primary reasons for developing under VS were: nice IDE (check), great source editor (check), GUI debugger. Thanks for all your help; will await new versions with interest.

brackleian avatar Mar 02 '19 02:03 brackleian

hmm, I'll have to double check then. Maybe the RLS behaviour has changed recently. Thanks for all the diagnostic info.

ZoeyR avatar Mar 02 '19 03:03 ZoeyR

Exactly the same behavior for me.

tomerze avatar Jun 23 '19 08:06 tomerze

It seems this report might be relevant here, thanks:

I have Visual Studio 2019 but get this error message from the Rust extension, even though rustup is in the path (i.e. accessible and working fine from every folder on my desktop): "could not start the rls: rustup is not installed or not on the path." I've tried uninstalling and re-installing the extension, but it does not solve the issue. I have the correct path to rustup in tools, options, rust, language server, and have "stable" under "toolchain to use."

techvslife avatar Aug 29 '19 01:08 techvslife