1
0
Fork 0

Merge branch 'master' into tcp-server-fork

pull/183/head
Felix Becker 2016-11-26 13:11:54 +01:00
commit 61a5717e3c
2 changed files with 4 additions and 4 deletions

View File

@ -107,12 +107,12 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
/** /**
* The initialize request is sent as the first request from the client to the server. * The initialize request is sent as the first request from the client to the server.
* *
* @param int $processId The process Id of the parent process that started the server.
* @param ClientCapabilities $capabilities The capabilities provided by the client (editor) * @param ClientCapabilities $capabilities The capabilities provided by the client (editor)
* @param string|null $rootPath The rootPath of the workspace. Is null if no folder is open. * @param string|null $rootPath The rootPath of the workspace. Is null if no folder is open.
* @param int|null $processId The process Id of the parent process that started the server. Is null if the process has not been started by another process. If the parent process is not alive then the server should exit (see exit notification) its process.
* @return InitializeResult * @return InitializeResult
*/ */
public function initialize(int $processId, ClientCapabilities $capabilities, string $rootPath = null): InitializeResult public function initialize(ClientCapabilities $capabilities, string $rootPath = null, int $processId = null): InitializeResult
{ {
$this->rootPath = $rootPath; $this->rootPath = $rootPath;
$this->clientCapabilities = $capabilities; $this->clientCapabilities = $capabilities;

View File

@ -68,7 +68,7 @@ class LanguageServerTest extends TestCase
}); });
$server = new LanguageServer($input, $output); $server = new LanguageServer($input, $output);
$capabilities = new ClientCapabilities; $capabilities = new ClientCapabilities;
$server->initialize(getmypid(), $capabilities, realpath(__DIR__ . '/../fixtures')); $server->initialize($capabilities, realpath(__DIR__ . '/../fixtures'), getmypid());
$promise->wait(); $promise->wait();
} }
@ -116,7 +116,7 @@ class LanguageServerTest extends TestCase
$capabilities = new ClientCapabilities; $capabilities = new ClientCapabilities;
$capabilities->xfilesProvider = true; $capabilities->xfilesProvider = true;
$capabilities->xcontentProvider = true; $capabilities->xcontentProvider = true;
$server->initialize(getmypid(), $capabilities, $rootPath); $server->initialize($capabilities, $rootPath, getmypid());
$promise->wait(); $promise->wait();
$this->assertTrue($filesCalled); $this->assertTrue($filesCalled);
$this->assertTrue($contentCalled); $this->assertTrue($contentCalled);