ZoeyR / rls-vs2017

Rust extension for Visual Studio 2017 with RLS support
MIT License
110 stars 12 forks source link

MSVS does not prompt for RLS install #16

Open brackleian opened 5 years ago

brackleian commented 5 years ago

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?

ZoeyR commented 5 years ago

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.

brackleian commented 5 years ago

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

ZoeyR commented 5 years ago

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

brackleian commented 5 years ago

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

ZoeyR commented 5 years ago

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

brackleian commented 5 years ago

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 commented 5 years ago

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

ZoeyR commented 5 years ago

is rustup on your PATH?

brackleian commented 5 years ago

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

brackleian commented 5 years ago

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

brackleian commented 5 years ago

Still no change in MSVS's behaviour ...

brackleian commented 5 years ago

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?

ZoeyR commented 5 years ago

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.

brackleian commented 5 years ago

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

ZoeyR commented 5 years ago

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.

brackleian commented 5 years ago

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)

ZoeyR commented 5 years ago

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.

brackleian commented 5 years ago

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.

ZoeyR commented 5 years ago

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

tomerze commented 5 years ago

Exactly the same behavior for me.

techvslife commented 5 years ago

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."