OmniSharp / omnisharp-sublime

C# IDE Plugin for Sublime Text 3
http://omnisharp-sublime.readthedocs.org/en/latest/
MIT License
551 stars 64 forks source link

[bugfix] Omnisharp: Error talking to http://localhost:port/checkreadystatus #236

Closed scorpiohjx closed 6 years ago

scorpiohjx commented 6 years ago

This is my first time to use OmniSharp, sadly, I meet this fxxk error all the time. Worse, I found that so many people meet this error too, however, no one can fix it. After 2 day's working hard, I finally fix this bug!

  1. Open "~/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/omnisharp.py", locate to line 187, the original script is following: if data == False:
  2. Change this line to: if data == False or data == None:
  3. Restart ST3, done!

If you review code from line 185 to line 197, the definition of function ready_status_handler, you will dead easily find, that the if...else is uncompleted! A boolean in python can be True, False, and None! If you review the whole omnisharp.py, you will find that the function receive None almost every time. That is the key point!

Similar mistake appears at the bottom of this python script, from line 202 to line 208. And the same resolution to deal with it.

Let me explain more detailly. OmniSharp will retry to talk with server Inside the function ready_status_handler, from line 188 to line 193, up to 5 times. The retry work will run when receive False. When receive None, the original script will do nothing, remaining the forever Error Message on ST's status bar, so sickly! After this fix, OmniSharp will really retry to connect the server again and again, changing Error Message if something difference happens.

ProgrammingLife commented 6 years ago

Didn't help me. Still have the checkreadystatus-problem even after changing those lines on my MacOS 10.12.

AntKarlov commented 6 years ago

For a long time I was tormented by the problem when OmniSharp did not load, I had to restart SblimeText several times before I could start OmniSharp. After making these changes, the project began to loaded from first attempt. Of course sometimes I get a message CheckReadyStatus but if wait a few more seconds, a message appears to "Project Loaded" -> "Server Running" and everything works fine!

Thank you very much!

scorpiohjx commented 6 years ago

@ProgrammingLife OmniSharp has far more than this one problem, you must have something wrong else anywhere. When start a C# project with ST3, press control+`, review the ST3 log, you may find other problems. May be there are something wrong with ST3 project settings, or with OmniSharp settings. You should check about all array in OmniSharp settings, make sure each array NOT ends with a comma, otherwise OmniSharp cannot load those settings correctly, error will occurs like Tree Element is Empty.

@AntKarlov Very glad to solve your problem, you're welcome!

Rosalie241 commented 6 years ago

that fixed it for me, thanks @scorpiohjx

Rosalie241 commented 6 years ago

This change is now merged https://github.com/OmniSharp/omnisharp-sublime/commit/f2d8d872ec1678ef63572a808a6d19c433c47827 thanks again!

mominzahid commented 6 years ago

This is my first time to use OmniSharp, sadly, I meet this fxxk error all the time. Worse, I found that so many people meet this error too, however, no one can fix it. After 2 day's working hard, I finally fix this bug!

  1. Open "~/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/omnisharp.py", locate to line 187, the original script is following: if data == False:
  2. Change this line to: if data == False or data == None:
  3. Restart ST3, done!

If you review code from line 185 to line 197, the definition of function ready_status_handler, you will dead easily find, that the if...else is uncompleted! A boolean in python can be True, False, and None! If you review the whole omnisharp.py, you will find that the function receive None almost every time. That is the key point!

Similar mistake appears at the bottom of this python script, from line 202 to line 208. And the same resolution to deal with it.

Let me explain more detailly. OmniSharp will retry to talk with server Inside the function ready_status_handler, from line 188 to line 193, up to 5 times. The retry work will run when receive False. When receive None, the original script will do nothing, remaining the forever Error Message on ST's status bar, so sickly! After this fix, OmniSharp will really retry to connect the server again and again, changing Error Message if something difference happens.

I do not have a Sublime Text 3 folder in the Library/Application Support :( where else could it be?

Rosalie241 commented 6 years ago

@mominzahid this change has already been included in the main project so if you receive any other errors, please report them in a new issue.