From 4063337b767cfe5ac9a0be675610a9bb7ad9c9cf Mon Sep 17 00:00:00 2001 From: Jan-Jaap Korpershoek Date: Sun, 9 Sep 2018 18:09:03 +0200 Subject: [PATCH] Add functionality for rootUri --- package-lock.json | 4 +--- src/LanguageServer.php | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd26f343..fae7b605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,6 @@ { - "name": "php-language-server", - "version": "0.0.0-development", - "lockfileVersion": 1, "requires": true, + "lockfileVersion": 1, "dependencies": { "@gimenete/type-writer": { "version": "0.1.3", diff --git a/src/LanguageServer.php b/src/LanguageServer.php index 05dd48aa..a30992bc 100644 --- a/src/LanguageServer.php +++ b/src/LanguageServer.php @@ -165,8 +165,11 @@ public function __construct(ProtocolReader $reader, ProtocolWriter $writer) * @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 Promise */ - public function initialize(ClientCapabilities $capabilities, string $rootPath = null, int $processId = null): Promise + public function initialize(ClientCapabilities $capabilities, string $rootPath = null, int $processId = null, string $rootUri = null): Promise { + if ($rootPath === null) { + $rootPath = uriToPath($rootUri); + } return coroutine(function () use ($capabilities, $rootPath, $processId) { if ($capabilities->xfilesProvider) {