Skip to content

Commit 47b5b67

Browse files
authored
Restart without XDebug if enabled (#259)
1 parent 96aa998 commit 47b5b67

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bin/php-language-server.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use LanguageServer\{LanguageServer, ProtocolStreamReader, ProtocolStreamWriter};
44
use Sabre\Event\Loop;
5+
use Composer\{Factory, XdebugHandler};
56

67
$options = getopt('', ['tcp::', 'tcp-server::', 'memory-limit::']);
78

@@ -30,6 +31,9 @@
3031

3132
@cli_set_process_title('PHP Language Server');
3233

34+
// If XDebug is enabled, restart without it
35+
(new XdebugHandler(Factory::createOutput()))->check();
36+
3337
if (!empty($options['tcp'])) {
3438
// Connect to a TCP server
3539
$address = $options['tcp'];

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"webmozart/path-util": "^2.3",
3737
"webmozart/glob": "^4.1",
3838
"sabre/uri": "^2.0",
39-
"JetBrains/phpstorm-stubs": "dev-master"
39+
"JetBrains/phpstorm-stubs": "dev-master",
40+
"composer/composer": "^1.3"
4041
},
4142
"repositories": [
4243
{

0 commit comments

Comments
 (0)