1
0
Fork 0

Merge branch 'master' into formatting-hang

pull/153/head
Felix Becker 2016-11-18 14:16:13 +01:00
commit d1a4453312
2 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,6 @@
use LanguageServer\{LanguageServer, ProtocolStreamReader, ProtocolStreamWriter};
use Sabre\Event\Loop;
use Symfony\Component\Debug\ErrorHandler;
$options = getopt('', ['tcp::', 'memory-limit::']);
@ -15,7 +14,19 @@ foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../autoload.php', __DI
}
}
ErrorHandler::register();
// Convert all errors to ErrorExceptions
set_error_handler(function (int $severity, string $message, string $file, int $line) {
if (!(error_reporting() & $severity)) {
// This error code is not included in error_reporting (can also be caused by the @ operator)
return;
}
throw new \ErrorException($message, 0, $severity, $file, $line);
});
// Only write uncaught exceptions to STDERR, not STDOUT
set_exception_handler(function (\Throwable $e) {
fwrite(STDERR, (string)$e);
});
@cli_set_process_title('PHP Language Server');

View File

@ -29,7 +29,6 @@
"sabre/event": "^5.0",
"felixfbecker/advanced-json-rpc": "^2.0",
"squizlabs/php_codesniffer" : "3.0.0RC1",
"symfony/debug": "^3.1",
"netresearch/jsonmapper": "^1.0",
"webmozart/path-util": "^2.3",
"webmozart/glob": "^4.1",