vscode-rust extension does not start #143
Comments
@pftbest, |
Yes, strage, it was working great until recently. I think I just updated rust nightly and updated racer. |
@pftbest, |
Yes it worked before. I don't know what versions I was using. Now with latest nightly and latest racer it doesn't work. |
I suspect that racer may be crashing, but I don't know for sure, because I don't see any logs. The only log I have is this error in developer console. |
@pftbest, |
I tried stating code from the terminal and it works. When I start it from desktop icon it does not work. |
@pftbest, |
So how do I fix it? it was working before, and I don't remember changing anything |
It worked by starting VSCode from desktop? |
Yes, I always started it from desktop. I just checked RustyCode and it works from desktop, but this extension doesn't work. |
@pftbest, |
Ok, I tried to debug the extension using vscode and when I start it from debugger it fails only in 50% of launches. So it is intermittent, and maybe that is why I didn't notice it for so long. |
@pftbest, |
@pftbest, |
It is pinned in KDE 5 TaskBar Strange thing that it was working yesterday the whole evening. Today in the morning I did rustup update and cargo install --force racer. And now it doesn't work. I don't think I updated the extension and I certainly did not update vscode. |
For some reason, I am no longer able to debug the extension. |
I know what is happening. spawnedProcess.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
spawnedProcess.on('exit', code => {
console.log(`exit code: ${code}`);
}); When I run it, sometimes I see the logs in normal order:
But sometimes they are in reverse:
|
It is interesting. |
nodejs documentation even has a warning about this:
|
@pftbest, |
This change works for me. I am using --- a/src/components/configuration/configuration_manager.ts
+++ b/src/components/configuration/configuration_manager.ts
@@ -195,14 +195,17 @@ export class ConfigurationManager {
const spawnedProcess = spawn('rustc', args, options);
+ var sysroot = '';
+
return new Promise<string | undefined>(resolve => {
spawnedProcess.on('error', () => {
resolve(undefined);
});
- spawnedProcess.on('exit', code => {
- if (code === 0) {
- const sysroot = spawnedProcess.stdout.read().toString().trim();
-
+ spawnedProcess.stdout.on('data', data => {
+ sysroot = data.toString().trim();
+ });
+ spawnedProcess.on('close', code => {
+ if (code === 0 && sysroot) {
resolve(sysroot);
} else {
resolve(undefined); |
It will try to find a solution. |
Correct me if i'm wrong. I think i'm experiencing something similar. My autocomplete isnt working. I clicked on the 'Install Rust Tools' yellow text in the bottom right corner and after a while, the packages finished installing. But i didnt notice any difference in the IDE suggestions. Any idea what's causing this? Compared to rusty-code's screenshot, the suggestions seem to be a bit off. |
@amilajack, |
Yea, clicked the reload icon. That didn't work so I I closed it and reopened it manually. I should also note my vscode config: {
"rust.racerPath": null,
"rust.rustfmtPath": null,
"rust.rustsymPath": null,
"rust.rustLangSrcPath": null,
"rust.showOutput": true,
"rust.cargoPath": null,
"rust.cargoHomePath": null,
"rust.cargoEnv": null,
"rust.cargoCwd": null,
"rust.executeCargoCommandInTerminal": false,
"rust.actionOnStartingCommandIfThereIsRunningCommand": "Stop running command",
"rust.actionOnSave": null,
"rust.buildArgs": [],
"rust.checkArgs": [],
"rust.clippyArgs": [],
"rust.runArgs": [],
"rust.testArgs": [],
"rust.customBuildConfigurations": [
{
"title": "Release",
"args": [
"--release"
]
}
],
"rust.customCheckConfigurations": [
{
"title": "Release",
"args": [
"--release"
]
}
],
"rust.customClippyConfigurations": [],
"rust.customRunConfigurations": [
{
"title": "Release",
"args": [
"--release"
]
}
],
"rust.customTestConfigurations": [
{
"title": "Release",
"args": [
"--release"
]
}
],
// Rust Language Server configuration
"rust.rls": null,
} |
@amilajack, |
@KalitaAlexey I updated my comment to add my config. Hopefully that helps you with debugging |
@amilajack, |
Open a new issue for that. |
Version of VSCode: 1.10.1
Version of the extension: 0.3.10
OS: Linux 4.9.11-1-ARCH x86_64
Description:
vscode-rust extension does not start
Debug console:
Output of the "Rust logging" channel:
The text was updated successfully, but these errors were encountered: