-
Notifications
You must be signed in to change notification settings - Fork 686
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
Omnisharp is stuck at starting phase with nothing happening #804
Comments
The original code you point out should be fine. In your example, function launchNixMono(details) {
return new Promise(function (resolve, reject) {
canLaunchMono().then(function () {
var args = details.args.slice(0); // create copy of details.args
args.unshift(details.serverPath);
var process = child_process_1.spawn('mono', args, {
detached: false,
cwd: details.cwd
});
resolve({
process: process,
command: details.serverPath,
usingMono: true
});
}, reject);
});
} the call to TL;DR: by removing the |
I may be missing something there but I think that you are wrong, returning the call to canLaunchMono inside the Promise executor has no effect there since we already returned You can see thereafter in the code you quoted that every path is calling either resolve or reject and thus the async termination is fully handled which was not the case in the original code. And I repeat, returning inside a Promise executor (the callback inside the |
Ah, I think you are right @narf . My apologies. Thanks for the opportunity to learn :) |
yeah, this is totally a bug. I don't know what I was thinking when I wrote that. 😄 |
Sometimes I'll return a |
FWIW, it's not clear to me that this would fix your issue based on the information that you provided. The C# extension does not use Mono by default on ubuntu 16.04. Instead, it will use the Ubuntu 16.04 flavor of OmniSharp, which is a standalone .NET Core app. @narf, did you verify that this actually fixes your problem? |
Adding the Still looking for it but I'm not sure that it is an omnisharp problem. |
I've looked through all of the launch code, and I don't think the right fix is quite what you suggest.
Could you take a quick look at #807? I'm curious to know whether this addresses your scenario by properly allowing rejections and thrown exceptions to bubble up and properly cancel the server launch. |
There is a new beta of the C# extension available here that should address this problem. Feel free to try it out and let me know if it address the issue for you. |
This is probable more of an omnisharp error, but I post the problem here you guys probably know better what to do with this.
Environment data
dotnet --info
output:VS Code version: 1.5.3
C# Extension version: 1.4.1
Steps to reproduce
Try to install on linux with mono flavour and a mono version <4.0.1 (or maybe no mono installed)
Expected behavior
An error should be displayed
Actual behavior
No error is displayed, the omnisharp server just hang on startup stage
How to fix
in out/omnisharp/launcher.js change
to
Why are they returning a promise in a promise? I think this is not how es6 Promise works, the callback of the new Promise thing should not return anything. The whole code return things inside its callback it would probably be better to rewrite them.
The text was updated successfully, but these errors were encountered: