Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVS does not prompt for RLS install #16

Open
brackleian opened this issue Feb 28, 2019 · 21 comments
Open

MSVS does not prompt for RLS install #16

brackleian opened this issue Feb 28, 2019 · 21 comments

Comments

@brackleian
Copy link

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
Copy link
Owner

ZoeyR commented Feb 28, 2019

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
Copy link
Author

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

@ZoeyR
Copy link
Owner

ZoeyR commented Feb 28, 2019

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

@brackleian
Copy link
Author

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

@ZoeyR
Copy link
Owner

ZoeyR commented Mar 1, 2019

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

@brackleian
Copy link
Author

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
Copy link
Author

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

@ZoeyR
Copy link
Owner

ZoeyR commented Mar 1, 2019

is rustup on your PATH?

@brackleian
Copy link
Author

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

@brackleian
Copy link
Author

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

@brackleian
Copy link
Author

Still no change in MSVS's behaviour ...

@brackleian
Copy link
Author

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
Copy link
Owner

ZoeyR commented Mar 1, 2019

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
Copy link
Author

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

@ZoeyR
Copy link
Owner

ZoeyR commented Mar 1, 2019

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
Copy link
Author

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
Copy link
Owner

ZoeyR commented Mar 1, 2019

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
Copy link
Author

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
Copy link
Owner

ZoeyR commented Mar 2, 2019

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

@tomerze
Copy link

tomerze commented Jun 23, 2019

Exactly the same behavior for me.

@techvslife
Copy link

techvslife commented Aug 29, 2019

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

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

No branches or pull requests

4 participants