Closed PvdBerg1998 closed 5 years ago
Do you at least get the prompts to install the RLS? If you do and the RLS doesn't install then the extension is at least starting. If you do get those prompts then it sounds like the problem is that the RLS is currently unavailable on nightly. If you wish to use a different toolchain with this extension you need to set that option in Tools > Options > Rust
.
Edit: I just tested this myself and it would seem that the issue is the fact that rls-preview is unavailable in the current nightly. For now you can use the option i described above to set the extension to use a different toolchain. I would recommend nightly-2017-12-08
since that is more feature complete than the beta.
I can do more work on my end to surface the actual error to the end user. Right now the extension just silently exits when it encounters an error installing the components.
I've set the extension to use the beta channel. Any idea why it still exits?
So just to confirm,
Tools>Options>Rust
Toolchain to use setting is set to beta
.After this the extension still exits, is that correct? If so, try restarting VS first and making sure the setting stuck since I am unable to reproduce on any of my systems.
A few more questions:
rls-preview
or rls
?rls-preview
on the beta toolchainIf the components are already installed my extension won't pop up any notifications. It's main job is to launch the rls process and pass that on to the LSP extension. You can try looking in task manager to see if there is an rls.exe
process running (If you are on windows 10 you may need to expand the process tree for visual studio). Tonight I'll add some logging to the extension and send out an update. I'll update this issue with instructions on how to read the logs once the update is out.
It is also possible that the RLS is crashing on your project. If you are working with a particularly large project create a new library via cargo and see what happens then.
Was using a helloworld project so that shouldn't be the problem. The process is not being started though.
Its ugly, but I've attached a debug version of the extension RustLanguageExtension.zip unzip that and install the .vsix file. You should now get a lot of infobars when you open a rust file. Please tell me which ones you see and which is the last one.
Could you push the changes (to a separate branch)? I'm trying to build the extension myself.
I could, I just figured that just providing a vsix was simpler than having you build the extension. Allthough if you build it yourself you can debug the OnLoadedAsync method to see whats going on.
branch https://github.com/dgriffen/rls-vs2017/tree/super-infobar-debug has the changes
I only see "extension has begun launching" (or something similar) pop up 🤔
I assume you pressed continue? Well that means that it is detecting all the components as installed, but it still isn't starting. This was something I didn't predict, let me add a few more info bars.
I'm trying to debug the extension but it says: "the breakpoint will currently not be hit, no symbols have been loaded for this document". Edit: that seems to be the case, yes.
It won't bind until you actually load the extension via opening a rust file.
here is another file with even more info bars, I also pushed the changes to the super-infobar-debug branch if you'd prefer to build it.
It seems I can't debug further than the Rustup.HasToolchain
call, but I'm not experienced with debugging c# vs extensions. I can build it though, you don't need to bother uploading packages :)
Still only the first popup. Trying a popup at the end of OnLoadedAsync
Can you try debugging into HasToolchain
? I think the problem might be an await command that is never exiting, since you couldn't debug past it.
That's what I'm thinking as well. I'm never getting past the await. The command should be working though.
RunCommand
isn't even reached. Edit: might it be a permission problem?
You are pressing continue on the infobars right? cause those block execution. If so, wat. The only call that could be blocking between the first infobar and RunCommand would be OptionsModel.Toolchain.
I am. Maybe VS's await debugger is broken in the preview? It generates a state machine so I could understand if debugging such a thing would break. I'll try adding print statements somewhere in between.
The await debugger is pretty rock solid, I haven't had issues with it when I'm debugging. There must be something really screwy going on. I'm guessing something is redirecting a dll my extension uses. (Either via GAC or a binding redirect). You could try removing the ()
tuples from Rustup.rs
and replacing them with the Tuple
class.
on loaded sync entered
got toolchain, awaiting rustup.hastoolchain
Exception thrown: 'System.IO.FileNotFoundException' in RustLanguageExtension.dll
Do you not have rustup on your path?
C:\Windows\System32>rustup --version
rustup 1.7.0 (813f7b7a8 2017-10-30)
NB I've added a debug println inside HasToolchain and that didn't print anything - so maybe the Rustup.cs didn't get compiled?
Rustup.cs must get compiled, you'd have much different errors if it wasn't included in the output binary. How is your rustup path set? It looks like you were running cmd.exe as admin since it doesn't default to the system32 directory otherwise. Perharps its only on the admin path?
My rustup path is set in my user path, and my user cmd defaults to sys32 for some reason. I've pushed my extra prints if you need them https://github.com/PvdBerg1998/rls-vs2017/commit/9b5c689f7615fd18368ea02cdee1b555fadba70d . Edit: I'm off for today, it's 12:34AM here. Good luck 👍
Did that FileNotFoundException have a stack trace or anything? Because at this point my guess is that you are missing some dll on the system. Since its happening when you hit Rustup.rs it could be System.ValueTuple, which is meant to be shipped with VS. Since I can't repro on your system I pushed an update to the infobar branch that remove the valuetuples.
This fixes the problem. (And it didn't have a stack trace btw.)
I do get a lot of System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=IconAutomationText; DataItem='CompletionView' (HashCode=16558849); target element is 'CrispImage' (Name=''); target property is 'Name' (type 'String')
spam though, but that might be a different issue.
System.ValueTuple really should be included with a VS installation, it sounds like yours got corrupted somehow. Try repairing it to see if that fixes it.
Hello. I install LSP, extension but nothing happens when I open rust file. No error or other messages is provided. I'm confused...
Win7x64
Did you open an individual file or an entire folder? The RLS and the LSP extension don't work with individual files.
I open a folder. Than open a main.rs file in src subfdolder.
Hopefully its not a Win7 specific issue as I don't have any machine to test that with. It may be the same issue as PvdBerg so repairing your VS installation may be the way to go. I could remove ValueTuple to get it working for you immediately but your VS install would still be unstable since ValueTuple is used throughout VS.
After VS repairing and opening prjoect folder a toolbar with rls Install button appears. But after clicking on it a error rises in that tab:
could not install one of the required rls components
That will likely be an issue with the RLS not being available in the current nightly. It's been a major issue lately and is quite annoying. You can select your toolchain in the Tools>Options>Rust menu
Thanks. I'll wait a while with nightly.
Hello! Have this issue, only see "extension has begun launching" Tryed to repair VS - useless Have any advices?
What do you mean by seeing "extension has begun launching"? That's not a prompt that VS would normally display to you.
Tryed your extension with more info bars. RLS manually installed Windows 10
Yeah, sounds like the System.ValueTuple
issue again. I'll talk to people within VS to figure out what could be going on. VS includes System.ValueTuple
so there should be no issue using it. Sorry for the inconvenience. If I'm not able to figure out the issue by the end of the week I'll just remove tuple stuff.
Additionally, can you verify that the rest of VS is stable for you? It would help narrow down if this is a systemic VS install issue or something with my extension specifically.
Mooving back to Intellij rust)
Havent seen any problems yet with VS, but usually work in Qt Creator, therefore its hard to say. unfortunately, there isnt appropriate plugins for creator( everythings abandoned
Hi,
I'm having problems too. I followed the installation steps and everything went smooth. I have VS2107 Professional Preview on a Windows 10.
I've created a hello.rs
file at C:\test
and opened C:\test
folder in VS.
file content:
fn main() {
println!("Hello World!");
}
I've installed rustup install nightly-x86_64-pc-windows-msvc
.
rustup.exe --version
rustup 1.9.0 (57fc3c087 2018-01-04)
rustup.exe show
Default host: x86_64-pc-windows-msvc
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-msvc (default)
rustc 1.23.0 (766bd11c8 2018-01-01)
I've set rustup
in VS config:
I've tried changing nightly
for stable
but don't see anything compiled when I open the hello.rs
file.
What other info can I provide so we can debug the problem?
Cheers
First verify that the rls is included in your current nightly build. You can check this with rustup component list --toolchain nightly
. If you see rls-preview
then the rls was included. If not I recommend setting your toolchain to nightly-2017-12-08
. Also not that setting the path to rustup isn't necessary if rustup is already on your path.
Once you have that done please tell me which messages you see at the top when you open a .rs file. You should see messages to install the toolchain and install the rls components. If you don't see either of these make sure you opened a cargo project folder with the VS open folder feature.
If you still don't see any operation then I have to conclude that System.ValueTuple
is broken for you as well. Which is completely ridiculous that this keeps happening since the language server extension also relies on it.
Hi,
First of all thank you for your help. RLS is installed:
C:\Users\default3\Documents\code\daemon-rs>rustup component list --toolchain nightly
cargo-x86_64-pc-windows-msvc (default)
rls-preview-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
I've done this steps now:
cargo new --bin "test-test"
and from VS2017 Preview File -> Open Folder and select the test file that has the Cargo.toml
and src
folder with the main.rs
file. But nothing happens when I open the .rs
file :(
What other info do you need?
Cheers
Btw the first time that I opened a project it did showed something that I pressed "Install" but I don't see that anymore.
EDIT: I've repaired the VS 2017 preview installation but I'm still facing the same problem.
I've installed the two extensions into the latest VS preview, then opened a rust project. I've also tried manually installing the RLS (currently only available via the beta channel).
.. but it doesn't.